From 10339ed7aaaad635913700e0883da9f7312abd16 Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 9 Dec 2019 21:46:15 -0800 Subject: [PATCH] Prepare SOS for single file support and add desktop CLR support (#658) Prepare SOS for single file support and add desktop CLR support Add defines and functions for the runtime, dac and dbi modules/dlls names. Also supports desktop CLR Add minidump retry for ERROR_PARTIAL_COPY --- src/SOS/SOS.Hosting/SOSHost.cs | 5 + .../Unix/Debugger.Tests.Config.txt | 1 + .../Windows/Debugger.Tests.Config.txt | 6 +- .../Debuggees/DivZero/DivZero.csproj | 2 +- .../Debuggees/GCWhere/GCWhere.csproj | 2 +- .../NestedExceptionTest.csproj | 2 +- .../Debuggees/Overflow/Overflow.csproj | 2 +- .../ReflectionTest/ReflectionTest.csproj | 2 +- .../Debuggees/SimpleThrow/SimpleThrow.csproj | 2 +- .../SymbolTestApp/SymbolTestApp.csproj | 2 +- .../SymbolTestDll/SymbolTestDll.csproj | 2 +- .../RandomUserLibrary.csproj | 2 +- .../TaskNestedException.csproj | 2 +- src/SOS/SOS.UnitTests/SOS.cs | 4 +- src/SOS/SOS.UnitTests/SOSRunner.cs | 41 ++++-- src/SOS/SOS.UnitTests/Scripts/DivZero.script | 2 +- src/SOS/SOS.UnitTests/Scripts/GCTests.script | 18 +-- .../Scripts/NestedExceptionTest.script | 19 ++- .../Scripts/OtherCommands.script | 30 +++- .../SOS.UnitTests/Scripts/Reflection.script | 8 +- .../SOS.UnitTests/Scripts/SimpleThrow.script | 5 - .../Scripts/StackAndOtherTests.script | 61 ++++---- .../SOS.UnitTests/Scripts/StackTests.script | 18 +-- .../Scripts/TaskNestedException.script | 4 +- src/SOS/Strike/EventCallbacks.cpp | 36 +++-- src/SOS/Strike/exts.h | 18 +-- src/SOS/Strike/hostcoreclr.cpp | 100 +++++++------ src/SOS/Strike/hostcoreclr.h | 4 +- src/SOS/Strike/sos.def | 2 +- src/SOS/Strike/strike.cpp | 73 ++++++--- src/SOS/Strike/strike.h | 3 - src/SOS/Strike/util.cpp | 138 ++++++++++++++---- src/SOS/Strike/util.h | 94 +++++++++++- .../TestDebuggee/TestDebuggee.csproj | 2 +- src/Tools/dotnet-dump/Dumper.Windows.cs | 25 +++- src/inc/cor.h | 12 +- 36 files changed, 487 insertions(+), 262 deletions(-) diff --git a/src/SOS/SOS.Hosting/SOSHost.cs b/src/SOS/SOS.Hosting/SOSHost.cs index 7035afafb..b6792a4ea 100644 --- a/src/SOS/SOS.Hosting/SOSHost.cs +++ b/src/SOS/SOS.Hosting/SOSHost.cs @@ -157,6 +157,8 @@ namespace SOS internal readonly IDataReader DataReader; + const string DesktopRuntimeModuleName = "clr"; + private static readonly string s_coreclrModuleName; private readonly AnalyzeContext _analyzeContext; @@ -1109,6 +1111,9 @@ namespace SOS internal static bool IsRuntimeModule(ModuleInfo module) { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && IsModuleEqual(module, DesktopRuntimeModuleName)) { + return true; + } return IsModuleEqual(module, s_coreclrModuleName); } diff --git a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt index 843a14276..d6d38e429 100644 --- a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt +++ b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt @@ -117,6 +117,7 @@