* Update dependencies from https://github.com/dotnet/aspnetcore build
20220406.3 (#2990)
[main] Update dependencies from dotnet/aspnetcore
* Update dependencies from https://github.com/dotnet/runtime build
20220406.5 (#2991)
[main] Update dependencies from dotnet/runtime
* Set the build ID using arcade's scripts instead of retrieving it from another job (#2993)
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220328.1 (#2967)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/arcade build
20220406.10 (#3000)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/symstore build
20220410.1 (#3002)
Microsoft.SymbolStore
From Version 1.0.320401 -> To Version 1.0.321001
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/installer build
20220410.6 (#3001)
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.104-servicing.22181.15 -> To Version 6.0.104-servicing.22210.6
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/symstore build
20220411.1 (#3007)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220411.2 (#3006)
[main] Update dependencies from dotnet/aspnetcore
* Update dependencies from https://github.com/dotnet/runtime build
20220411.4 (#3008)
[main] Update dependencies from dotnet/runtime
* Update dependencies from https://github.com/dotnet/runtime build
20220412.7 (#3011)
[main] Update dependencies from dotnet/runtime
* Update dependencies from https://github.com/dotnet/symstore build
20220412.1 (#3010)
[main] Update dependencies from dotnet/symstore
* Rewrite DumpAsync in C# (#2964)
* Rewrite DumpAsync in C#
This rewrites the dumpasync command as a C# SOS extension. Doing so makes the code easier to maintain and add features to in the future. Along with the rewrite, a variety of requests for the feature have been satisfied:
- Added a "coalesced stacks" view (`--coalesce`) that coalesces stacks together to create a high-level view of the state of the process
- Improved filtering so that a specified filter (address, method table, substring) applies to any frame of a stack and not just to the top frame
- Improved stack stitching to always consider task objects from the heap and not just if `--tasks` was specified. This helps to better connect state machines separated by constructs like Task.Run.
- Added synthesized frames to try to show what's being awaited in the case where the top frame is an async method.
- Added DML links for more things to better navigate through results.
* Fix tests
* Fix tests for DumpAsync on WebApp3
* Skip visiting tasks multiple times
* Special case completion sentinnel
* Only synthesize faux awaiter frame if the task is not completed.
* PR feedback
Co-authored-by: Juan Sebastian Hoyos Ayala <juan.hoyos@microsoft.com>
* Update dependencies from https://github.com/dotnet/runtime build
20220413.11 (#3014)
Microsoft.NETCore.App.Runtime.win-x64 , VS.Redist.Common.NetCore.SharedFramework.x64.6.0
From Version 6.0.5 -> To Version 6.0.5
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220413.12 (#3013)
[main] Update dependencies from dotnet/aspnetcore
* Use symstore retry changes in tests (#2968)
* Create clear error messages for dotnet-trace (#3012)
* Catch UnauthorizedAccessException, Win32Exception and simplify for loop
* altered to conventional C# style
* Set symstore HTTP retry count in all test cases (#3015)
* Set symstore HTTP retry count in all test cases
* Update src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
* Code review feedback
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220415.1 (#3016)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/arcade build
20220415.2 (#3017)
[main] Update dependencies from dotnet/arcade
* Update lldb instuctions (#3020)
Mostly just delete distro versions that are not supported for any supported .NET version.
* Use minipal in more places (#3019)
* Port minipal/getexepath.h from runtime repo
* Use ARRAY_SIZE from minipal in more places
* Fix C4996 warning on windows
* Introspect sys/auxv.h in SOS configuration
* Fix include
* [main] Update dependencies from dotnet/installer (#3018)
* Update dependencies from https://github.com/dotnet/installer build
20220415.3
Microsoft.Dotnet.Sdk.Internal
From Version 6.0.104-servicing.22210.6 -> To Version 6.0.105-servicing.22215.3
* Fix single-file runtime version
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Mike McLaughlin <mikem@microsoft.com>
* Update dependencies from https://github.com/dotnet/symstore build
20220418.1 (#3022)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220419.2 (#3023)
[main] Update dependencies from dotnet/source-build-reference-packages
* Create EventPipeFormat.md (#3024)
* Update dependencies from https://github.com/dotnet/arcade build
20220422.4 (#3027)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/installer build
20220419.37 (#3028)
[main] Update dependencies from dotnet/installer
* dotent-trace report - account for missing symbol (#3021)
* Update dependencies from https://github.com/microsoft/clrmd build
20220426.1 (#3035)
[main] Update dependencies from microsoft/clrmd
* Write temp files to tempdir (#3031)
* update to use viewport-relative coordinates (#3034)
This fixes some rendering issues of dontet-counters, however, dotnet-counters renders incorrectly when:
- terminal changes size while the tool is running
- terminal is not wide enough to print the output
As noted in #3036
* Update dependencies from https://github.com/dotnet/installer build
20220429.9 (#3038)
[main] Update dependencies from dotnet/installer
* Update dependencies from https://github.com/dotnet/arcade build
20220425.6 (#3037)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/symstore build
20220502.1 (#3040)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220503.1 (#3043)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220503.6 (#3041)
[main] Update dependencies from dotnet/aspnetcore
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220504.3 (#3045)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220504.26 (#3044)
[main] Update dependencies from dotnet/aspnetcore
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220505.18 (#3046)
[main] Update dependencies from dotnet/aspnetcore
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220505.1 (#3048)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/microsoft/clrmd build
20220505.1 (#3047)
[main] Update dependencies from microsoft/clrmd
* Update EventPipeStress (#3049)
* Update dependencies from https://github.com/dotnet/arcade build
20220505.2 (#3052)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/installer build
20220504.12 (#3053)
[main] Update dependencies from dotnet/installer
* Update dependencies from https://github.com/microsoft/clrmd build
20220509.1 (#3056)
[main] Update dependencies from microsoft/clrmd
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220509.4 (#3058)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/symstore build
20220509.1 (#3057)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220509.8 (#3055)
[main] Update dependencies from dotnet/aspnetcore
* Port setsymbolserver command to C# (#3050)
* Port setsymbolserver command to C#
Fixes issue: https://github.com/dotnet/diagnostics/issues/3032
Removes quite a bit of native and interop code.
Remove some noisy logging in success paths.
Rename ISymbolService.DownloadModule to DownloadModuleFile. Add ISymbolService.DownloadSymbolFile.
Rename some IModule properties to functions. Add IModule.LoadSymbols().
Fix MacOS test failures
Make setsymbolserver a global command
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220510.8 (#3063)
[main] Update dependencies from dotnet/aspnetcore
* Enable SDL required warnings explicitly (#3054)
* Enable SDL required warnings explicitly
* Fix build issues that don't escape on failure properly
* Add devcontainer infra to diagnostics repo (#2986)
* Pass by reference (#3066)
* Update dependencies from https://github.com/dotnet/aspnetcore build
20220512.8 (#3070)
[main] Update dependencies from dotnet/aspnetcore
* Fix Typo (#3071)
* Misc dbgshim and SOS fixes (#3072)
* Fix some issues found with netcoredbg
* Fix some sign-extension issues on alpine arm32
* Fix DbgShim.UnitTest's Microsoft.Diagnostics.DbgShimAPI+NativeRuntimeStartupCallbackDelegate being called after collected by the GC
* Code review feedback
* [main] Update dependencies from dotnet/installer (#3076)
[main] Update dependencies from dotnet/installer
- Update single-file version
* Update dependencies from https://github.com/dotnet/symstore build
20220516.1 (#3079)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/arcade build
20220512.8 (#3075)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220511.1 (#3068)
[main] Update dependencies from dotnet/source-build-reference-packages
* Update dependencies from https://github.com/dotnet/arcade build
20220519.3 (#3086)
[main] Update dependencies from dotnet/arcade
* Enable shipping dbgshim packages (#3088)
* Add error message to WriteDump response (#3084)
Add error message to WriteDump response
Add the new generate core dump command that can receive error text on failure.
Fix issue #2976
* Use Environment.GetFolderPath to obtain home directory (#3087)
* Use Environment.GetFolderPath to obtain home directory
* Format documents in changeset
* Update dependencies from https://github.com/dotnet/symstore build
20220523.1 (#3091)
[main] Update dependencies from dotnet/symstore
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build
20220520.1 (#3085)
[main] Update dependencies from dotnet/source-build-reference-packages
* SOS fixes for regions (#3062)
Noticed that DacpHeapSegmentData::Request doesn't set the highAllocMark for regions correctly, and that we haven't fixed GCHeapSnapshot::GetGeneration for regions yet.
Moved fix for highAllocMark into the DAC, but keep some logic here so things work correctly for older DACs with segments.
Fix more places where we need to use highAllocMark.
Kudos to @cshung for pointing out the better way to fix this!
* Update dependencies from https://github.com/dotnet/arcade build
20220526.1 (#3096)
[main] Update dependencies from dotnet/arcade
* Update dependencies from https://github.com/dotnet/installer build
20220527.1 (#3097)
[main] Update dependencies from dotnet/installer
* Update dependencies from https://github.com/dotnet/symstore build
20220530.1 (#3098)
[main] Update dependencies from dotnet/symstore
* Fix dbgshim's OpenVirtualProcess on windows arm64 (#3099)
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Juan Hoyos <juan.s.hoyos@outlook.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Juan Sebastian Hoyos Ayala <juan.hoyos@microsoft.com>
Co-authored-by: mikelle-rogers <45022607+mikelle-rogers@users.noreply.github.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: John Salem <josalem@microsoft.com>
Co-authored-by: Andrew Au <andrewau@microsoft.com>
Co-authored-by: Martin-Molinero <martin@quantconnect.com>
Co-authored-by: Peter Sollich <petersol@microsoft.com>
<Dependencies>
<ProductDependencies>
- <Dependency Name="Microsoft.SymbolStore" Version="1.0.326601">
+ <Dependency Name="Microsoft.SymbolStore" Version="1.0.328001">
<Uri>https://github.com/dotnet/symstore</Uri>
- <Sha>073abc4f492cbc6795989e4a813b0d32017a8623</Sha>
+ <Sha>1ff51a5afa61af820a14b3aa84b401d1a79bc783</Sha>
</Dependency>
<Dependency Name="Microsoft.Diagnostics.Runtime" Version="2.0.325901">
<Uri>https://github.com/microsoft/clrmd</Uri>
<Uri>https://github.com/microsoft/clrmd</Uri>
<Sha>a64d9ac11086f28fbd4b2b2337c19be7826fbfa9</Sha>
</Dependency>
- <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="7.0.0-alpha.1.22261.1">
+ <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="7.0.0-alpha.1.22270.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
- <Sha>c71ce108eda9f657c9f58a613a1fe56b6b08235d</Sha>
+ <Sha>3dbb19f76474f2f22749b2e64d34c15178381ffb</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
- <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22269.3">
+ <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22276.1">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>0403b0d07aff1b103256cfbe082c97a5c8846d20</Sha>
+ <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
- <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="7.0.0-beta.22269.3">
+ <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="7.0.0-beta.22276.1">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>0403b0d07aff1b103256cfbe082c97a5c8846d20</Sha>
+ <Sha>b8b67b243ba93bf9b89390c85b4dee034d3c5609</Sha>
</Dependency>
- <Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.106-servicing.22263.13">
+ <Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.106-servicing.22277.1">
<Uri>https://github.com/dotnet/installer</Uri>
- <Sha>ee1b7085a6eb99c97851ed67fc3fd52b8bda3ba0</Sha>
+ <Sha>0632d08f8d604ed2a9ea697e88991b7f2ec68141</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.App.Ref.Internal" Version="6.0.6-servicing.22262.8">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<!-- The SDK runtime version used to build single-file apps (currently hardcoded) -->
<SingleFileRuntimeVersion>6.0.5</SingleFileRuntimeVersion>
<!-- Latest symstore version updated by darc -->
- <MicrosoftSymbolStoreVersion>1.0.326601</MicrosoftSymbolStoreVersion>
+ <MicrosoftSymbolStoreVersion>1.0.328001</MicrosoftSymbolStoreVersion>
<!-- Runtime versions to test -->
<MicrosoftNETCoreApp31Version>3.1.18</MicrosoftNETCoreApp31Version>
<MicrosoftAspNetCoreApp31Version>$(MicrosoftNETCoreApp31Version)</MicrosoftAspNetCoreApp31Version>
<MicrosoftAspNetCoreAppRefInternalVersion>6.0.6-servicing.22262.8</MicrosoftAspNetCoreAppRefInternalVersion>
<MicrosoftAspNetCoreAppRefVersion>6.0.6</MicrosoftAspNetCoreAppRefVersion>
<!-- dotnet/installer: Testing version of the SDK. Needed for the signed & entitled host. -->
- <MicrosoftDotnetSdkInternalVersion>6.0.106-servicing.22263.13</MicrosoftDotnetSdkInternalVersion>
+ <MicrosoftDotnetSdkInternalVersion>6.0.106-servicing.22277.1</MicrosoftDotnetSdkInternalVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Opt-in/out repo features -->
<SystemTextEncodingsWebVersion>4.7.2</SystemTextEncodingsWebVersion>
<SystemTextJsonVersion>4.7.1</SystemTextJsonVersion>
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
- <MicrosoftDotNetRemoteExecutorVersion>7.0.0-beta.22269.3</MicrosoftDotNetRemoteExecutorVersion>
+ <MicrosoftDotNetRemoteExecutorVersion>7.0.0-beta.22276.1</MicrosoftDotNetRemoteExecutorVersion>
<cdbsosversion>10.0.18362</cdbsosversion>
<NewtonSoftJsonVersion>12.0.2</NewtonSoftJsonVersion>
</PropertyGroup>
InstallDirectory = "$ToolsDir"
}
}
+ if (Test-Path variable:NativeToolsOnMachine) {
+ Write-Host "Variable NativeToolsOnMachine detected, enabling native tool path promotion..."
+ $nativeArgs += @{ PathPromotion = $true }
+ }
& "$PSScriptRoot/init-tools-native.ps1" @nativeArgs
}
}
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "2.0.1",
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22269.3"
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22276.1"
}
}
}
else
{
- _defaultSymbolCache = Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".dotnet", "symbolcache");
+ _defaultSymbolCache = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".dotnet", "symbolcache");
}
}
return _defaultSymbolCache;
}
- set
+ set
{
_defaultSymbolCache = value;
}
symbolCachePaths.Add(DefaultSymbolCache);
}
}
- else
+ else
{
symbolCachePaths.Add(parts[i]);
}
}
}
}
- catch (Exception ex) when
- (ex is UnauthorizedAccessException ||
- ex is BadImageFormatException ||
- ex is InvalidVirtualAddressException ||
+ catch (Exception ex) when
+ (ex is UnauthorizedAccessException ||
+ ex is BadImageFormatException ||
+ ex is InvalidVirtualAddressException ||
ex is IOException)
{
Trace.TraceError($"GetMetaData: {ex.Message}");
peStream = Utilities.TryOpenFile(assemblyPath);
if (peStream == null)
return null;
-
+
options = PEStreamOptions.Default;
}
Trace.TraceWarning($"DownLoadPE: no key generated for module {fileName} ");
return null;
}
- }
+ }
else if ((flags & KeyTypeFlags.SymbolKey) != 0)
{
IEnumerable<PdbFileInfo> pdbInfos = module.GetPdbFileInfos();
return null;
}
}
- else
+ else
{
throw new ArgumentException($"Key flag not supported {flags}");
}
string pdbPath = data.Path;
Stream pdbStream = null;
- if (assemblyPath != null)
+ if (assemblyPath != null)
{
try
{
public override string ToString()
{
StringBuilder sb = new StringBuilder();
- ForEachSymbolStore<Microsoft.SymbolStore.SymbolStores.SymbolStore>((symbolStore) =>
+ ForEachSymbolStore<Microsoft.SymbolStore.SymbolStores.SymbolStore>((symbolStore) =>
{
if (symbolStore is HttpSymbolStore httpSymbolStore)
{
}
}
- private bool IsDuplicateSymbolStore<T>(Microsoft.SymbolStore.SymbolStores.SymbolStore symbolStore, Func<T, bool> match)
+ private bool IsDuplicateSymbolStore<T>(Microsoft.SymbolStore.SymbolStores.SymbolStore symbolStore, Func<T, bool> match)
where T : Microsoft.SymbolStore.SymbolStores.SymbolStore
{
while (symbolStore != null)
/// <returns>Last component of path</returns>
internal static string GetFileName(string pathName)
{
- int pos = pathName.LastIndexOfAny(new char[] { '/', '\\'});
+ int pos = pathName.LastIndexOfAny(new char[] { '/', '\\' });
if (pos < 0)
{
return pathName;
/// </summary>
private static bool IsPathEqual(string path1, string path2)
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return StringComparer.OrdinalIgnoreCase.Equals(path1, path2);
}
- else
+ else
{
return string.Equals(path1, path2);
}
/// <param name="logDumpGeneration">When set to true, display the dump generation debug log to the console.</param>
public void WriteDump(DumpType dumpType, string dumpPath, bool logDumpGeneration = false)
{
- IpcMessage request = CreateWriteDumpMessage(dumpType, dumpPath, logDumpGeneration);
- IpcMessage response = IpcClient.SendMessage(_endpoint, request);
- ValidateResponseMessage(response, nameof(WriteDump));
+ WriteDump(dumpType, dumpPath, logDumpGeneration ? WriteDumpFlags.LoggingEnabled : WriteDumpFlags.None);
}
/// <summary>
/// <param name="flags">logging and crash report flags. On runtimes less than 6.0, only LoggingEnabled is supported.</param>
public void WriteDump(DumpType dumpType, string dumpPath, WriteDumpFlags flags)
{
- IpcMessage request = CreateWriteDumpMessage2(dumpType, dumpPath, flags);
+ IpcMessage request = CreateWriteDumpMessage(DumpCommandId.GenerateCoreDump3, dumpType, dumpPath, flags);
IpcMessage response = IpcClient.SendMessage(_endpoint, request);
- if (!ValidateResponseMessage(response, nameof(WriteDump), ValidateResponseOptions.UnknownCommandReturnsFalse))
+ if (!ValidateResponseMessage(response, "Write dump", ValidateResponseOptions.UnknownCommandReturnsFalse | ValidateResponseOptions.ErrorMessageReturned))
{
- if ((flags & ~WriteDumpFlags.LoggingEnabled) != 0)
+ request = CreateWriteDumpMessage(DumpCommandId.GenerateCoreDump2, dumpType, dumpPath, flags);
+ response = IpcClient.SendMessage(_endpoint, request);
+ if (!ValidateResponseMessage(response, "Write dump", ValidateResponseOptions.UnknownCommandReturnsFalse))
{
- throw new ArgumentException($"Only {nameof(WriteDumpFlags.LoggingEnabled)} flag is supported by this runtime version", nameof(flags));
+ if ((flags & ~WriteDumpFlags.LoggingEnabled) != 0)
+ {
+ throw new ArgumentException($"Only {nameof(WriteDumpFlags.LoggingEnabled)} flag is supported by this runtime version", nameof(flags));
+ }
+ request = CreateWriteDumpMessage(dumpType, dumpPath, logDumpGeneration: (flags & WriteDumpFlags.LoggingEnabled) != 0);
+ response = IpcClient.SendMessage(_endpoint, request);
+ ValidateResponseMessage(response, "Write dump");
}
- WriteDump(dumpType, dumpPath, logDumpGeneration: (flags & WriteDumpFlags.LoggingEnabled) != 0);
}
}
/// <param name="dumpPath">Full path to the dump to be generated. By default it is /tmp/coredump.{pid}</param>
/// <param name="logDumpGeneration">When set to true, display the dump generation debug log to the console.</param>
/// <param name="token">The token to monitor for cancellation requests.</param>
- public async Task WriteDumpAsync(DumpType dumpType, string dumpPath, bool logDumpGeneration, CancellationToken token)
+ public Task WriteDumpAsync(DumpType dumpType, string dumpPath, bool logDumpGeneration, CancellationToken token)
{
- IpcMessage request = CreateWriteDumpMessage(dumpType, dumpPath, logDumpGeneration);
- IpcMessage response = await IpcClient.SendMessageAsync(_endpoint, request, token).ConfigureAwait(false);
- ValidateResponseMessage(response, nameof(WriteDumpAsync));
+ return WriteDumpAsync(dumpType, dumpPath, logDumpGeneration ? WriteDumpFlags.LoggingEnabled : WriteDumpFlags.None, token);
}
/// <summary>
/// <param name="token">The token to monitor for cancellation requests.</param>
public async Task WriteDumpAsync(DumpType dumpType, string dumpPath, WriteDumpFlags flags, CancellationToken token)
{
- IpcMessage request = CreateWriteDumpMessage2(dumpType, dumpPath, flags);
+ IpcMessage request = CreateWriteDumpMessage(DumpCommandId.GenerateCoreDump3, dumpType, dumpPath, flags);
IpcMessage response = await IpcClient.SendMessageAsync(_endpoint, request, token).ConfigureAwait(false);
- if (!ValidateResponseMessage(response, nameof(WriteDumpAsync), ValidateResponseOptions.UnknownCommandReturnsFalse))
+ if (!ValidateResponseMessage(response, "Write dump", ValidateResponseOptions.UnknownCommandReturnsFalse | ValidateResponseOptions.ErrorMessageReturned))
{
- if ((flags & ~WriteDumpFlags.LoggingEnabled) != 0)
+ request = CreateWriteDumpMessage(DumpCommandId.GenerateCoreDump2, dumpType, dumpPath, flags);
+ response = await IpcClient.SendMessageAsync(_endpoint, request, token).ConfigureAwait(false);
+ if (!ValidateResponseMessage(response, "Write dump", ValidateResponseOptions.UnknownCommandReturnsFalse))
{
- throw new ArgumentException($"Only {nameof(WriteDumpFlags.LoggingEnabled)} flag is supported by this runtime version", nameof(flags));
+ if ((flags & ~WriteDumpFlags.LoggingEnabled) != 0)
+ {
+ throw new ArgumentException($"Only {nameof(WriteDumpFlags.LoggingEnabled)} flag is supported by this runtime version", nameof(flags));
+ }
+ request = CreateWriteDumpMessage(dumpType, dumpPath, logDumpGeneration: (flags & WriteDumpFlags.LoggingEnabled) != 0);
+ response = await IpcClient.SendMessageAsync(_endpoint, request, token).ConfigureAwait(false);
+ ValidateResponseMessage(response, "Write dump");
}
- await WriteDumpAsync(dumpType, dumpPath, logDumpGeneration: (flags & WriteDumpFlags.LoggingEnabled) != 0, token);
}
}
return new IpcMessage(DiagnosticsServerCommandSet.Dump, (byte)DumpCommandId.GenerateCoreDump, payload);
}
- private static IpcMessage CreateWriteDumpMessage2(DumpType dumpType, string dumpPath, WriteDumpFlags flags)
+ private static IpcMessage CreateWriteDumpMessage(DumpCommandId command, DumpType dumpType, string dumpPath, WriteDumpFlags flags)
{
if (string.IsNullOrEmpty(dumpPath))
throw new ArgumentNullException($"{nameof(dumpPath)} required");
byte[] payload = SerializePayload(dumpPath, (uint)dumpType, (uint)flags);
- return new IpcMessage(DiagnosticsServerCommandSet.Dump, (byte)DumpCommandId.GenerateCoreDump2, payload);
+ return new IpcMessage(DiagnosticsServerCommandSet.Dump, (byte)command, payload);
}
private static ProcessInfo GetProcessInfoFromResponse(IpcResponse response, string operationName)
{
switch ((DiagnosticsServerResponseId)responseMessage.Header.CommandId)
{
+ case DiagnosticsServerResponseId.OK:
+ return true;
+
case DiagnosticsServerResponseId.Error:
uint hr = BitConverter.ToUInt32(responseMessage.Payload, 0);
+ int index = sizeof(uint);
+ string message = null;
switch (hr)
{
case (uint)DiagnosticsIpcError.UnknownCommand:
return false;
}
throw new UnsupportedCommandException($"{operationName} failed - Command is not supported.");
+
case (uint)DiagnosticsIpcError.ProfilerAlreadyActive:
throw new ProfilerAlreadyActiveException($"{operationName} failed - A profiler is already loaded.");
+
case (uint)DiagnosticsIpcError.InvalidArgument:
if (options.HasFlag(ValidateResponseOptions.InvalidArgumentIsRequiresSuspension))
{
throw new ServerErrorException($"{operationName} failed - The runtime must be suspended for this command.");
}
throw new UnsupportedCommandException($"{operationName} failed - Invalid command argument.");
+
+ case (uint)DiagnosticsIpcError.NotSupported:
+ message = $"{operationName} - Not supported by this runtime.";
+ break;
+
+ default:
+ break;
}
- throw new ServerErrorException($"{operationName} failed - HRESULT: 0x{hr:X8}");
- case DiagnosticsServerResponseId.OK:
- return true;
+ // Check if the command can return an error message and if the payload is big enough to contain the
+ // error code (uint) and the string length (uint).
+ if (options.HasFlag(ValidateResponseOptions.ErrorMessageReturned) && responseMessage.Payload.Length >= (sizeof(uint) * 2))
+ {
+ message = IpcHelpers.ReadString(responseMessage.Payload, ref index);
+ }
+ if (string.IsNullOrWhiteSpace(message))
+ {
+ message = $"{operationName} failed - HRESULT: 0x{hr:X8}.";
+ }
+ throw new ServerErrorException(message);
+
default:
throw new ServerErrorException($"{operationName} failed - Server responded with unknown response.");
}
None = 0x0,
UnknownCommandReturnsFalse = 0x1,
InvalidArgumentIsRequiresSuspension = 0x2,
+ ErrorMessageReturned = 0x4,
}
}
}
{
GenerateCoreDump = 0x01,
GenerateCoreDump2 = 0x02,
+ GenerateCoreDump3 = 0x03,
}
internal enum ProfilerCommandId : byte
/// </summary>
internal enum DiagnosticsIpcError : uint
{
+ Fail = 0x80004005,
InvalidArgument = 0x80070057,
+ NotSupported = 0x80131515,
ProfilerAlreadyActive = 0x8013136A,
BadEncoding = 0x80131384,
UnknownCommand = 0x80131385,
{
m_writeLine = writeLine;
string rid = GetRid(architecture);
- string home;
+ string home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- home = Environment.GetEnvironmentVariable("USERPROFILE");
- if (string.IsNullOrEmpty(home)) {
- throw new SOSInstallerException("USERPROFILE environment variable not found");
- }
- }
- else
- {
- home = Environment.GetEnvironmentVariable("HOME");
- if (string.IsNullOrEmpty(home)) {
- throw new SOSInstallerException("HOME environment variable not found");
- }
LLDBInitFile = Path.Combine(home, ".lldbinit");
}
InstallLocation = Path.GetFullPath(Path.Combine(home, ".dotnet", "sos"));
{
WriteLine("Installing SOS to {0}", InstallLocation);
- if (string.IsNullOrEmpty(SOSNativeSourcePath) || string.IsNullOrEmpty(SOSManagedSourcePath)) {
+ if (string.IsNullOrEmpty(SOSNativeSourcePath) || string.IsNullOrEmpty(SOSManagedSourcePath))
+ {
throw new SOSInstallerException("SOS source path not valid");
}
- if (!Directory.Exists(SOSNativeSourcePath)) {
+ if (!Directory.Exists(SOSNativeSourcePath))
+ {
throw new SOSInstallerException($"Operating system or architecture not supported: installing from {SOSNativeSourcePath}");
}
- if (!Directory.Exists(SOSManagedSourcePath)) {
+ if (!Directory.Exists(SOSManagedSourcePath))
+ {
throw new SOSInstallerException($"Invalid SOS source directory {SOSManagedSourcePath}");
}
- if (string.IsNullOrEmpty(InstallLocation)) {
+ if (string.IsNullOrEmpty(InstallLocation))
+ {
throw new SOSInstallerException($"Installation path {InstallLocation} not valid");
}
});
// Configure lldb
- if (LLDBInitFile != null) {
+ if (LLDBInitFile != null)
+ {
Configure();
}
- else {
+ else
+ {
WriteLine($"Execute '.load {InstallLocation}\\sos.dll' to load SOS in your Windows debugger.");
}
/// <exception cref="SOSInstallerException"></exception>
public void Configure(bool remove = false)
{
- if (string.IsNullOrEmpty(LLDBInitFile)) {
+ if (string.IsNullOrEmpty(LLDBInitFile))
+ {
throw new SOSInstallerException("No lldb configuration file path");
}
bool changed = false;
}
}
- if (markerFound) {
+ if (markerFound)
+ {
throw new SOSInstallerException(".lldbinit file end marker not found");
}
}
string extension = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? ".dylib" : ".so";
lines.Add($"plugin load {plugin}{extension}");
- if (EnableSymbolServer) {
+ if (EnableSymbolServer)
+ {
lines.Add(string.Format("setsymbolserver -ms"));
}
lines.Add(InitFileEnd);
// If there is anything to write, write the lldb init file
if (changed)
{
- if (remove) {
+ if (remove)
+ {
WriteLine("Reverting {0} file - LLDB will no longer load SOS at startup", LLDBInitFile);
}
- else {
+ else
+ {
WriteLine("{0} {1} file - LLDB will load SOS automatically at startup", existing ? "Updating existing" : "Creating new", LLDBInitFile);
}
RetryOperation($"Problem writing lldb init file {LLDBInitFile}", () => File.WriteAllLines(LLDBInitFile, lines.ToArray()));
}
catch (Exception ex) when (ex is ArgumentException || ex is UnauthorizedAccessException || ex is SecurityException)
{
- if (errorMessage == null) {
+ if (errorMessage == null)
+ {
return;
}
throw new SOSInstallerException($"{errorMessage}: {ex.Message}", ex);
if (lastfailure != null)
{
- if (errorMessage == null) {
+ if (errorMessage == null)
+ {
return;
}
throw new SOSInstallerException($"{errorMessage}: {lastfailure.Message}", lastfailure);
{
}
}
-}
\ No newline at end of file
+}
}
ExtOut("%p %p %p %p 0x%" POINTERSIZE_TYPE "x(%" POINTERSIZE_TYPE"d) 0x%" POINTERSIZE_TYPE "x(%" POINTERSIZE_TYPE "d)\n",
SOS_PTR(dwAddrSeg),
- SOS_PTR(segment.mem), SOS_PTR(segment.allocated), SOS_PTR(segment.committed),
- (ULONG_PTR)(segment.allocated - segment.mem),
- (ULONG_PTR)(segment.allocated - segment.mem),
+ SOS_PTR(segment.mem), SOS_PTR(segment.highAllocMark), SOS_PTR(segment.committed),
+ (ULONG_PTR)(segment.highAllocMark - segment.mem),
+ (ULONG_PTR)(segment.highAllocMark - segment.mem),
(ULONG_PTR)(segment.committed - segment.mem),
(ULONG_PTR)(segment.committed - segment.mem));
- total_allocated_size += (DWORD_PTR)(segment.allocated - segment.mem);
+ total_allocated_size += (DWORD_PTR)(segment.highAllocMark - segment.mem);
total_committed_size += (DWORD_PTR)(segment.committed - segment.mem);
dwAddrSeg = (DWORD_PTR)segment.next;
}
ExtOut("Error requesting heap segment %p\n", SOS_PTR(taddrSeg));
return FALSE;
}
- TADDR allocated = TO_TADDR(dacpSeg.allocated);
- if (taddrSeg == TO_TADDR(heap.ephemeral_heap_segment))
- {
- allocated = TO_TADDR(heap.alloc_allocated);
- }
- if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj < allocated)
+ if (taddrObj >= TO_TADDR(dacpSeg.mem) && taddrObj < dacpSeg.highAllocMark)
{
rngSeg.segAddr = (TADDR)dacpSeg.segmentAddr;
rngSeg.start = (TADDR)dacpSeg.mem;
- rngSeg.end = (TADDR)dacpSeg.allocated;
+ rngSeg.end = (TADDR)dacpSeg.highAllocMark;
gen = gen_num;
return TRUE;
}
return FALSE;
}
#ifndef FEATURE_PAL
- GCGenUsageStats((TADDR)dacpSeg.mem, (TADDR)dacpSeg.allocated, (TADDR)dacpSeg.committed, liveObjs, heap, FALSE, FALSE, &allocInfo, &hpUsage->genUsage[n]);
+ GCGenUsageStats((TADDR)dacpSeg.mem, (TADDR)dacpSeg.highAllocMark, (TADDR)dacpSeg.committed, liveObjs, heap, FALSE, FALSE, &allocInfo, &hpUsage->genUsage[n]);
#endif
taddrSeg = (TADDR)dacpSeg.next;
}
DacpHeapSegmentData segment;
if (heap.has_regions)
{
- DWORD_PTR end_youngest = (DWORD_PTR)heap.alloc_allocated;
BOOL bPrevFree = FALSE;
for (UINT n = 0; n <= GetMaxGeneration(); n++)
{
return FALSE;
}
dwAddrCurrObj = (DWORD_PTR)segment.mem;
- DWORD_PTR end_of_segment = (DWORD_PTR)segment.allocated;
- if (dwAddrSeg == (DWORD_PTR)heap.ephemeral_heap_segment)
- {
- end_of_segment = end_youngest;
- }
+ DWORD_PTR end_of_segment = (DWORD_PTR)segment.highAllocMark;
while (true)
{
- if (dwAddrCurrObj - SIZEOF_OBJHEADER == end_youngest - Align(min_obj_size))
+ if (dwAddrCurrObj - SIZEOF_OBJHEADER == end_of_segment - Align(min_obj_size))
break;
if (dwAddrCurrObj >= (DWORD_PTR)end_of_segment)
}
if (dwAddrSeg == (DWORD_PTR)heap.ephemeral_heap_segment
- && dwAddrCurrObj >= end_youngest)
+ && dwAddrCurrObj >= end_of_segment)
{
- if (dwAddrCurrObj > end_youngest)
+ if (dwAddrCurrObj > end_of_segment)
{
// prev_object length is too long
- ExtOut("curr_object: %p > end_youngest: %p\n",
- SOS_PTR(dwAddrCurrObj), SOS_PTR(end_youngest));
+ ExtOut("curr_object: %p > end_of_segment: %p\n",
+ SOS_PTR(dwAddrCurrObj), SOS_PTR(end_of_segment));
if (dwAddrPrevObj)
{
DMLOut("Last good object: %s\n", DMLObject(dwAddrPrevObj));
}
TADDR taObj = TO_TADDR(objectPointer);
- // The DAC doesn't fill the generation table with true CLRDATA_ADDRESS values
- // but rather with ULONG64 values (i.e. non-sign-extended 64-bit values)
- // We use the TO_TADDR below to ensure we won't break if this will ever
- // be fixed in the DAC.
- if (taObj >= TO_TADDR(pDetails->generation_table[0].allocation_start) &&
- taObj <= TO_TADDR(pDetails->alloc_allocated))
- return 0;
-
- if (taObj >= TO_TADDR(pDetails->generation_table[1].allocation_start) &&
- taObj <= TO_TADDR(pDetails->generation_table[0].allocation_start))
- return 1;
+ if (pDetails->has_regions)
+ {
+ for (int gen_num = 0; gen_num <= 1; gen_num++)
+ {
+ CLRDATA_ADDRESS dwAddrSeg = pDetails->generation_table[gen_num].start_segment;
+ while (dwAddrSeg != 0)
+ {
+ DacpHeapSegmentData segment;
+ if (segment.Request(g_sos, dwAddrSeg, pDetails->original_heap_details) != S_OK)
+ {
+ ExtOut("Error requesting heap segment %p\n", SOS_PTR(dwAddrSeg));
+ return 0;
+ }
+ // The DAC doesn't fill the generation table with true CLRDATA_ADDRESS values
+ // but rather with ULONG64 values (i.e. non-sign-extended 64-bit values)
+ // We use the TO_TADDR below to ensure we won't break if this will ever
+ // be fixed in the DAC.
+ if (TO_TADDR(segment.mem) <= taObj && taObj < TO_TADDR(segment.highAllocMark))
+ {
+ return gen_num;
+ }
+ dwAddrSeg = segment.next;
+ }
+ }
+ }
+ else
+ {
+ // The DAC doesn't fill the generation table with true CLRDATA_ADDRESS values
+ // but rather with ULONG64 values (i.e. non-sign-extended 64-bit values)
+ // We use the TO_TADDR below to ensure we won't break if this will ever
+ // be fixed in the DAC.
+ if (taObj >= TO_TADDR(pDetails->generation_table[0].allocation_start) &&
+ taObj <= TO_TADDR(pDetails->alloc_allocated))
+ return 0;
+ if (taObj >= TO_TADDR(pDetails->generation_table[1].allocation_start) &&
+ taObj <= TO_TADDR(pDetails->generation_table[0].allocation_start))
+ return 1;
+ }
return 2;
}
ExtOut("Error requesting heap segment %p\n", SOS_PTR(dwAddrSeg));
return FALSE;
}
- if (addr >= TO_TADDR(seg.mem) &&
- addr < (dwAddrSeg == heap.ephemeral_heap_segment ? heap.alloc_allocated : TO_TADDR(seg.allocated)))
+ if (addr >= TO_TADDR(seg.mem) && addr < seg.highAllocMark)
{
return TRUE;
}
}
mCurrObj = mStart < TO_TADDR(mSegment.mem) ? TO_TADDR(mSegment.mem) : mStart;
- mSegmentEnd = (segStart == TO_TADDR(mHeaps[0].ephemeral_heap_segment)) ?
- TO_TADDR(mHeaps[0].alloc_allocated) :
- TO_TADDR(mSegment.allocated);
+ mSegmentEnd = TO_TADDR(mSegment.highAllocMark);
CheckSegmentRange();
}
mLastObj = 0;
mCurrObj = mStart < TO_TADDR(mSegment.mem) ? TO_TADDR(mSegment.mem) : mStart;
- mSegmentEnd = (next == TO_TADDR(mHeaps[mCurrHeap].ephemeral_heap_segment)) ?
- TO_TADDR(mHeaps[mCurrHeap].alloc_allocated) :
- TO_TADDR(mSegment.allocated);
+ mSegmentEnd = TO_TADDR(mSegment.highAllocMark);
return CheckSegmentRange();
}
_serviceProvider.AddService<IContextService>(_contextService);
_serviceProvider.AddServiceFactory<SOSLibrary>(() => SOSLibrary.Create(this));
- _contextService.ServiceProvider.AddServiceFactory<ClrMDHelper>(() => {
+ _contextService.ServiceProvider.AddServiceFactory<ClrMDHelper>(() =>
+ {
ClrRuntime clrRuntime = _contextService.Services.GetService<ClrRuntime>();
return clrRuntime != null ? new ClrMDHelper(clrRuntime) : null;
});
_consoleProvider.WriteLine($"Loading core dump: {dump_path} ...");
// Attempt to load the persisted command history
- string dotnetHome;
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
- dotnetHome = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), ".dotnet");
- }
- else {
- dotnetHome = Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".dotnet");
- }
+ string dotnetHome = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".dotnet");
string historyFileName = Path.Combine(dotnetHome, "dotnet-dump.history");
try
{
string[] history = File.ReadAllLines(historyFileName);
_consoleProvider.AddCommandHistory(history);
}
- catch (Exception ex) when
- (ex is IOException ||
- ex is UnauthorizedAccessException ||
- ex is NotSupportedException ||
+ catch (Exception ex) when
+ (ex is IOException ||
+ ex is UnauthorizedAccessException ||
+ ex is NotSupportedException ||
ex is SecurityException)
{
}
LoadExtensions();
try
- {
+ {
using DataTarget dataTarget = DataTarget.LoadDump(dump_path.FullName);
OSPlatform targetPlatform = dataTarget.DataReader.TargetPlatform;
- if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || dataTarget.DataReader.EnumerateModules().Any((module) => Path.GetExtension(module.FileName) == ".dylib")) {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || dataTarget.DataReader.EnumerateModules().Any((module) => Path.GetExtension(module.FileName) == ".dylib"))
+ {
targetPlatform = OSPlatform.OSX;
}
_target = new TargetFromDataReader(dataTarget.DataReader, targetPlatform, this, _targetIdFactory++, dump_path.FullName);
foreach (string cmd in command)
{
_commandService.Execute(cmd, _contextService.Services);
- if (_consoleProvider.Shutdown) {
+ if (_consoleProvider.Shutdown)
+ {
break;
}
}
_consoleProvider.WriteLine("Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command.");
_consoleProvider.WriteLine("Type 'quit' or 'exit' to exit the session.");
- _consoleProvider.Start((string commandLine, CancellationToken cancellation) => {
+ _consoleProvider.Start((string commandLine, CancellationToken cancellation) =>
+ {
_commandService.Execute(commandLine, _contextService.Services);
});
}
{
File.WriteAllLines(historyFileName, _consoleProvider.GetCommandHistory());
}
- catch (Exception ex) when
- (ex is IOException ||
- ex is UnauthorizedAccessException ||
- ex is NotSupportedException ||
+ catch (Exception ex) when
+ (ex is IOException ||
+ ex is UnauthorizedAccessException ||
+ ex is NotSupportedException ||
ex is SecurityException)
{
}
public void DestroyTarget(ITarget target)
{
- if (target == null) {
+ if (target == null)
+ {
throw new ArgumentNullException(nameof(target));
}
if (target == _target)
{
_target = null;
_contextService.ClearCurrentTarget();
- if (target is IDisposable disposable) {
+ if (target is IDisposable disposable)
+ {
disposable.Dispose();
}
}
{
assembly = Assembly.LoadFrom(extensionPath);
}
- catch (Exception ex) when (ex is IOException || ex is ArgumentException || ex is BadImageFormatException || ex is System.Security.SecurityException)
+ catch (Exception ex) when (ex is IOException || ex is ArgumentException || ex is BadImageFormatException || ex is System.Security.SecurityException)
{
_consoleProvider.WriteLineError($"Extension load {extensionPath} FAILED {ex.Message}");
}
using Microsoft.Win32.SafeHandles;
using System;
-using System.Diagnostics;
+using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
using SafeProcessHandle processHandle = NativeMethods.OpenProcess(NativeMethods.PROCESS_QUERY_INFORMATION | NativeMethods.PROCESS_VM_READ, false, processId);
if (processHandle.IsInvalid)
{
- throw new ArgumentException($"Invalid process id {processId} error: {Marshal.GetLastWin32Error()}");
+ int error = Marshal.GetLastWin32Error();
+ string errorText = new Win32Exception(error).Message;
+ throw new ArgumentException($"Invalid process id {processId} - {errorText} ({error})");
}
// Open the file for writing
else
{
int err = Marshal.GetHRForLastWin32Error();
- if (err != NativeMethods.ERROR_PARTIAL_COPY)
+ if (err != NativeMethods.HR_ERROR_PARTIAL_COPY)
{
Marshal.ThrowExceptionForHR(err);
}
private static class NativeMethods
{
- public const int ERROR_PARTIAL_COPY = unchecked((int)0x8007012b);
+ public const int HR_ERROR_PARTIAL_COPY = unchecked((int)0x8007012b);
public const int PROCESS_VM_READ = 0x0010;
public const int PROCESS_QUERY_INFORMATION = 0x0400;
hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, resourceName, 0, &debugResourceRVA, &debugResourceSize);
useCrossPlatformNaming = SUCCEEDED(hrGetResource);
- #if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM))
+ #if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM) || defined(HOST_ARM64))
#if defined(HOST_X86)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_I386
#elif defined(HOST_AMD64)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_AMD64
#elif defined(HOST_ARM)
#define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARMNT
+ #elif defined(HOST_ARM64)
+ #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARM64
#endif
// if this is windows, and if host_arch matches target arch then we can fallback to searching for CLRDEBUGINFO on failure
#undef _HOST_MACHINE_TYPE
#endif
// if the search failed, we don't recognize the CLR
- if(FAILED(hrGetResource))
+ if (FAILED(hrGetResource))
{
hr = CORDBG_E_NOT_CLR;
}
<!-- IncludeBuildOutput needs to be set to true to make NuGet include the passed in debug symbol files. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>true</IncludeSymbols>
- <DebugSymbols>false</DebugSymbols>
- <DebugType>none</DebugType>
<IsPackable>true</IsPackable>
- <AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb;.dbg;.dwarf</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
+ <AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>$(SymbolsSuffix)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<!-- When KeepNativeSymbols is set, debug symbols are kept in the .so files. Separate symbol files do not exist that need to be packed. -->
- <!-- <TargetsForTfmSpecificDebugSymbolsInPackage Condition="'$(KeepNativeSymbols)' != 'true'">$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificNativeSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage> -->
+ <TargetsForTfmSpecificDebugSymbolsInPackage Condition="'$(KeepNativeSymbols)' != 'true'">$(TargetsForTfmSpecificDebugSymbolsInPackage);AddRuntimeSpecificNativeSymbolToPackage</TargetsForTfmSpecificDebugSymbolsInPackage>
<UseRuntimePackageDisclaimer>true</UseRuntimePackageDisclaimer>
<!-- This is a native package and doesn't contain any ref/lib assets. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<Target Name="AddRuntimeSpecificNativeSymbolToPackage">
<ItemGroup>
- <TfmSpecificDebugSymbolsFile Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)"
+ <TfmSpecificDebugSymbolsFile Condition="$(OutputRid.StartsWith('win'))"
+ Include="$(NativeBinDir)PDB\$(LibPrefix)dbgshim$(SymbolsSuffix)"
+ TargetPath="/runtimes/$(OutputRid)/native"
+ TargetFramework="$(TargetFramework)" />
+
+ <TfmSpecificDebugSymbolsFile Condition="!$(OutputRid.StartsWith('win'))"
+ Include="$(NativeBinDir)$(LibPrefix)dbgshim$(LibSuffix)$(SymbolsSuffix)"
TargetPath="/runtimes/$(OutputRid)/native"
TargetFramework="$(TargetFramework)" />
</ItemGroup>
HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr, const DacpGcHeapDetails& heap)
{
+ // clear this here to make sure we don't get stale values
+ this->highAllocMark = 0;
+
HRESULT hr = sos->GetHeapSegmentData(addr, this);
- // if this is the start segment, set highAllocMark too.
- if (SUCCEEDED(hr))
+ // if this is the start segment, and the Dac hasn't set highAllocMark, set it here.
+ if (SUCCEEDED(hr) && this->highAllocMark == 0)
{
- // TODO: This needs to be put on the Dac side.
- if (this->segmentAddr == heap.generation_table[0].start_segment)
+ if (this->segmentAddr == heap.ephemeral_heap_segment)
highAllocMark = heap.alloc_allocated;
else
highAllocMark = allocated;
// The .NET Foundation licenses this file to you under the MIT license.
//
+// This file is a verbatim copy of the Windows OS header with PE file structure definitions.
+
+
//
// ===========================================================================
// File: ntimage.h
#define IMAGE_FILE_MACHINE_SH4 0x01a6 // SH4 little-endian
#define IMAGE_FILE_MACHINE_SH5 0x01a8 // SH5
#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian
-#define IMAGE_FILE_MACHINE_THUMB 0x01c2
+#define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian
#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian
#define IMAGE_FILE_MACHINE_AM33 0x01d3
#define IMAGE_FILE_MACHINE_POWERPC 0x01F0 // IBM PowerPC Little-Endian
#define IMAGE_FILE_MACHINE_EBC 0x0EBC // EFI Byte Code
#define IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8)
#define IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian
+#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian
#define IMAGE_FILE_MACHINE_CEE 0xC0EE
+#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 // LOONGARCH64.
//
// Directory format.
#define IMAGE_REL_IA64_GPREL32 0x001C
#define IMAGE_REL_IA64_ADDEND 0x001F
+//
+// LOONGARCH64 relocation types
+//
+#define IMAGE_REL_LOONGARCH64_PC 0x0003
+#define IMAGE_REL_LOONGARCH64_JIR 0x0004
+
//
// CEF relocation types.
//