Use PEImage API get export symbols for single file apps (#2674)
authorMike McLaughlin <mikem@microsoft.com>
Mon, 18 Oct 2021 23:47:40 +0000 (16:47 -0700)
committerGitHub <noreply@github.com>
Mon, 18 Oct 2021 23:47:40 +0000 (16:47 -0700)
* Use PEImage API get export symbols for single file apps

Add single file app testing support.

Disable bpmd testing for single-file on Linux/MacOS

Issues: https://github.com/dotnet/diagnostics/issues/2515 and https://github.com/dotnet/diagnostics/issues/2438

* Support Windows/MacOS single-file in the C++ runtime enum fallback

IDebuggerServices::GetOffsetBySymbol is used to get the runtime info export and so most
of the changes are making the interface available on the libsos "side" under Linux/MacOS
since there is a Extensions instance both in libsosplugin and libsos. The libsos side
Extensions::GetDebuggerServices always returned null before this change. Now it only
returns null if hosted under a managed host like dotnet-dump.

* Disable test single-file live apps on Alpine

* Enable single-file tests when no host runtime (C++ fallback)

* Fix initialize bpmd problems on Main

* Fix clrstack -i/ICorDebug C++ fallback code for single-file

Simplify to what the managed Runtime code does without the debugshim
and library provider. SOS no longer needs debugshim, but left it for
the future dbgshim out-of-band work.

43 files changed:
src/Microsoft.Diagnostics.DebugServices.Implementation/Module.cs
src/Microsoft.Diagnostics.DebugServices.Implementation/ModuleServiceFromDataReader.cs
src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs
src/Microsoft.Diagnostics.DebugServices.Implementation/SymbolService.cs
src/Microsoft.Diagnostics.TestHelpers/BaseDebuggeeCompiler.cs
src/Microsoft.Diagnostics.TestHelpers/CliDebuggeeCompiler.cs
src/Microsoft.Diagnostics.TestHelpers/CsprojBuildDebuggeeTestStep.cs
src/SOS/CMakeLists.txt
src/SOS/SOS.Extensions/ModuleServiceFromDebuggerServices.cs
src/SOS/SOS.Hosting/SOSLibrary.cs
src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt
src/SOS/SOS.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt
src/SOS/SOS.UnitTests/Debuggees/SymbolTestApp/SymbolTestApp/SymbolTestApp.cs
src/SOS/SOS.UnitTests/Debuggees/WebApp3/Program.cs
src/SOS/SOS.UnitTests/SOS.cs
src/SOS/SOS.UnitTests/SOSRunner.cs
src/SOS/SOS.UnitTests/Scripts/DivZero.script
src/SOS/SOS.UnitTests/Scripts/DualRuntimes.script
src/SOS/SOS.UnitTests/Scripts/GCTests.script
src/SOS/SOS.UnitTests/Scripts/LineNums.script
src/SOS/SOS.UnitTests/Scripts/NestedExceptionTest.script
src/SOS/SOS.UnitTests/Scripts/OtherCommands.script
src/SOS/SOS.UnitTests/Scripts/Reflection.script
src/SOS/SOS.UnitTests/Scripts/SimpleThrow.script
src/SOS/SOS.UnitTests/Scripts/StackAndOtherTests.script
src/SOS/SOS.UnitTests/Scripts/StackTests.script
src/SOS/SOS.UnitTests/Scripts/TaskNestedException.script
src/SOS/SOS.UnitTests/Scripts/WebApp.script
src/SOS/Strike/CMakeLists.txt
src/SOS/Strike/Strike.vcxproj
src/SOS/Strike/Strike.vcxproj.filters
src/SOS/Strike/exts.h
src/SOS/Strike/platform/cordebugdatatarget.h
src/SOS/Strike/platform/cordebuglibraryprovider.h [deleted file]
src/SOS/Strike/platform/runtimeimpl.cpp
src/SOS/Strike/platform/targetimpl.cpp
src/SOS/Strike/symbols.cpp
src/SOS/Strike/util.cpp
src/SOS/extensions/extensions.h
src/SOS/extensions/extensions.vcxproj
src/SOS/lldbplugin/soscommand.cpp
src/SOS/lldbplugin/sosplugin.h
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/SymbolServiceTests.cs

index 2da9ac5eb83aea56cec03fe01854ed212af19ab6..f75f3e1ddcacc0b98763f3aafc284e4686d91669 100644 (file)
@@ -4,11 +4,14 @@
 
 using Microsoft.Diagnostics.Runtime;
 using Microsoft.Diagnostics.Runtime.Utilities;
+using Microsoft.FileFormats;
 using Microsoft.FileFormats.ELF;
 using Microsoft.FileFormats.MachO;
+using Microsoft.FileFormats.PE;
 using System;
 using System.Collections.Immutable;
 using System.Diagnostics;
+using System.IO;
 using System.Reflection.PortableExecutable;
 using System.Runtime.InteropServices;
 using FileVersionInfo = Microsoft.Diagnostics.Runtime.Utilities.FileVersionInfo;
@@ -18,7 +21,7 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
     /// <summary>
     /// Module base implementation
     /// </summary>
-    public abstract class Module : IModule, IDisposable
+    public abstract class Module : IModule, IExportSymbols, IDisposable
     {
         [Flags]
         public enum Flags : byte
@@ -58,6 +61,7 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
                 ServiceProvider.RemoveService(typeof(ELFFile));
                 ServiceProvider.RemoveService(typeof(PEReader));
             });
+            ServiceProvider.AddService<IExportSymbols>(this);
          }
 
         public void Dispose()
@@ -163,6 +167,57 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
 
         #endregion
 
+        #region IExportSymbols
+
+        bool IExportSymbols.TryGetSymbolAddress(string name, out ulong address)
+        {
+            if (Target.OperatingSystem == OSPlatform.Windows)
+            {
+                Stream stream = Target.Services.GetService<IMemoryService>().CreateMemoryStream(ImageBase, ImageSize);
+                PEFile image = new(new StreamAddressSpace(stream), isDataSourceVirtualAddressSpace: true);
+                if (image.IsValid())
+                { 
+                    if (image.TryGetExportSymbol(name, out ulong offset))
+                    {
+                        address = ImageBase + offset;
+                        return true;
+                    }
+                    address = 0;
+                    return false;
+                }
+            }
+            else if (Target.OperatingSystem == OSPlatform.Linux)
+            {
+                try
+                {
+                    Stream stream = Target.Services.GetService<IMemoryService>().CreateMemoryStream(ImageBase, ImageSize);
+                    ElfFile elfFile = new(stream, position: ImageBase, leaveOpen: false, isVirtual: true);
+                    if (elfFile.Header.IsValid)
+                    {
+                        if (elfFile.TryGetExportSymbol(name, out ulong offset))
+                        {
+                            address = ImageBase + offset;
+                            return true;
+                        }
+                        address = 0;
+                        return false;
+                    }
+                }
+                catch (InvalidDataException)
+                {
+                }
+            }
+            return TryGetSymbolAddressInner(name, out address);
+        }
+
+        protected virtual bool TryGetSymbolAddressInner(string name, out ulong address)
+        {
+            address = 0;
+            return false;
+        }
+
+        #endregion
+
         protected VersionData GetVersion()
         {
             VersionData versionData = null;
index c2c6253b9aac14b21c8b72b0a22f11d580bbefb0..939ad8f6694840fe1fd98ee7cc2bd61ede66d37a 100644 (file)
@@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
     /// </summary>
     public class ModuleServiceFromDataReader : ModuleService
     {
-        class ModuleFromDataReader : Module, IExportSymbols
+        class ModuleFromDataReader : Module
         {
             // This is what clrmd returns for non-PE modules that don't have a timestamp
             private const uint InvalidTimeStamp = 0;
@@ -38,10 +38,6 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
                 _imageSize = imageSize;
                 _exportReader = exportReader;
                 ModuleIndex = moduleIndex;
-                if (exportReader is not null)
-                {
-                    ServiceProvider.AddService<IExportSymbols>(this);
-                }
             }
 
             #region IModule
@@ -97,28 +93,16 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
 
             #endregion
 
-            #region IExportSymbols
-
-            public bool TryGetSymbolAddress(string name, out ulong address)
+            protected override bool TryGetSymbolAddressInner(string name, out ulong address)
             {
                 if (_exportReader is not null)
                 {
-                    // Some exceptions are escaping from the clrmd ELF dump reader. This will be
-                    // fixed in a clrmd update.
-                    try
-                    {
-                        return _exportReader.TryGetSymbolAddress(ImageBase, name, out address);
-                    }
-                    catch (IOException)
-                    {
-                    }
+                    return _exportReader.TryGetSymbolAddress(ImageBase, name, out address);
                 }
                 address = 0;
                 return false;
             }
 
-            #endregion
-
             protected override ModuleService ModuleService => _moduleService;
         }
 
index b5283be687b2a68ac561eec0178a4a02d5e4ba01..a29d69484514cafb3574730bd26500672943320a 100644 (file)
@@ -21,7 +21,6 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
     public class RuntimeService : IRuntimeService, IDataReader, IExportReader
     {
         private readonly ITarget _target;
-        private readonly bool _exportReaderEnabled;
         private readonly IDisposable _onFlushEvent;
         private DataTarget _dataTarget;
         private List<Runtime> _runtimes;
@@ -33,8 +32,6 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
         public RuntimeService(ITarget target)
         {
             _target = target;
-            // TODO - mikem 4/30/21 - remove when dbgeng services doesn't take so long looking up exports (attempts to load PDBs).
-            _exportReaderEnabled = target.Host.HostType != HostType.DbgEng || Environment.GetEnvironmentVariable("DOTNET_ENABLE_SOS_SINGLEFILE") == "1";
             _onFlushEvent = target.OnFlushEvent.Register(() => {
                 if (_runtimes is not null && _runtimes.Count == 0)
                 {
@@ -219,20 +216,17 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
 
         bool IExportReader.TryGetSymbolAddress(ulong baseAddress, string name, out ulong offset)
         {
-            if (_exportReaderEnabled)
+            try
             {
-                try
-                {
-                    IExportSymbols exportSymbols = ModuleService.GetModuleFromBaseAddress(baseAddress).Services.GetService<IExportSymbols>();
-                    if (exportSymbols is not null)
-                    {
-                        return exportSymbols.TryGetSymbolAddress(name, out offset);
-                    }
-                }
-                catch (DiagnosticsException)
+                IExportSymbols exportSymbols = ModuleService.GetModuleFromBaseAddress(baseAddress).Services.GetService<IExportSymbols>();
+                if (exportSymbols is not null)
                 {
+                    return exportSymbols.TryGetSymbolAddress(name, out offset);
                 }
             }
+            catch (DiagnosticsException)
+            {
+            }
             offset = 0;
             return false;
         }
index f014c23fc2b3f6ea14a08f4da73a2be3e54f42af..35fe3fed19b88838ddaec1f07edf186a466ae858 100644 (file)
@@ -28,8 +28,8 @@ namespace Microsoft.Diagnostics.DebugServices.Implementation
         /// <summary>
         /// Symbol server URLs
         /// </summary>
-        public const string MsdlSymbolServer = "http://msdl.microsoft.com/download/symbols/";
-        public const string SymwebSymbolServer = "http://symweb.corp.microsoft.com/";
+        public const string MsdlSymbolServer = "https://msdl.microsoft.com/download/symbols/";
+        public const string SymwebSymbolServer = "https://symweb.corp.microsoft.com/";
 
         private readonly IHost _host;
         private string _defaultSymbolCache;
index 8545164c69c06f47ba1867c542c68f0d03100c83..2c02a67dd601d7506ab296dfcb83aa72c34d2d59 100644 (file)
@@ -165,12 +165,12 @@ namespace Microsoft.Diagnostics.TestHelpers
 
         protected static string GetDebuggeeBinaryDllPath(TestConfiguration config, string debuggeeBinaryDirPath, string debuggeeName)
         {
-            return config.IsNETCore ? Path.Combine(debuggeeBinaryDirPath, debuggeeName + (config.PublishSingleFile ? "" : ".dll")) : null;
+            return config.IsNETCore ? Path.Combine(debuggeeBinaryDirPath, debuggeeName + ".dll") : null;
         }
 
         protected static string GetDebuggeeBinaryExePath(TestConfiguration config, string debuggeeBinaryDirPath, string debuggeeName)
         {
-            return config.IsDesktop ? Path.Combine(debuggeeBinaryDirPath, debuggeeName + ".exe") : null;
+            return config.IsDesktop || config.PublishSingleFile ? Path.Combine(debuggeeBinaryDirPath, debuggeeName + (OS.Kind == OSKind.Windows ? ".exe" : "")) : null;
         }
 
         protected static string GetLogPath(TestConfiguration config, string framework, string runtime, string debuggeeName)
index 2b3feff338643eec78326e529ea7f9ac5928289d..6a7716ee14793843cf1caf17f5078cdd3578217e 100644 (file)
@@ -38,6 +38,7 @@ namespace Microsoft.Diagnostics.TestHelpers
             {
                 Debug.Assert(runtimeIdentifier != null);
                 buildProperties.Add("PublishSingleFile", "true");
+                buildProperties.Add("SelfContained", "true");
             }
             string debugType = config.DebugType;
             if (debugType == null)
@@ -78,6 +79,7 @@ namespace Microsoft.Diagnostics.TestHelpers
                                                GetDebuggeeNativeLibDirPath(config, debuggeeName),
                                                GetBuildProperties(config, runtimeIdentifier),
                                                runtimeIdentifier,
+                                               config.BuildProjectFramework,
                                                config.LinkerPackageVersion,
                                                debuggeeName,
                                                debuggeeSolutionDirPath,
index 7010938ad597b82276fb59766691dae8f2fadccf..a0d566dc65444207558a61d640f54908822fe045 100644 (file)
@@ -30,6 +30,7 @@ namespace Microsoft.Diagnostics.TestHelpers
                                        string debuggeeNativeLibDirPath,
                                        Dictionary<string,string> buildProperties,
                                        string runtimeIdentifier,
+                                       string runtimeFramework,
                                        string linkerPackageVersion,
                                                           string debuggeeName,
                                        string debuggeeSolutionDirPath,
@@ -54,6 +55,7 @@ namespace Microsoft.Diagnostics.TestHelpers
         {
             BuildProperties = buildProperties;
             RuntimeIdentifier = runtimeIdentifier;
+            RuntimeFramework = runtimeFramework;
             DebuggeeName = debuggeeName;
             ProjectTemplateFileName = debuggeeName + ".csproj";
             LinkerPackageVersion = linkerPackageVersion;
@@ -64,6 +66,7 @@ namespace Microsoft.Diagnostics.TestHelpers
         /// </summary>
         public IDictionary<string,string> BuildProperties { get; }
         public string RuntimeIdentifier { get; }
+        public string RuntimeFramework { get; }
         public string DebuggeeName { get; }
         public string LinkerPackageVersion { get; }
         public override string ProjectTemplateFileName { get; }
@@ -73,7 +76,7 @@ namespace Microsoft.Diagnostics.TestHelpers
             string extraArgs = "";
             if (RuntimeIdentifier != null)
             {
-                extraArgs = " --runtime " + RuntimeIdentifier;
+                extraArgs += " --runtime " + RuntimeIdentifier;
             }
             foreach (var prop in BuildProperties)
             {
@@ -85,9 +88,14 @@ namespace Microsoft.Diagnostics.TestHelpers
         protected override async Task Build(ITestOutputHelper output)
         {
             string publishArgs = "publish";
+            if (RuntimeFramework != null)
+            {
+                publishArgs += " --framework " + RuntimeFramework;
+            }
             if (RuntimeIdentifier != null)
             {
                 publishArgs += " --runtime " + RuntimeIdentifier;
+                publishArgs += " --self-contained true";
             }
             foreach (var prop in BuildProperties)
             {
index 88ab50eed40bce8ecad185af1271be196cf7fea1..51a3ac808da002e5c1fe8c3902052802bfdfbc84 100644 (file)
@@ -38,5 +38,3 @@ if(CLR_CMAKE_PLATFORM_UNIX)
   # This prevents inclusion of standard C compiler headers
   add_compile_options(-nostdinc)
 endif(CLR_CMAKE_PLATFORM_UNIX)
-
-add_subdirectory(debugshim)
index 3ff4cb5c1625ab69ac7b1d5a5298d2f523946fb6..29b04ed03f1963ab0266174e97d0b14033144cfc 100644 (file)
@@ -17,7 +17,7 @@ namespace SOS.Extensions
     /// </summary>
     internal class ModuleServiceFromDebuggerServices : ModuleService
     {
-        class ModuleFromDebuggerServices : Module, IExportSymbols, IModuleSymbols
+        class ModuleFromDebuggerServices : Module, IModuleSymbols
         {
             // This is what dbgeng/IDebuggerServices returns for non-PE modules that don't have a timestamp
             private const uint InvalidTimeStamp = 0xFFFFFFFE;
@@ -44,7 +44,6 @@ namespace SOS.Extensions
                 IndexFileSize = indexTimeStamp == InvalidTimeStamp ? null : indexFileSize;
                 IndexTimeStamp = indexTimeStamp == InvalidTimeStamp ? null : indexTimeStamp;
 
-                ServiceProvider.AddService<IExportSymbols>(this);
                 ServiceProvider.AddService<IModuleSymbols>(this);
             }
 
@@ -110,20 +109,25 @@ namespace SOS.Extensions
 
             #endregion
 
-            #region IExportSymbols/IModuleSymbols
+            #region IModuleSymbols
 
-            public bool TryGetSymbolName(ulong address, out string symbol, out ulong displacement)
+            bool IModuleSymbols.TryGetSymbolName(ulong address, out string symbol, out ulong displacement)
             {
                 return _moduleService._debuggerServices.GetSymbolByOffset(ModuleIndex, address, out symbol, out displacement) == HResult.S_OK;
             }
 
-            public bool TryGetSymbolAddress(string name, out ulong address)
+            bool IModuleSymbols.TryGetSymbolAddress(string name, out ulong address)
             {
                 return _moduleService._debuggerServices.GetOffsetBySymbol(ModuleIndex, name, out address) == HResult.S_OK;
             }
 
             #endregion
 
+            protected override bool TryGetSymbolAddressInner(string name, out ulong address)
+            {
+                return _moduleService._debuggerServices.GetOffsetBySymbol(ModuleIndex, name, out address) == HResult.S_OK;
+            }
+
             protected override ModuleService ModuleService => _moduleService;
         }
 
index 6f9087f0b40a0a6d0a47cd8076eef484bc760898..47205a5202ccaa2ec9e945e3c7c801b0dea3235d 100644 (file)
@@ -24,7 +24,8 @@ namespace SOS.Hosting
 
         [UnmanagedFunctionPointer(CallingConvention.Winapi)]
         private delegate int SOSInitializeDelegate(
-            IntPtr IHost);
+            IntPtr IHost,
+            IntPtr IDebuggerServices);
 
         [UnmanagedFunctionPointer(CallingConvention.Winapi)]
         private delegate void SOSUninitializeDelegate();
@@ -120,7 +121,7 @@ namespace SOS.Hosting
                 {
                     throw new EntryPointNotFoundException($"Can not find SOS module initialization function: {SOSInitialize}");
                 }
-                int result = initializeFunc(_hostWrapper.IHost);
+                int result = initializeFunc(_hostWrapper.IHost, IntPtr.Zero);
                 if (result != 0)
                 {
                     throw new InvalidOperationException($"SOS initialization FAILED 0x{result:X8}");
index 716dbbee7cea1360ab6c8b3205c65a60fd7cf452..ca58c841ab282cd6c5328ce94e0d8082422e1cbe 100644 (file)
@@ -21,6 +21,9 @@
   <LogDir>$(RootBinDir)/TestResults/$(TargetConfiguration)/sos.unittests_$(Timestamp)</LogDir>
   <DumpDir>$(RootBinDir)/tmp/$(TargetConfiguration)\dumps</DumpDir>
 
+  <OSRid>linux</OSRid>
+  <OSRid Condition="$(OS) == OSX">osx</OSRid>
+
   <TestWebApp3>true</TestWebApp3>
   <TestWebApp3 Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp3>
 
   </NuGetPackageFeeds>
 
   <Options>
+    <!--
+        Single file (debuggees cli built)
+     -->
+    <Option Condition="'$(RuntimeVersionLatest)' != ''">
+      <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+      <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+      <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+      <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+      <PublishSingleFile>true</PublishSingleFile>
+      <!-- Add the symbol server so SOS can find DAC/DBI for single file apps which
+           may not have been built with the runtime pointed by RuntimeSymbolsPath
+           since we use the arcade provided SDK (in .dotnet) to build them. -->
+      <SetSymbolServer>-ms</SetSymbolServer>
+      <BuildProjectRuntime>$(OSRid)-$(TargetArchitecture)</BuildProjectRuntime>
+    </Option>
     <!--
         Default (prebuilt)
       -->
       <TestName>SOS.StackAndOtherTests</TestName>
       <Options>
         <Option Condition="'$(RuntimeVersionLatest)' != ''">
-          <Options>
-            <Option>
-              <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
-              <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
-            </Option>
-          </Options>
+          <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+          <PublishSingleFile>true</PublishSingleFile>
+          <SetSymbolServer>-ms</SetSymbolServer>
+          <BuildProjectRuntime>$(OSRid)-$(TargetArchitecture)</BuildProjectRuntime>
+        </Option>
+        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+          <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
         </Option>
         <Option Condition="'$(RuntimeVersion50)' != ''">
           <BuildProjectFramework>net5.0</BuildProjectFramework>
         </Option>
       </Options>
     </Option>
-    <!--
-        DotnetDumpCommands (runs on every runtime except netcore2.1 on Linux)
-      -->
-    <Option>
-      <Options>
-        <Option>
-          <TestName>DotnetDumpCommands</TestName>
-        </Option>
-      </Options>
-      <Options>
-        <Option Condition="'$(RuntimeVersionLatest)' != ''">
-          <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
-          <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
-          <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
-        </Option>
-        <Option Condition="'$(RuntimeVersion50)' != ''">
-          <BuildProjectFramework>net5.0</BuildProjectFramework>
-          <RuntimeFrameworkVersion>$(RuntimeVersion50)</RuntimeFrameworkVersion>
-        </Option>
-        <Option Condition="'$(RuntimeVersion31)' != ''">
-          <BuildProjectFramework>netcoreapp3.1</BuildProjectFramework>
-          <RuntimeFrameworkVersion>$(RuntimeVersion31)</RuntimeFrameworkVersion>
-          <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
-        </Option>
-      </Options>
-    </Option>
   </Options>
 
   <FrameworkVersion Condition="'$(FrameworkVersion)' == ''">$(RuntimeFrameworkVersion)</FrameworkVersion>
index c5b1be3cde540b01f1f638310f01f1fd5e6bc6c7..3a77218d0c120d2b36f57ba698c6d7feb5a3c0c7 100644 (file)
   <DumpDir>$(RootBinDir)\tmp\$(TargetConfiguration)\dumps</DumpDir>
   <CDBHelperExtension>$(InstallDir)\runcommand.dll</CDBHelperExtension>
 
-  <TestWebApp>true</TestWebApp>
-  <TestWebApp Condition="'$(PrivateBuildTesting)' == 'true'">false</TestWebApp>
-  <TestWebApp Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp>
-
   <TestWebApp3>true</TestWebApp3>
   <TestWebApp3 Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp3>
 
     <Option>
       <TestProduct>ProjectK</TestProduct>
       <Options>
+        <!--
+            Single file (debuggees cli built)
+         -->
+        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+          <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+          <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+          <PublishSingleFile>true</PublishSingleFile>
+          <!-- Add the symbol server so SOS can find DAC/DBI for single file apps which
+               may not have been built with the runtime pointed by RuntimeSymbolsPath
+               since we use the arcade provided SDK (in .dotnet) to build them. -->
+          <SetSymbolServer>-ms</SetSymbolServer>
+          <BuildProjectRuntime>win-$(TargetArchitecture)</BuildProjectRuntime>
+        </Option>
         <!--
             Default (prebuilt)
           -->
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees</DebuggeeBuildRoot>
           <TestName>SOS.StackAndOtherTests</TestName>
           <Options>
+            <Option Condition="'$(RuntimeVersionLatest)' != ''">
+              <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+              <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+              <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+              <PublishSingleFile>true</PublishSingleFile>
+              <SetSymbolServer>-ms</SetSymbolServer>
+              <BuildProjectRuntime>win-$(TargetArchitecture)</BuildProjectRuntime>
+            </Option>
             <Option Condition="'$(RuntimeVersionLatest)' != ''">
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
             </Option>
             <Option>
               <TestName>SOS.DualRuntimes</TestName>
+              <SetSymbolServer>-ms</SetSymbolServer>
               <!-- The assembly path, class and function name of the desktop test code to load/run -->
               <DesktopTestParameters>$(RootBinDir)\bin\SymbolTestDll\$(TargetConfiguration)\$(DesktopFramework)\SymbolTestDll.dll SymbolTestDll.TestClass ThrowException</DesktopTestParameters>
             </Option>
           </Options>
           <Options>
+            <Option Condition="'$(AspNetCoreVersionLatest)' != ''">
+              <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+              <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+              <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
+              <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+              <PublishSingleFile>true</PublishSingleFile>
+              <SetSymbolServer>-ms</SetSymbolServer>
+              <BuildProjectRuntime>win-$(TargetArchitecture)</BuildProjectRuntime>
+            </Option>
             <Option Condition="'$(AspNetCoreVersionLatest)' != ''">
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
             </Option>
           </Options>
         </Option>
-        <Option>
-          <Options>
-            <Option>
-              <TestName>DotnetDumpCommands</TestName>
-            </Option>
-          </Options>
-          <Options>
-            <Option Condition="'$(RuntimeVersionLatest)' != ''">
-              <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
-              <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
-              <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
-            </Option>
-            <Option Condition="'$(RuntimeVersion50)' != ''">
-              <BuildProjectFramework>net5.0</BuildProjectFramework>
-              <RuntimeFrameworkVersion>$(RuntimeVersion50)</RuntimeFrameworkVersion>
-            </Option>
-            <Option Condition="'$(RuntimeVersion31)' != ''">
-              <BuildProjectFramework>netcoreapp3.1</BuildProjectFramework>
-              <RuntimeFrameworkVersion>$(RuntimeVersion31)</RuntimeFrameworkVersion>
-              <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
-            </Option>
-          </Options>
-        </Option>
       </Options>
 
       <FrameworkVersion Condition="'$(FrameworkVersion)' == ''">$(RuntimeFrameworkVersion)</FrameworkVersion>
       <RuntimeSymbolsPath>$(DotNetRoot)\shared\Microsoft.NETCore.App\$(RuntimeFrameworkVersion)</RuntimeSymbolsPath>
-      <HostExe>$(DotNetRoot)\dotnet.exe</HostExe>
-      <HostArgs>--fx-version $(FrameworkVersion)</HostArgs>
+      
+      <!-- Single-file debuggees don't need the host -->
+      <HostExe Condition="'$(PublishSingleFile)' != 'true'">$(DotNetRoot)\dotnet.exe</HostExe>
+      <HostArgs Condition="'$(PublishSingleFile)' != 'true'">--fx-version $(FrameworkVersion)</HostArgs>
     </Option>
     <!--
         Desktop Runtime (debuggees cli built)
index dd09f37e75f600cfa01e38521b8c04d37c51dcf7..02f83bca2ec7f27294b0f51dae6f12fac26a6016 100644 (file)
@@ -14,7 +14,7 @@ namespace SymbolTestApp
     {
         public static void Main(string[] args)
         {
-            string dllPath = args[0];
+            string dllPath = args.Length > 0 ? args[0] : string.Empty;
             Console.WriteLine("SymbolTestApp starting {0}", dllPath);
             Foo1(42, dllPath);
         }
index 07df5bcd0e2bd4690ac41712cfa5a30d11e9efc0..f66bc9ad6409886f135d00b9404ed89fb7b84ec0 100644 (file)
@@ -65,7 +65,7 @@ namespace WebApp3
             Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder => { 
                 webBuilder.ConfigureKestrel(serverOptions => { 
                     serverOptions.ConfigureHttpsDefaults(httpsOptions => {
-                        string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+                        string directory = Path.GetDirectoryName(AppContext.BaseDirectory);
                         httpsOptions.ServerCertificate = new X509Certificate2(Path.Combine(directory, "testCert.pfx"), "testPassword"); 
                     }); 
                 }); 
index ea85f1649e5f056e9c8687b77e78d5d590b1b555..ea11b0e7152643e751638f0ae6e6405cc2215e80 100644 (file)
@@ -38,11 +38,11 @@ public class SOS
         }
     }
 
-    private async Task RunTest(string scriptName, bool testLive = true, bool testDump = true, SOSRunner.TestInformation information = null)
+    private async Task RunTest(string scriptName, SOSRunner.TestInformation information)
     {
         information.OutputHelper = Output;
 
-        if (testLive)
+        if (information.TestLive)
         {
             // Live
             using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
@@ -51,48 +51,44 @@ public class SOS
             }
         }
 
-        if (testDump)
+        if (information.TestDump)
         {
             string dumpName = null;
 
-            // Create and test dumps on OSX or Alpine only if the runtime is 6.0 or greater
-            if (!(OS.Kind == OSKind.OSX || OS.IsAlpine) || information.TestConfiguration.RuntimeFrameworkVersionMajor > 5)
+            // Generate a crash dump.
+            if (information.DebuggeeDumpOutputRootDir != null)
             {
-                // Generate a crash dump.
-                if (information.DebuggeeDumpOutputRootDir != null)
+                dumpName = await SOSRunner.CreateDump(information);
+            }
+
+            // Test against a crash dump.
+            if (information.DebuggeeDumpInputRootDir != null)
+            {
+                // With cdb (Windows) or lldb (Linux)
+                using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                 {
-                    dumpName = await SOSRunner.CreateDump(information);
+                    await runner.RunScript(scriptName);
                 }
 
-                // Test against a crash dump.
-                if (information.DebuggeeDumpInputRootDir != null)
+                // Using the dotnet-dump analyze tool if the path exists in the config file.
+                // TODO: dotnet-dump currently doesn't support macho core dumps that the MacOS createdump generates
+                if (information.TestConfiguration.DotNetDumpPath() != null && OS.Kind != OSKind.OSX)
                 {
-                    // With cdb (Windows) or lldb (Linux)
-                    using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
-                    {
-                        await runner.RunScript(scriptName);
-                    }
-
-                    // Using the dotnet-dump analyze tool if the path exists in the config file.
-                    // TODO: dotnet-dump currently doesn't support macho core dumps that the MacOS createdump generates
-                    if (information.TestConfiguration.DotNetDumpPath() != null && OS.Kind != OSKind.OSX)
+                    // Don't test dotnet-dump on triage dumps when running on desktop CLR.
+                    if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
                     {
-                        // Don't test dotnet-dump on triage dumps when running on desktop CLR.
-                        if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
+                        using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                         {
-                            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
-                            {
-                                await runner.RunScript(scriptName);
-                            }
+                            await runner.RunScript(scriptName);
                         }
                     }
                 }
+            }
 
-                // Test the crash report json file
-                if (dumpName != null && information.TestCrashReport)
-                {
-                    TestCrashReport(dumpName, information);
-                }
+            // Test the crash report json file
+            if (dumpName != null && information.TestCrashReport)
+            {
+                TestCrashReport(dumpName, information);
             }
         }
     }
@@ -149,18 +145,24 @@ public class SOS
 
     private async Task RunTest(TestConfiguration config, string debuggeeName, string scriptName, string testName = null, bool testLive = true, bool testDump = true, bool testTriage = false)
     {
-        await RunTest(scriptName, testLive, testDump, new SOSRunner.TestInformation {
+        await RunTest(scriptName, new SOSRunner.TestInformation {
             TestConfiguration = config,
             TestName = testName,
+            TestLive = testLive,
+            TestDump = testDump,
             DebuggeeName = debuggeeName,
             DumpType = SOSRunner.DumpType.Heap
         });
 
-        if (testTriage)
+        // All single-file dumps are currently forced to "full" so skip triage
+        // Issue: https://github.com/dotnet/diagnostics/issues/2515
+        if (testTriage && !config.PublishSingleFile)
         {
-            await RunTest(scriptName, testLive: false, testDump, new SOSRunner.TestInformation {
+            await RunTest(scriptName, new SOSRunner.TestInformation {
                 TestConfiguration = config,
                 TestName = testName,
+                TestLive = false,
+                TestDump = testDump,
                 DebuggeeName = debuggeeName,
                 DumpType = SOSRunner.DumpType.Triage
             });
@@ -195,12 +197,15 @@ public class SOS
     [SkippableTheory, MemberData(nameof(Configurations))]
     public async Task Overflow(TestConfiguration config)
     {
-        // The .NET Core createdump facility may not catch stack overflow so use gdb to generate dump
-        await RunTest("Overflow.script", information: new SOSRunner.TestInformation {
+        await RunTest("Overflow.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
             DebuggeeName = "Overflow",
             // Generating the logging for overflow test causes so much output from createdump that it hangs/timesout the test run
             DumpDiagnostics = config.IsNETCore && config.RuntimeFrameworkVersionMajor >= 6,
+            // Single file dumps don't capture the overflow exception info so disable testing against a dump
+            // Issue: https://github.com/dotnet/diagnostics/issues/2515
+            TestDump = !config.PublishSingleFile,
+            // The .NET Core createdump facility may not catch stack overflow so use gdb to generate dump
             DumpGenerator = config.StackOverflowCreatesDump ? SOSRunner.DumpGenerator.CreateDump : SOSRunner.DumpGenerator.NativeDebugger
         });
     }
@@ -245,11 +250,12 @@ public class SOS
     public async Task OtherCommands(TestConfiguration config)
     {
         // This debuggee needs the directory of the exes/dlls to load the SymbolTestDll assembly.
-        await RunTest("OtherCommands.script", information: new SOSRunner.TestInformation {
+        await RunTest("OtherCommands.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
             TestName = "SOS.OtherCommands",
             DebuggeeName = "SymbolTestApp",
-            DebuggeeArguments = "%DEBUG_ROOT%",
+            // Assumes that SymbolTestDll.dll that is dynamically loaded is the parent directory of the single file app
+            DebuggeeArguments = config.PublishSingleFile ? Path.Combine("%DEBUG_ROOT%", "..") : "%DEBUG_ROOT%"
         });
     }
 
@@ -258,15 +264,17 @@ public class SOS
     {
         foreach (TestConfiguration currentConfig in TestRunner.EnumeratePdbTypeConfigs(config))
         {
+            // Assumes that SymbolTestDll.dll that is dynamically loaded is the parent directory of the single file app
+            string debuggeeArguments = currentConfig.PublishSingleFile ? Path.Combine("%DEBUG_ROOT%", "..") : "%DEBUG_ROOT%";
             string debuggeeDumpOutputRootDir = Path.Combine(currentConfig.DebuggeeDumpOutputRootDir(), currentConfig.DebugType);
             string debuggeeDumpInputRootDir = Path.Combine(currentConfig.DebuggeeDumpInputRootDir(), currentConfig.DebugType);
 
             // This debuggee needs the directory of the exes/dlls to load the SymbolTestDll assembly.
-            await RunTest("StackAndOtherTests.script", information: new SOSRunner.TestInformation {
+            await RunTest("StackAndOtherTests.script", new SOSRunner.TestInformation {
                 TestConfiguration = currentConfig,
                 TestName = "SOS.StackAndOtherTests",
                 DebuggeeName = "SymbolTestApp",
-                DebuggeeArguments = "%DEBUG_ROOT%",
+                DebuggeeArguments = debuggeeArguments,
                 DumpNameSuffix = currentConfig.DebugType,
                 DebuggeeDumpOutputRootDir = debuggeeDumpOutputRootDir,
                 DebuggeeDumpInputRootDir = debuggeeDumpInputRootDir,
@@ -279,11 +287,11 @@ public class SOS
                 var settings = new Dictionary<string, string>(currentConfig.AllSettings) {
                     ["SetHostRuntime"] = "-none"
                 };
-                await RunTest("StackAndOtherTests.script", information: new SOSRunner.TestInformation {
+                await RunTest("StackAndOtherTests.script", new SOSRunner.TestInformation {
                     TestConfiguration = new TestConfiguration(settings),
                     TestName = "SOS.StackAndOtherTests",
                     DebuggeeName = "SymbolTestApp",
-                    DebuggeeArguments = "%DEBUG_ROOT%",
+                    DebuggeeArguments = debuggeeArguments,
                     DumpNameSuffix = currentConfig.DebugType,
                     DebuggeeDumpOutputRootDir = debuggeeDumpOutputRootDir,
                     DebuggeeDumpInputRootDir = debuggeeDumpInputRootDir,
@@ -292,22 +300,12 @@ public class SOS
         }
     }
 
-    [SkippableTheory, MemberData(nameof(GetConfigurations), "TestName", "SOS.WebApp")]
-    public async Task WebApp(TestConfiguration config)
-    {
-        await RunTest("WebApp.script", testLive: false, information: new SOSRunner.TestInformation {
-            TestConfiguration = config,
-            DebuggeeName = "WebApp",
-            UsePipeSync = true,
-            DumpGenerator = SOSRunner.DumpGenerator.DotNetDump
-        });
-    }
-
     [SkippableTheory, MemberData(nameof(GetConfigurations), "TestName", "SOS.WebApp3")]
     public async Task WebApp3(TestConfiguration config)
     {
-        await RunTest("WebApp.script", testLive: false, information: new SOSRunner.TestInformation {
+        await RunTest("WebApp.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
+            TestLive = false,
             DebuggeeName = "WebApp3",
             UsePipeSync = true,
             DumpGenerator = SOSRunner.DumpGenerator.DotNetDump
@@ -317,14 +315,19 @@ public class SOS
     [SkippableTheory, MemberData(nameof(GetConfigurations), "TestName", "SOS.DualRuntimes")]
     public async Task DualRuntimes(TestConfiguration config)
     {
+        if (config.PublishSingleFile)
+        {
+            throw new SkipTestException("Single file not supported");
+        }
         // The assembly path, class and function name of the desktop test code to load/run
         string desktopTestParameters = TestConfiguration.MakeCanonicalPath(config.GetValue("DesktopTestParameters"));
         if (string.IsNullOrEmpty(desktopTestParameters))
         {
             throw new SkipTestException("DesktopTestParameters config value does not exists");
         }
-        await RunTest("DualRuntimes.script", testLive: false, information: new SOSRunner.TestInformation {
+        await RunTest("DualRuntimes.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
+            TestLive = false,
             TestName = "SOS.DualRuntimes",
             DebuggeeName = "WebApp3",
             DebuggeeArguments = desktopTestParameters,
@@ -333,12 +336,12 @@ public class SOS
         });
     }
 
-    [SkippableTheory, MemberData(nameof(GetConfigurations), "TestName", "DotnetDumpCommands")]
+    [SkippableTheory, MemberData(nameof(Configurations))]
     public async Task ConcurrentDictionaries(TestConfiguration config)
     {
-        await RunTest("ConcurrentDictionaries.script", testLive: false, information: new SOSRunner.TestInformation
-        {
+        await RunTest("ConcurrentDictionaries.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
+            TestLive = false,
             DebuggeeName = "DotnetDumpCommands",
             DebuggeeArguments = "dcd",
             DumpNameSuffix = "dcd",
@@ -347,12 +350,12 @@ public class SOS
         });
     }
 
-    [SkippableTheory, MemberData(nameof(GetConfigurations), "TestName", "DotnetDumpCommands")]
+    [SkippableTheory, MemberData(nameof(Configurations))]
     public async Task DumpGen(TestConfiguration config)
     {
-        await RunTest("DumpGen.script", testLive: false, information: new SOSRunner.TestInformation
-        {
+        await RunTest("DumpGen.script", new SOSRunner.TestInformation {
             TestConfiguration = config,
+            TestLive = false,
             DebuggeeName = "DotnetDumpCommands",
             DebuggeeArguments = "dumpgen",
             DumpNameSuffix = "dumpgen",
index 7b7749f172742596f387240927793df6da98a596..7c6c3243e8f8460de3ea953f681ac506a4f91657 100644 (file)
@@ -67,8 +67,11 @@ public class SOSRunner : IDisposable
     public class TestInformation
     {
         private string _testName;
+        private bool _testLive = true;
+        private bool _testDump = true;
         private bool _testCrashReport = true;
         private DumpGenerator _dumpGenerator = DumpGenerator.CreateDump; 
+        private DumpType _dumpType = DumpType.Heap;
         private string _debuggeeDumpOutputRootDir;
         private string _debuggeeDumpInputRootDir;
 
@@ -76,6 +79,26 @@ public class SOSRunner : IDisposable
 
         public ITestOutputHelper OutputHelper { get; set; }
 
+        public bool TestLive
+        {
+            // Don't test single file on Alpine. lldb 10.0 can't launch them.
+            get { return _testLive && !(TestConfiguration.PublishSingleFile && OS.IsAlpine); }
+            set { _testLive = value; }
+        }
+
+        public bool TestDump 
+        {
+            get 
+            { 
+                return _testDump && 
+                    // Only single file dumps on Windows
+                    (!TestConfiguration.PublishSingleFile || OS.Kind == OSKind.Windows) && 
+                    // Generate and test dumps if on OSX or Alpine only if the runtime is 6.0 or greater 
+                    (!(OS.Kind == OSKind.OSX || OS.IsAlpine) || TestConfiguration.RuntimeFrameworkVersionMajor > 5);
+            }
+            set { _testDump = value; }
+        }
+
         public string TestName
         {
             get { return _testName ?? "SOS." + DebuggeeName; }
@@ -88,11 +111,15 @@ public class SOSRunner : IDisposable
 
         public DumpGenerator DumpGenerator
         {
-            get {
+            get 
+            {
                 DumpGenerator dumpGeneration = _dumpGenerator;
                 if (dumpGeneration == DumpGenerator.CreateDump)
                 {
-                    if (!TestConfiguration.CreateDumpExists || TestConfiguration.GenerateDumpWithLLDB() || TestConfiguration.GenerateDumpWithGDB())
+                    if (!TestConfiguration.CreateDumpExists || 
+                        TestConfiguration.PublishSingleFile || 
+                        TestConfiguration.GenerateDumpWithLLDB() || 
+                        TestConfiguration.GenerateDumpWithGDB())
                     {
                         dumpGeneration = DumpGenerator.NativeDebugger;
                     }
@@ -102,7 +129,16 @@ public class SOSRunner : IDisposable
             set { _dumpGenerator = value; }
         }
 
-        public DumpType DumpType { get; set; } = DumpType.Heap;
+        public DumpType DumpType
+        {
+            get
+            {
+                // Currently neither cdb or dotnet-dump collect generates valid dumps on Windows for an single file app
+                // Issue: https://github.com/dotnet/diagnostics/issues/2515
+                return TestConfiguration.PublishSingleFile ? SOSRunner.DumpType.Full : _dumpType;
+            }
+            set { _dumpType = value; }
+        }
 
         public bool UsePipeSync { get; set; } = false;
 
@@ -184,11 +220,6 @@ public class SOSRunner : IDisposable
 
         if (dumpGeneration == DumpGenerator.NativeDebugger)
         {
-            // Force the dump type to full for .NET Core 1.1 because the heap dumps are broken (can't read ThreadStore).
-            if (config.IsNETCore && config.RuntimeFrameworkVersionMajor == 1)
-            {
-                information.DumpType = DumpType.Full;
-            }
             using SOSRunner runner = await SOSRunner.StartDebugger(information, DebuggerAction.GenerateDump);
             dumpName = runner.ReplaceVariables("%DUMP_NAME%");
             try
@@ -545,7 +576,7 @@ public class SOSRunner : IDisposable
                     }
                     else
                     {
-                        var sb = new StringBuilder("settings set -- target.run-args");
+                        var sb = new StringBuilder();
                         if (!string.IsNullOrWhiteSpace(config.HostArgs))
                         {
                             string[] args = ReplaceVariables(variables, config.HostArgs).Trim().Split(' ');
@@ -567,7 +598,11 @@ public class SOSRunner : IDisposable
                             }
                         }
                         initialCommands.Add($@"target create ""{debuggeeTarget}""");
-                        initialCommands.Add(sb.ToString());
+                        string targetRunArgs = sb.ToString();
+                        if (!string.IsNullOrWhiteSpace(targetRunArgs))
+                        {
+                            initialCommands.Add($"settings set -- target.run-args {targetRunArgs}");
+                        }
                         initialCommands.Add("process launch -s");
 
                         // .NET Core 1.1 or less don't catch stack overflow and abort so need to catch SIGSEGV
@@ -820,17 +855,22 @@ public class SOSRunner : IDisposable
 
     public async Task LoadSosExtension()
     {
+        string runtimeSymbolsPath = _config.RuntimeSymbolsPath;
         string setHostRuntime = _config.SetHostRuntime();
+        string setSymbolServer = _config.SetSymbolServer();
         string sosPath = _config.SOSPath();
         List<string> commands = new List<string>();
+        bool isHostRuntimeNone = false;
 
         if (!string.IsNullOrEmpty(setHostRuntime))
         {
             switch (setHostRuntime)
             {
+                case "-none":
+                    isHostRuntimeNone = true;
+                    break;
                 case "-netfx":
                 case "-netcore":
-                case "-none":
                 case "-clear":
                     break;
                 default:
@@ -844,9 +884,16 @@ public class SOSRunner : IDisposable
                 if (_config.IsDesktop)
                 {
                     // Force the desktop sos to be loaded and then unload it.
-                    commands.Add(".cordll -l");
-                    commands.Add(".unload sos");
+                    if (!string.IsNullOrEmpty(runtimeSymbolsPath))
+                    {
+                        commands.Add($".cordll -lp {runtimeSymbolsPath}");
+                    }
+                    else
+                    {
+                        commands.Add(".cordll -l");
+                    }
                 }
+                commands.Add(".unload sos");
                 commands.Add($".load {sosPath}");
                 commands.Add(".reload");
                 commands.Add(".chain");
@@ -854,15 +901,19 @@ public class SOSRunner : IDisposable
                 {
                     commands.Add($"!SetHostRuntime {setHostRuntime}");
                 }
-                // Add the path to runtime so SOS can find DAC/DBI for triage dumps
-                if (_dumpType.HasValue && _dumpType == DumpType.Triage)
+                // If there is no host runtime and a single-file app or a triage dump, add the path to runtime so SOS can find DAC/DBI.
+                if ((isHostRuntimeNone && _config.PublishSingleFile) || 
+                    (_dumpType.HasValue && _dumpType.Value == DumpType.Triage))
                 {
-                    string runtimeSymbolsPath = _config.RuntimeSymbolsPath;
-                    if (runtimeSymbolsPath != null)
+                    if (!string.IsNullOrEmpty(runtimeSymbolsPath))
                     {
-                        commands.Add("!SetClrPath " + runtimeSymbolsPath);
+                        commands.Add($"!SetClrPath {runtimeSymbolsPath}");
                     }
                 }
+                if (!isHostRuntimeNone && !string.IsNullOrEmpty(setSymbolServer))
+                {
+                    commands.Add($"!SetSymbolServer {setSymbolServer}");
+                }
                 break;
             case NativeDebugger.Lldb:
                 commands.Add($"plugin load {sosPath}");
@@ -870,11 +921,27 @@ public class SOSRunner : IDisposable
                 {
                     commands.Add($"sethostruntime {setHostRuntime}");
                 }
+                // If there is no host runtime and a single-file app, add the path to runtime so SOS can find DAC/DBI.
+                if (isHostRuntimeNone && _config.PublishSingleFile)
+                {
+                    if (!string.IsNullOrEmpty(runtimeSymbolsPath))
+                    {
+                        commands.Add($"setclrpath {runtimeSymbolsPath}");
+                    }
+                }
+                if (!isHostRuntimeNone && !string.IsNullOrEmpty(setSymbolServer))
+                {
+                    commands.Add($"setsymbolserver {setSymbolServer}");
+                }
                 SwitchToExceptionThread();
                 break;
             case NativeDebugger.Gdb:
                 break;
             case NativeDebugger.DotNetDump:
+                if (!string.IsNullOrEmpty(setSymbolServer))
+                {
+                    commands.Add($"setsymbolserver {setSymbolServer}");
+                }
                 SwitchToExceptionThread();
                 break;
             default:
@@ -1035,6 +1102,10 @@ public class SOSRunner : IDisposable
             sb.Append(information.TestName);
             sb.Append(".");
             sb.Append(information.DumpType.ToString());
+            if (information.TestConfiguration.PublishSingleFile)
+            {
+                sb.Append(".SingleFile");
+            }
             if (information.DumpNameSuffix != null)
             {
                 sb.Append(".");
@@ -1288,6 +1359,10 @@ public class SOSRunner : IDisposable
         if (_config.PublishSingleFile)
         {
             defines.Add("SINGLE_FILE_APP");
+            if (OS.Kind == OSKind.Linux || OS.Kind == OSKind.OSX)
+            {
+                defines.Add("UNIX_SINGLE_FILE_APP");
+            }
         }
         return defines;
     }
@@ -1535,6 +1610,11 @@ public static class TestConfigurationExtensions
         return config.GetValue("SetHostRuntime");
     }
 
+    public static string SetSymbolServer(this TestConfiguration config)
+    {
+        return config.GetValue("SetSymbolServer");
+    }
+
     public static string DesktopRuntimePath(this TestConfiguration config)
     {
         return TestConfiguration.MakeCanonicalPath(config.GetValue("DesktopRuntimePath"));
index a3df36ecc9962781a0227f2eab19617fed6ff7cd..50a34eac51e3933189895d3d0c564eb006d82958 100644 (file)
@@ -31,13 +31,13 @@ VERIFY:InnerException:\s+<none>\s+
 VERIFY:StackTrace \(generated\):\s+
 VERIFY:\s+SP\s+IP\s+\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Dd]iv[Zz]ero.*!C\.DivideByZero(\(.*\))?\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?DivZero[\\|/]DivZero\.cs @ 12\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*DivZero[\\|/]DivZero\.cs @ 12\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Dd]iv[Zz]ero.*!C\.F3(\(.*\))?\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?DivZero[\\|/]DivZero\.cs @ 21\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*DivZero[\\|/]DivZero\.cs @ 21\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Dd]iv[Zz]ero.*!C\.F2(\(.*\))?\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?DivZero[\\|/]DivZero\.cs @ 33\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*DivZero[\\|/]DivZero\.cs @ 33\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Dd]iv[Zz]ero.*!C\.Main(\(.*\))?\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?DivZero[\\|/]DivZero\.cs @ (54|53)\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*DivZero[\\|/]DivZero\.cs @ (54|53)\s*\]\s*
 
 # Verify that Threads (clrthreads) works
 IFDEF:DOTNETDUMP
index b1be33ff5c1c7b3e7da3352280d450da75729800..90d7ca3fb0c694eae447451301a8e877540812f5 100644 (file)
@@ -6,8 +6,6 @@ CONTINUE
 
 LOADSOS
 
-SOSCOMMAND:SetSymbolServer -ms
-
 #
 # First test the .NET Core runtime that WebApp3 was started
 #
index d439323868f130ce2fcfe36f10c34b6e78de7609..69e71fb60009c8b1e1a2001ceb55a4854e49a34f 100644 (file)
@@ -27,10 +27,6 @@ SOSCOMMAND:DumpStackObjects
 VERIFY:<HEXVAL>\s+<HEXVAL>\s+System.IO.StringWriter\s+
 
 SOSCOMMAND:DumpObj <POUT>\w+\s+(<HEXVAL>)\s+(System.IO.StringWriter!\$0_)*System.IO.StringWriter\s+<POUT>
-IFDEF:MAJOR_RUNTIME_VERSION_1
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.IO.TextWriter\s+<DECVAL>\s+shared\s+static\s+Null\s+
-VERIFY:\s+>>\s+Domain:Value\s+<HEXVAL>:(<HEXVAL>|NotInit)\s+<<\s+
-ENDIF:MAJOR_RUNTIME_VERSION_1
 IFDEF:MAJOR_RUNTIME_VERSION_2
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.IO.TextWriter\s+<DECVAL>\s+shared\s+static\s+Null\s+
 VERIFY:\s+>>\s+Domain:Value\s+<HEXVAL>:(<HEXVAL>|NotInit)\s+<<\s+
index cfbc5373599ff0e1293a07d31b308d05e08b9f0b..98681c263797a552537b05d1b2f129d8e5db91ee 100644 (file)
@@ -24,11 +24,11 @@ VERIFY:InnerException:\s+<none>\s+
 VERIFY:StackTrace\s+\(generated\):\s+
 VERIFY:\s+SP\s+IP\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums.*!LineNums\.Program\.Bar.*\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 25\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 25\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums.*!LineNums\.Program\.Foo.*\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 16\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 16\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums.*!LineNums\.Program\.Main.*\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 10\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 10\s*\]\s*
 
 # Verify that Threads (clrthreads) works
 IFDEF:DOTNETDUMP
@@ -51,8 +51,8 @@ SOSCOMMAND:ClrStack
 VERIFY:.*OS Thread Id:\s+0x<HEXVAL>\s+.*
 VERIFY:\s+Child\s+SP\s+IP\s+Call Site\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums\.Program\.Bar\(\).*\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 25\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 25\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums\.Program\.Foo\(\).*\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 16\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 16\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+LineNums\.Program\.Main\(System.String\[\]\).*\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/]LineNums[\\|/]Program\.cs @ 10\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*LineNums[\\|/]Program\.cs @ 10\s*\]\s*
index 5414b4a00bd9016ce72ecbaf354b277d987cf7e1..4edba2d50537e301bb0e558a95d8a8ae1015ba01 100644 (file)
@@ -8,9 +8,10 @@ LOADSOS
 
 # Verify that bpmd works
 IFDEF:LIVE
-!IFDEF:MAJOR_RUNTIME_VERSION_1
 # Issue: https://github.com/dotnet/diagnostics/issues/2459
 !IFDEF:ALPINE
+# Issue: https://github.com/dotnet/diagnostics/issues/2673
+!IFDEF:UNIX_SINGLE_FILE_APP
 
 IFDEF:DESKTOP
 SOSCOMMAND:bpmd NestedExceptionTest.exe NestedExceptionTest.Program.Main
@@ -27,10 +28,10 @@ ENDIF:DESKTOP
 
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+NestedExceptionTest\.Program\.Main(\(.*\))?\s*
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ 8\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ 8\s*\]\s*
 
+ENDIF:UNIX_SINGLE_FILE_APP
 ENDIF:ALPINE
-ENDIF:MAJOR_RUNTIME_VERSION_1
 ENDIF:LIVE
 
 CONTINUE
@@ -92,7 +93,7 @@ VERIFY:InnerException:\s+System\.FormatException, Use !PrintException <HEXVAL> t
 VERIFY:StackTrace \(generated\):
 VERIFY:\s+SP\s+IP\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Nn]ested[Ee]xception[Tt]est.*!NestedExceptionTest\.Program\.Main(\(.*\))?\+0x<HEXVAL>\s*
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ (8|17)\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ (8|17)\s*\]\s*
 VERIFY:(StackTraceString: <none>\s+)?
 VERIFY:HResult:\s+80131509\s+
 VERIFY:There are nested exceptions on this thread. Run with -nested for details
@@ -118,4 +119,4 @@ SOSCOMMAND:ClrStack
 VERIFY:.*OS Thread Id:\s+0x<HEXVAL>\s+.*
 VERIFY:\s+Child\s+SP\s+IP\s+Call Site\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+NestedExceptionTest\.Program\.Main(\(.*\))?\s*
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ (8|17)\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*[Nn]ested[Ee]xception[Tt]est[\\|/][Nn]ested[Ee]xception[Tt]est\.cs @ (8|17)\s*\]\s*
index 26fd1313c72fb5262ad00cc224fdc2622810cbcf..d6f9794852d5a8ef9ec9d77590c01ea3f4e8d3e9 100644 (file)
@@ -6,9 +6,10 @@ LOADSOS
 
 # Verify that bpmd works
 IFDEF:LIVE
-!IFDEF:MAJOR_RUNTIME_VERSION_1
 # Issue: https://github.com/dotnet/diagnostics/issues/2459
 !IFDEF:ALPINE
+# Issue: https://github.com/dotnet/diagnostics/issues/2673
+!IFDEF:UNIX_SINGLE_FILE_APP
 
 IFDEF:DESKTOP
 SOSCOMMAND:bpmd SymbolTestApp.exe SymbolTestApp.Program.Main
@@ -26,6 +27,7 @@ ENDIF:DESKTOP
 
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Main\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 16\]\s*
+SOSCOMMAND:bpmd -clearall
 
 SOSCOMMAND:bpmd SymbolTestApp.cs:29
 IFDEF:DESKTOP
@@ -35,12 +37,6 @@ ENDIF:DESKTOP
 SOSCOMMAND:bpmd SymbolTestApp.dll SymbolTestApp.Program.Foo4
 ENDIF:DESKTOP
 
-!IFDEF:DESKTOP
-CONTINUE
-SOSCOMMAND:ClrStack
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Main\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 16\]\s*
-ENDIF:DESKTOP
-
 CONTINUE
 SOSCOMMAND:ClrStack
 IFDEF:DESKTOP
@@ -54,14 +50,12 @@ CONTINUE
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Foo4\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 34\]\s*
 
+ENDIF:UNIX_SINGLE_FILE_APP
 ENDIF:ALPINE
-ENDIF:MAJOR_RUNTIME_VERSION_1
 ENDIF:LIVE
 
 CONTINUE
 
-SOSCOMMAND:SetSymbolServer -ms
-
 EXTCOMMAND:clrmodules
 VERIFY:\s*<HEXVAL>.*
 
@@ -87,11 +81,13 @@ VERIFY:\s*System Domain:\s+<HEXVAL>\s+
 VERIFY:\s*LowFrequencyHeap:\s+<HEXVAL>\s+
 VERIFY:\s*HighFrequencyHeap:\s+<HEXVAL>\s+
 VERIFY:\s*Domain 1:\s+<HEXVAL>\s+
+!IFDEF:SINGLE_FILE_APP
 VERIFY:\s*Assembly:\s+<HEXVAL>\s+\[.*(System\.Private\.CoreLib(\.ni)?\.dll|mscorlib.dll)\]\s+
 
 SOSCOMMAND:DumpAssembly <POUT>\s*Assembly:\s+(<HEXVAL>)\s+\[.*<POUT>
 VERIFY:\s*Parent Domain:\s+<HEXVAL>\s+
 VERIFY:\s*Name:\s+.*(System\.Private\.CoreLib(\.ni)?\.dll|mscorlib.dll)\s+
+ENDIF:SINGLE_FILE_APP
 
 SOSCOMMAND:DumpModule <POUT>\s+Module\s+(<HEXVAL>)\s+.*<POUT>
 VERIFY:\s*PEFile:\s+<HEXVAL>\s+
index 1587e5fe603632dc6801b02c8ff455a510ddb45a..96d755177ca7041d74f3fbc618c540b10f562adb 100644 (file)
@@ -38,7 +38,7 @@ VERIFY:Message:\s+(<Invalid Object>|Exception has been thrown by the target of a
 VERIFY:InnerException:\s+System\.Exception, Use !PrintException <HEXVAL> to see more\.\s+
 VERIFY:StackTrace \(generated\):\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader\.Loader\.Main(\(\))?\+0x<HEXVAL>\s*
-VERIFY:[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]
+VERIFY:[.*[\\|/]Debuggees[\\|/].*[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]
 VERIFY:(StackTraceString: <none>\s+)?
 VERIFY:HResult:\s+80131604
 
@@ -63,4 +63,4 @@ SOSCOMMAND:ClrStack
 VERIFY:.*OS Thread Id:\s+0x<HEXVAL>\s+.*
 VERIFY:\s+Child\s+SP\s+IP\s+Call Site\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+(\*\*\* WARNING: Unable to verify checksum for ReflectionTest.exe\s*)?RefLoader\.Loader\.Main(\(\))?\s*
-VERIFY:[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]
+VERIFY:[.*[\\|/]Debuggees[\\|/].*[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]
index c2bf379c881a2804e5279451ea93d7e566ba8367..ab9a31fa2469971d083820c8b009a8fe98de103d 100644 (file)
@@ -41,9 +41,9 @@ VERIFY:InnerException:\s+<none>\s+
 VERIFY:StackTrace\s+\(generated\):\s+
 VERIFY:\s+SP\s+IP\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Ss]imple[Tt]hrow.*!(\$0_)?UserObject\.UseObject.*\+0x<HEXVAL>\s*
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?SimpleThrow[\\|/]UserObject\.cs @ 16\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*SimpleThrow[\\|/]UserObject\.cs @ 16\s*\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Ss]imple[Tt]hrow.*!(\$0_)?Simple\.Main.*\+0x<HEXVAL>\s+
-VERIFY:\[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?SimpleThrow[\\|/]SimpleThrow\.cs @ 9\s*\]\s*
+VERIFY:\[.*[\\|/]Debuggees[\\|/].*SimpleThrow[\\|/]SimpleThrow\.cs @ 9\s*\]\s*
 
 # Verify that Threads (clrthreads) works
 IFDEF:DOTNETDUMP
@@ -66,6 +66,6 @@ SOSCOMMAND:ClrStack
 VERIFY:.*OS Thread Id:\s+0x<HEXVAL>\s+.*
 VERIFY:\s+Child\s+SP\s+IP\s+Call Site\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+(\*\*\* WARNING: Unable to verify checksum for SimpleThrow.exe\s*)?UserObject\.UseObject.*\s+
-VERIFY:[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?SimpleThrow[\\|/]UserObject\.cs @ 16\s*\]
+VERIFY:[.*[\\|/]Debuggees[\\|/].*SimpleThrow[\\|/]UserObject\.cs @ 16\s*\]
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+Simple\.Main\(\)\s+
-VERIFY:[.*[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?SimpleThrow[\\|/]SimpleThrow\.cs @ 9\s*\]
+VERIFY:[.*[\\|/]Debuggees[\\|/].*SimpleThrow[\\|/]SimpleThrow\.cs @ 9\s*\]
index c321762c8f54f08b7bb5ad423579c2cfb0be3023..f9026c031e8d997e212e9b97d44e97b033695446 100644 (file)
@@ -8,9 +8,10 @@ LOADSOS
 
 # Verify that bpmd works
 IFDEF:LIVE
-!IFDEF:MAJOR_RUNTIME_VERSION_1
 # Issue: https://github.com/dotnet/diagnostics/issues/2459
 !IFDEF:ALPINE
+# Issue: https://github.com/dotnet/diagnostics/issues/2673
+!IFDEF:UNIX_SINGLE_FILE_APP
 
 IFDEF:DESKTOP
 SOSCOMMAND:bpmd SymbolTestApp.exe SymbolTestApp.Program.Main
@@ -27,6 +28,7 @@ ENDIF:DESKTOP
 
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Main\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 16\]\s*
+SOSCOMMAND:bpmd -clearall
 
 SOSCOMMAND:bpmd SymbolTestApp.cs:29
 IFDEF:DESKTOP
@@ -36,12 +38,6 @@ ENDIF:DESKTOP
 SOSCOMMAND:bpmd SymbolTestApp.dll SymbolTestApp.Program.Foo4
 ENDIF:DESKTOP
 
-!IFDEF:DESKTOP
-CONTINUE
-SOSCOMMAND:ClrStack
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Main\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 16\]\s*
-ENDIF:DESKTOP
-
 CONTINUE
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Foo2\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ (28|29)\]\s*
@@ -50,14 +46,12 @@ CONTINUE
 SOSCOMMAND:ClrStack
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.Program\.Foo4\(.*\)\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 34\]\s*
 
+ENDIF:UNIX_SINGLE_FILE_APP
 ENDIF:ALPINE
-ENDIF:MAJOR_RUNTIME_VERSION_1
 ENDIF:LIVE
 
 CONTINUE
 
-SOSCOMMAND:SetSymbolServer -ms
-
 !IFDEF:DOTNETDUMP
 IFDEF:WINDOWS
 SOSCOMMAND:SetHostRuntime
@@ -100,7 +94,6 @@ VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.(dll|exe)!SymbolTestApp\.Program\
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.(dll|exe)!SymbolTestApp\.Program\.Foo2\(.*\)\s+\+\s+<DECVAL>\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 29\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.(dll|exe)!SymbolTestApp\.Program\.Foo1\(.*\)\s+\+\s+<DECVAL>\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 24\]\s*
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+SymbolTestApp\.(dll|exe)!SymbolTestApp\.Program\.Main\(.*\)\s+\+\s+<DECVAL>\s+\[(?i:.*[\\|/]SymbolTestApp\.cs) @ 19\]\s*
-SOSCOMMAND:SetSymbolServer -disable
 
 # Verify that ClrStack all option works (locals/params)
 SOSCOMMAND:ClrStack -a
@@ -176,9 +169,9 @@ VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] Void SymbolTestApp\.Program\.Foo4\
 VERIFY:\s+PARAMETERS:\s+
 VERIFY:\s+\+ string dllPath\s+=\s+".*"\s+
 VERIFY:\s+LOCALS:\s+
-!IFDEF:MAJOR_RUNTIME_VERSION_1
+!IFDEF:SINGLE_FILE_APP
 VERIFY:\s+\+ System.RuntimeType dllType @ 0x<HEXVAL>
-ENDIF:MAJOR_RUNTIME_VERSION_1
+ENDIF:SINGLE_FILE_APP
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] I4 SymbolTestApp\.Program\.Foo2\(.*\)\s+\(.*\)\s+
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] I4 SymbolTestApp\.Program\.Foo1\(.*\)\s+\(.*\)\s+
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] Void SymbolTestApp\.Program\.Main\(.*\)\s+\(.*\)\s+
index 1c36844c5a8c8f1a38cd344abf89c3c8b8f02ca9..90d04f6578a4111489c933f3340001dff844b845 100644 (file)
@@ -22,7 +22,10 @@ IFDEF:64BIT
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+NestedExceptionTest\.Program\.Main\(.*\)\s+\[(?i:.*[\\|/]NestedExceptionTest\.cs) @ 13\s*\]\s+
 ENDIF:64BIT
 
+!IFDEF:WINDOWS
 SOSCOMMAND:SetSymbolServer -ms -loadsymbols
+ENDIF:WINDOWS
+
 !IFDEF:DOTNETDUMP
 IFDEF:WINDOWS
 SOSCOMMAND:SetHostRuntime
@@ -40,7 +43,6 @@ VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+(?i:NestedExceptionTest.*)!NestedExceptionTest
 IFDEF:64BIT
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+(?i:NestedExceptionTest.*)!NestedExceptionTest\.Program\.Main\(.*\)\s+\+\s+<DECVAL>\s+\[(?i:.*[\\|/]NestedExceptionTest\.cs) @ 13\s*\]\s+
 ENDIF:64BIT
-SOSCOMMAND:SetSymbolServer -disable
 
 # 3) Verifying that ClrStack all option works (locals/params)
 SOSCOMMAND:ClrStack -a
@@ -120,7 +122,9 @@ VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] Void NestedExceptionTest\.Program\
 VERIFY:\s+PARAMETERS:\s+
 VERIFY:\s+\+ string\[\] args\s+\(empty\)\s+
 VERIFY:\s+LOCALS:\s+
+!IFDEF:SINGLE_FILE_APP
 VERIFY:\s+\+ System.FormatException ex @ 0x<HEXVAL>\s+
+ENDIF:SINGLE_FILE_APP
 VERIFY:.*\s+<HEXVAL>\s+<HEXVAL>\s+\[DEFAULT\] Void NestedExceptionTest\.Program\.Main\(.*\)\s+\(.*\)\s+
 VERIFY:.*\s+Stack walk complete.\s+
 
index 7617a50a79ba1f497e24bfccf25402400fb4f60d..a85c0447c489ac7215737a68e7145d5db2d3c7fe 100644 (file)
@@ -30,7 +30,7 @@ VERIFY:\s+SP\s+IP\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>.+RandomTest(::|\.)RandomUserTask\.<\.ctor>.+\+0x<HEXVAL>\s*
 !IFDEF:DESKTOP
 !IFDEF:TRIAGE_DUMP
-VERIFY:[.+[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ (16|23)\]
+VERIFY:[.+[\\|/]Debuggees[\\|/].*[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ (16|23)\]
 ENDIF:TRIAGE_DUMP
 ENDIF:DESKTOP
 
@@ -44,12 +44,12 @@ VERIFY:\s+SP\s+IP\s+Function\s+
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>.+RandomTest(::|\.)RandomUserTask\.InnerException(\(\))?\+0x<HEXVAL>\s*
 !IFDEF:DESKTOP
 !IFDEF:TRIAGE_DUMP
-VERIFY:[.+[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ (34|35)\]
+VERIFY:[.+[\\|/]Debuggees[\\|/].*[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ (34|35)\]
 ENDIF:TRIAGE_DUMP
 ENDIF:DESKTOP
 VERIFY:\s+<HEXVAL>\s+<HEXVAL>.+RandomTest(::|\.)RandomUserTask\.<\.ctor>.+\+0x<HEXVAL>\s*
 !IFDEF:DESKTOP
 !IFDEF:TRIAGE_DUMP
-VERIFY:[.+[\\|/]Debuggees[\\|/](dotnet.+[\\|/])?[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ 19\]
+VERIFY:[.+[\\|/]Debuggees[\\|/].*[Tt]ask[Nn]ested[Ee]xception[\\|/][Rr]andom[Uu]ser[Ll]ibrary[\\|/][Rr]andom[Uu]ser[Tt]ask\.cs @ 19\]
 ENDIF:TRIAGE_DUMP
 ENDIF:DESKTOP
index ce9a94cb29616ec028880e6b2d85880510606b8d..38b619de929be431c696de9bcf3b1635f7c4461c 100644 (file)
@@ -8,8 +8,6 @@ CONTINUE
 
 LOADSOS
 
-SOSCOMMAND:SetSymbolServer -ms
-
 !IFDEF:DOTNETDUMP
 IFDEF:WINDOWS
 SOSCOMMAND:SetHostRuntime
index 7da6956c7afea10a7b329d9aba1f34968b5080f4..5f29de0d93c83ce76a7c9dcc52d20b1376abc285 100644 (file)
@@ -53,7 +53,6 @@ add_definitions(-DSTRIKE)
 include_directories(${ROOT_DIR}/src/SOS/inc)
 include_directories(${ROOT_DIR}/src/SOS/extensions)
 include_directories(${ROOT_DIR}/src/SOS/gcdump)
-include_directories(${ROOT_DIR}/src/SOS/debugshim)
 include_directories(platform)
 
 if(WIN32)
@@ -97,7 +96,6 @@ if(WIN32)
   set(SOS_LIBRARY
     extensions
     corguids
-    debugshim
     dbgutil
     ${STATIC_MT_CRT_LIB}
     ${STATIC_MT_CPP_LIB}
@@ -176,7 +174,6 @@ else(WIN32)
   set(SOS_LIBRARY
     extensions
     corguids
-    debugshim
     dbgutil
     ${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
     coreclrpal
index f34ceea38f3f1bc98c2c1eb98654f009b92fe279..034e1519eeea16a2c77913372e22f9ee0ad833aa 100644 (file)
@@ -84,7 +84,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)src\SOS\Strike\platform;$(SolutionDir)src\SOS\inc;$(SolutionDir)src\inc;$(SolutionDir)src\pal\prebuilt\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\SOS\gcdump;$(SolutionDir)src\SOS\debugshim;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)src\SOS\Strike\platform;$(SolutionDir)src\SOS\inc;$(SolutionDir)src\inc;$(SolutionDir)src\pal\prebuilt\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\SOS\gcdump;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>%(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8 /homeparams</AdditionalOptions>
       <AssemblerListingLocation>Debug/</AssemblerListingLocation>
       <BufferSecurityCheck>true</BufferSecurityCheck>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR=\"Debug\";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <MASM>
       <PreprocessorDefinitions>DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;WIN32;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR="Debug";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalOptions>%(AdditionalOptions) /ZH:SHA_256</AdditionalOptions>
-      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
+      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
     </MASM>
     <Midl>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
       <HeaderFileName>%(Filename).h</HeaderFileName>
       <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
       <ProxyFileName>%(Filename)_p.c</ProxyFileName>
     </Midl>
     <Link>
-      <AdditionalDependencies>..\..\inc\Debug\corguids.lib;..\debugshim\Debug\debugshim.lib;..\dbgutil\Debug\dbgutil.lib;libcmtd.lib;libcpmtd.lib;libvcruntimed.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
+      <AdditionalDependencies>..\..\inc\Debug\corguids.lib;;..\dbgutil\Debug\dbgutil.lib;libcmtd.lib;libcpmtd.lib;libvcruntimed.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalOptions>%(AdditionalOptions) /machine:x64 /GUARD:CF /SUBSYSTEM:WINDOWS,6.01 /PDBCOMPRESS /IGNORE:4197,4013,4254,4070,4221 /NOVCFEATURE</AdditionalOptions>
       <DataExecutionPrevention>true</DataExecutionPrevention>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>%(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8</AdditionalOptions>
       <AssemblerListingLocation>Checked/</AssemblerListingLocation>
       <BufferSecurityCheck>true</BufferSecurityCheck>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>WIN32;DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR=\"Checked\";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <MASM>
       <PreprocessorDefinitions>DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;WIN32;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR="Checked";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalOptions>%(AdditionalOptions) /ZH:SHA_256</AdditionalOptions>
-      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
+      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
     </MASM>
     <Midl>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
       <HeaderFileName>%(Filename).h</HeaderFileName>
       <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
       <ProxyFileName>%(Filename)_p.c</ProxyFileName>
     </Midl>
     <Link>
-      <AdditionalDependencies>..\..\inc\Checked\corguids.lib;..\debugshim\Checked\debugshim.lib;..\dbgutil\Checked\dbgutil.lib;libcmtd.lib;libcpmtd.lib;libvcruntimed.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
+      <AdditionalDependencies>..\..\inc\Checked\corguids.lib;..\dbgutil\Checked\dbgutil.lib;libcmtd.lib;libcpmtd.lib;libvcruntimed.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalOptions>%(AdditionalOptions) /machine:x64 /GUARD:CF /SUBSYSTEM:WINDOWS,6.01 /PDBCOMPRESS /IGNORE:4197,4013,4254,4070,4221 /NOVCFEATURE</AdditionalOptions>
       <DataExecutionPrevention>true</DataExecutionPrevention>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>%(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8</AdditionalOptions>
       <AssemblerListingLocation>Release/</AssemblerListingLocation>
       <BufferSecurityCheck>true</BufferSecurityCheck>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>WIN32;NDEBUG;URTBLDENV_FRIENDLY=Retail;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR=\"Release\";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(ArtifactsObjDir)Windows_NT.x64.Debug\src\SOS\Strike;..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ArtifactsObjDir)Windows_NT.x64.Debug\src\SOS\Strike;..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <MASM>
       <PreprocessorDefinitions>NDEBUG;URTBLDENV_FRIENDLY=Retail;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;WIN32;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR="Release";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalOptions>%(AdditionalOptions) /ZH:SHA_256</AdditionalOptions>
-      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
+      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
     </MASM>
     <Midl>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
       <HeaderFileName>%(Filename).h</HeaderFileName>
       <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
       <ProxyFileName>%(Filename)_p.c</ProxyFileName>
     </Midl>
     <Link>
-      <AdditionalDependencies>..\..\inc\Release\corguids.lib;..\debugshim\Release\debugshim.lib;..\dbgutil\Release\dbgutil.lib;libcmt.lib;libcpmt.lib;libvcruntime.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
+      <AdditionalDependencies>..\..\inc\Release\corguids.lib;..\dbgutil\Release\dbgutil.lib;libcmt.lib;libcpmt.lib;libvcruntime.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalOptions>%(AdditionalOptions) /machine:x64 /GUARD:CF /SUBSYSTEM:WINDOWS,6.01 /PDBCOMPRESS /IGNORE:4197,4013,4254,4070,4221 /DEFAULTLIB:ucrt.lib</AdditionalOptions>
       <DataExecutionPrevention>true</DataExecutionPrevention>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>%(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8</AdditionalOptions>
       <AssemblerListingLocation>RelWithDebInfo/</AssemblerListingLocation>
       <BufferSecurityCheck>true</BufferSecurityCheck>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>WIN32;NDEBUG;URTBLDENV_FRIENDLY=Retail;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR=\"RelWithDebInfo\";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ResourceCompile>
     <MASM>
       <PreprocessorDefinitions>NDEBUG;URTBLDENV_FRIENDLY=Retail;_AMD64_;_WIN64;AMD64;BIT64=1;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;WIN32;_WIN32;WINVER=0x0602;_WIN32_WINNT=0x0602;WIN32_LEAN_AND_MEAN=1;_CRT_SECURE_NO_WARNINGS;FEATURE_CORESYSTEM;FEATURE_COMINTEROP;FEATURE_HIJACK;_SECURE_SCL=0;_TARGET_WIN64_=1;SOS_TARGET_AMD64=1;SOS_TARGET_ARM64=1;STRIKE;USE_STL;FX_VER_INTERNALNAME_STR=SOS.dll;CMAKE_INTDIR="RelWithDebInfo";sos_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalOptions>%(AdditionalOptions) /ZH:SHA_256</AdditionalOptions>
-      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
+      <IncludePaths>..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(IncludePaths)</IncludePaths>
     </MASM>
     <Midl>
-      <AdditionalIncludeDirectories>Strike;..\..\pal\prebuilt\inc;..\..\inc;..\gcdump;..\..\SOS\debugshim;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>Strike;..\..\pal\prebuilt\inc;..\..\inc;..\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
       <HeaderFileName>%(Filename).h</HeaderFileName>
       <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
       <ProxyFileName>%(Filename)_p.c</ProxyFileName>
     </Midl>
     <Link>
-      <AdditionalDependencies>..\..\inc\RelWithDebInfo\corguids.lib;..\debugshim\RelWithDebInfo\debugshim.lib;..\dbgutil\RelWithDebInfo\dbgutil.lib;libcmt.lib;libcpmt.lib;libvcruntime.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
+      <AdditionalDependencies>..\..\inc\RelWithDebInfo\corguids.lib;..\dbgutil\RelWithDebInfo\dbgutil.lib;libcmt.lib;libcpmt.lib;libvcruntime.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;dbghelp.lib;uuid.lib;version.lib;dbgeng.lib;advapi32.lib;psapi.lib;ntdll.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <AdditionalOptions>%(AdditionalOptions) /machine:x64 /GUARD:CF /SUBSYSTEM:WINDOWS,6.01 /PDBCOMPRESS /IGNORE:4197,4013,4254,4070,4221 /DEFAULTLIB:ucrt.lib</AdditionalOptions>
       <DataExecutionPrevention>true</DataExecutionPrevention>
     <ClInclude Include="ntinfo.h" />
     <ClInclude Include="platformspecific.h" />
     <ClInclude Include="platform\cordebugdatatarget.h" />
-    <ClInclude Include="platform\cordebuglibraryprovider.h" />
     <ClInclude Include="platform\datatarget.h" />
     <ClInclude Include="platform\hostimpl.h" />
     <ClInclude Include="platform\runtimeimpl.h" />
   <ImportGroup Label="ExtensionTargets">
     <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index ff158d13388289d3c3bd0c208f771a575e92d418..da3168424f8f173a08b08176d5029b2423900c07 100644 (file)
@@ -61,9 +61,6 @@
     <ClInclude Include="platform\cordebugdatatarget.h">
       <Filter>platform</Filter>
     </ClInclude>
-    <ClInclude Include="platform\cordebuglibraryprovider.h">
-      <Filter>platform</Filter>
-    </ClInclude>
     <ClInclude Include="platform\datatarget.h">
       <Filter>platform</Filter>
     </ClInclude>
index 140793c467fb9d63b6bac60ad1403f1e52019d49..d3dcc12c59c03e96127dc1ac9afee493636e9e3e 100644 (file)
@@ -137,22 +137,15 @@ class SOSExtensions : public Extensions
         if (m_pDebuggerServices != nullptr)
         {
             ((DbgEngServices*)m_pDebuggerServices)->Uninitialize();
+            m_pDebuggerServices->Release();
+            m_pDebuggerServices = nullptr;
         }
     }
 #endif
 
 public:
 
-#ifdef FEATURE_PAL
-    static HRESULT Initialize()
-    {
-        if (s_extensions == nullptr)
-        {
-            s_extensions = new SOSExtensions(nullptr, nullptr);
-        }
-        return S_OK;
-    }
-#else
+#ifndef FEATURE_PAL
     static HRESULT Initialize(IDebugClient* client)
     {
         if (s_extensions == nullptr)
@@ -168,11 +161,11 @@ public:
     }
 #endif
 
-    static HRESULT Initialize(IHost* host)
+    static HRESULT Initialize(IHost* host, IDebuggerServices* debuggerServices)
     {
         if (s_extensions == nullptr) 
         {
-            s_extensions = new SOSExtensions(nullptr, host);
+            s_extensions = new SOSExtensions(debuggerServices, host);
         }
         return S_OK;
     }
index 94ee03a6cc44c96f559149e9f0a2bc005279ae85..222902d2b70cb10903b344a309572b3f83e23be9 100644 (file)
@@ -12,7 +12,7 @@
 class CorDebugDataTarget : public ICorDebugMutableDataTarget, public ICorDebugMetaDataLocator, public ICorDebugDataTarget4
 {
 public:
-    CorDebugDataTarget() : m_ref(0)
+    CorDebugDataTarget() : m_ref(1)
     {
     }
 
diff --git a/src/SOS/Strike/platform/cordebuglibraryprovider.h b/src/SOS/Strike/platform/cordebuglibraryprovider.h
deleted file mode 100644 (file)
index f5eac41..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-#ifndef __cordebuglibraryprovider_h__
-#define __cordebuglibraryprovider_h__
-
-#ifndef FEATURE_PAL
-extern HMODULE LoadLibraryAndCheck(PCWSTR filename, DWORD timestamp, DWORD filesize);
-#endif
-
-/**********************************************************************\
- * Provides a way for the public CLR debugging interface to find the 
- * appropriate mscordbi.dll, DAC, etc.
-\**********************************************************************/
-class CorDebugLibraryProvider : public ICLRDebuggingLibraryProvider, ICLRDebuggingLibraryProvider2
-{
-public:
-    CorDebugLibraryProvider(Runtime* pRuntime) :
-        m_ref(0),
-        m_pRuntime(pRuntime)
-    {
-    }
-
-    virtual ~CorDebugLibraryProvider() {}
-
-    virtual HRESULT STDMETHODCALLTYPE QueryInterface(
-        REFIID InterfaceId,
-        PVOID* pInterface)
-    {
-        if (InterfaceId == IID_IUnknown)
-        {
-            *pInterface = static_cast<IUnknown *>(static_cast<ICLRDebuggingLibraryProvider*>(this));
-        }
-#ifndef FEATURE_PAL
-        else if (InterfaceId == IID_ICLRDebuggingLibraryProvider)
-        {
-            *pInterface = static_cast<ICLRDebuggingLibraryProvider *>(this);
-        }
-#endif
-        else if (InterfaceId == IID_ICLRDebuggingLibraryProvider2)
-        {
-            *pInterface = static_cast<ICLRDebuggingLibraryProvider2 *>(this);
-        }
-        else
-        {
-            *pInterface = NULL;
-            return E_NOINTERFACE;
-        }
-
-        AddRef();
-        return S_OK;
-    }
-    
-    virtual ULONG STDMETHODCALLTYPE AddRef()
-    {
-        return InterlockedIncrement(&m_ref);    
-    }
-
-    virtual ULONG STDMETHODCALLTYPE Release()
-    {
-        LONG ref = InterlockedDecrement(&m_ref);
-        if (ref == 0)
-        {
-            delete this;
-        }
-        return ref;
-    }
-
-    HRESULT ProvideLibraryInternal(
-        const WCHAR* pwszFileName,
-        DWORD dwTimestamp,
-        DWORD dwSizeOfImage,
-        HMODULE* phModule,
-        LPWSTR* ppResolvedModulePath)
-    {
-        const char* filePath = nullptr;
-
-        if (_wcsncmp(pwszFileName, m_pRuntime->GetDacDllNameW(), _wcslen(m_pRuntime->GetDacDllNameW())) == 0)
-        {
-            filePath = m_pRuntime->GetDacFilePath();
-        }
-        else if (_wcsncmp(pwszFileName, NET_DBI_DLL_NAME_W, _wcslen(NET_DBI_DLL_NAME_W)) == 0)
-        {
-            filePath = m_pRuntime->GetDbiFilePath();
-        }
-
-        ArrayHolder<WCHAR> modulePath = new WCHAR[MAX_LONGPATH + 1];
-        if (filePath != nullptr)
-        {
-            int length = MultiByteToWideChar(CP_ACP, 0, filePath, -1, modulePath, MAX_LONGPATH);
-            if (0 >= length)
-            {
-                ExtErr("MultiByteToWideChar(filePath) failed. Last error = 0x%x\n", GetLastError());
-                return HRESULT_FROM_WIN32(GetLastError());
-            }
-        }
-        else
-        {
-            LPCSTR runtimeDirectory = m_pRuntime->GetRuntimeDirectory();
-            if (runtimeDirectory == nullptr)
-            {
-                ExtErr("Runtime not loaded\n");
-                return E_FAIL;
-            }
-            int length = MultiByteToWideChar(CP_ACP, 0, runtimeDirectory, -1, modulePath, MAX_LONGPATH);
-            if (0 >= length)
-            {
-                ExtErr("MultiByteToWideChar(runtimeDirectory) failed. Last error = 0x%x\n", GetLastError());
-                return HRESULT_FROM_WIN32(GetLastError());
-            }
-            wcscat_s(modulePath, MAX_LONGPATH, pwszFileName);
-        }
-
-        ExtOut("Loaded %S\n", modulePath.GetPtr());
-
-#ifndef FEATURE_PAL
-        if (phModule != NULL)
-        {
-            *phModule = LoadLibraryAndCheck(modulePath.GetPtr(), dwTimestamp, dwSizeOfImage);
-        }
-#endif
-        if (ppResolvedModulePath != NULL)
-        {
-            *ppResolvedModulePath = modulePath.Detach();
-        }
-        return S_OK;
-    }
-
-    // Called by the shim to locate and load dac and dbi
-    // Parameters:
-    //    pwszFileName - the name of the file to load
-    //    dwTimestamp - the expected timestamp of the file
-    //    dwSizeOfImage - the expected SizeOfImage (a PE header data value)
-    //    phModule - a handle to loaded module
-    //
-    // Return Value
-    //    S_OK if the file was loaded, or any error if not
-    virtual HRESULT STDMETHODCALLTYPE ProvideLibrary(
-        const WCHAR * pwszFileName,
-        DWORD dwTimestamp,
-        DWORD dwSizeOfImage,
-        HMODULE* phModule)
-    {
-        if ((phModule == NULL) || (pwszFileName == NULL))
-        {
-            return E_INVALIDARG;
-        }
-        return ProvideLibraryInternal(pwszFileName, dwTimestamp, dwSizeOfImage, phModule, NULL);
-    }
-
-    virtual HRESULT STDMETHODCALLTYPE ProvideLibrary2(
-        const WCHAR* pwszFileName,
-        DWORD dwTimestamp,
-        DWORD dwSizeOfImage,
-        LPWSTR* ppResolvedModulePath)
-    {
-        if ((pwszFileName == NULL) || (ppResolvedModulePath == NULL))
-        {
-            return E_INVALIDARG;
-        }
-        return ProvideLibraryInternal(pwszFileName, dwTimestamp, dwSizeOfImage, NULL, ppResolvedModulePath);
-    }
-
-protected:
-    LONG m_ref;
-    Runtime* m_pRuntime;
-};
-
-#endif // __cordebuglibraryprovider_h__
index dedac177acd058d21cd3284ab2d7b0c8abba2d71..463b4ef758a4372acadc459f9ccf332e57b61f54 100644 (file)
 #include <psapi.h>
 #include <clrinternal.h>
 #include <metahost.h>
-#include "debugshim.h"
 #include "runtimeimpl.h"
 #include "datatarget.h"
 #include "cordebugdatatarget.h"
-#include "cordebuglibraryprovider.h"
 #include "runtimeinfo.h"
 
 #ifdef FEATURE_PAL
 #include <unistd.h>
 #endif // !FEATURE_PAL
 
+typedef HRESULT (STDAPICALLTYPE  *OpenVirtualProcessImpl2FnPtr)(ULONG64 clrInstanceId, 
+    IUnknown * pDataTarget,
+    LPCWSTR pDacModulePath,
+    CLR_DEBUGGING_VERSION * pMaxDebuggerSupportedVersion,
+    REFIID riid,
+    IUnknown ** ppInstance,
+    CLR_DEBUGGING_PROCESS_FLAGS * pdwFlags);
+
+typedef HRESULT (STDAPICALLTYPE  *OpenVirtualProcessImplFnPtr)(ULONG64 clrInstanceId, 
+    IUnknown * pDataTarget,
+    HMODULE hDacDll,
+    CLR_DEBUGGING_VERSION * pMaxDebuggerSupportedVersion,
+    REFIID riid,
+    IUnknown ** ppInstance,
+    CLR_DEBUGGING_PROCESS_FLAGS * pdwFlags);
+
+typedef HRESULT (STDAPICALLTYPE  *OpenVirtualProcess2FnPtr)(ULONG64 clrInstanceId, 
+    IUnknown * pDataTarget,
+    HMODULE hDacDll,
+    REFIID riid,
+    IUnknown ** ppInstance,
+    CLR_DEBUGGING_PROCESS_FLAGS * pdwFlags);
+
+typedef HMODULE (STDAPICALLTYPE  *LoadLibraryWFnPtr)(LPCWSTR lpLibFileName);
+
 // Current runtime instance
 IRuntime* g_pRuntime = nullptr;
 
@@ -41,20 +64,30 @@ bool ElfReaderReadMemory(void* address, void* buffer, size_t size)
     return SUCCEEDED(g_ExtData->ReadVirtual((ULONG64)address, buffer, (ULONG)size, &read));
 }
 
+#endif // !defined(__APPLE__)
+
 /**********************************************************************\
  * Search all the modules in the process for the single-file host
 \**********************************************************************/
-static HRESULT GetSingleFileInfo(PULONG pModuleIndex, PULONG64 pModuleAddress, RuntimeInfo** ppRuntimeInfo)
+static HRESULT GetSingleFileInfo(ITarget* target, PULONG pModuleIndex, PULONG64 pModuleAddress, RuntimeInfo** ppRuntimeInfo)
 {
     _ASSERTE(pModuleIndex != nullptr);
     _ASSERTE(pModuleAddress != nullptr);
 
+    // No debugger service instance means that SOS is hosted by dotnet-dump,
+    // which does runtime enumeration in CLRMD. We should never get here.
+    IDebuggerServices* debuggerServices = GetDebuggerServices();
+    if (debuggerServices == nullptr) {
+        return E_NOINTERFACE;
+    }
+
     ULONG loaded, unloaded;
     HRESULT hr = g_ExtSymbols->GetNumberModules(&loaded, &unloaded);
     if (FAILED(hr)) {
         return hr;
     }
 
+    const char* symbolName = "DotNetRuntimeInfo";
     for (ULONG index = 0; index < loaded; index++)
     {
         ULONG64 baseAddress;
@@ -63,29 +96,39 @@ static HRESULT GetSingleFileInfo(PULONG pModuleIndex, PULONG64 pModuleAddress, R
             return hr;
         }
         ULONG64 symbolAddress;
-        if (TryGetSymbol(baseAddress, "DotNetRuntimeInfo", &symbolAddress))
+#if !defined(__APPLE__)
+        if (target->GetOperatingSystem() == ITarget::OperatingSystem::Linux)
         {
-            ULONG read = 0;
-            ArrayHolder<BYTE> buffer = new BYTE[sizeof(RuntimeInfo)];
-            hr = g_ExtData->ReadVirtual(symbolAddress, buffer, sizeof(RuntimeInfo), &read);
-            if (FAILED(hr)) {
-                return hr;
+            if (!TryGetSymbol(baseAddress, symbolName, &symbolAddress)) {
+                continue;
             }
-            if (strcmp(((RuntimeInfo*)buffer.GetPtr())->Signature, "DotNetRuntimeInfo") != 0) {
-                break;
+        }
+        else 
+#endif // !defined(__APPLE__)
+        {
+            hr = debuggerServices->GetOffsetBySymbol(index, symbolName, &symbolAddress);
+            if (FAILED(hr)) {
+                continue;
             }
-            *pModuleIndex = index;
-            *pModuleAddress = baseAddress;
-            *ppRuntimeInfo = (RuntimeInfo*)buffer.Detach();
-            return S_OK;
         }
+        ULONG read = 0;
+        ArrayHolder<BYTE> buffer = new BYTE[sizeof(RuntimeInfo)];
+        hr = g_ExtData->ReadVirtual(symbolAddress, buffer, sizeof(RuntimeInfo), &read);
+        if (FAILED(hr)) {
+            return hr;
+        }
+        if (strcmp(((RuntimeInfo*)buffer.GetPtr())->Signature, "DotNetRuntimeInfo") != 0) {
+            break;
+        }
+        *pModuleIndex = index;
+        *pModuleAddress = baseAddress;
+        *ppRuntimeInfo = (RuntimeInfo*)buffer.Detach();
+        return S_OK;
     }
 
     return E_FAIL;
 }
 
-#endif // !defined(__APPLE__)
-
 /**********************************************************************\
  * Creates a desktop or .NET Core instance of the runtime class
 \**********************************************************************/
@@ -102,16 +145,14 @@ HRESULT Runtime::CreateInstance(ITarget* target, RuntimeConfiguration configurat
     {
         // Check if the normal runtime module (coreclr.dll, libcoreclr.so, etc.) is loaded
         hr = g_ExtSymbols->GetModuleByModuleName(runtimeModuleName, 0, &moduleIndex, &moduleAddress);
-#if !defined(__APPLE__)
         if (FAILED(hr))
         {
             // If the standard runtime module isn't loaded, try looking for a single-file program
-            if (configuration == IRuntime::UnixCore)
+            if (configuration != IRuntime::WindowsDesktop)
             {
-                hr = GetSingleFileInfo(&moduleIndex, &moduleAddress, &runtimeInfo);
+                hr = GetSingleFileInfo(target, &moduleIndex, &moduleAddress, &runtimeInfo);
             }
         }
-#endif // !defined(__APPLE__)
 
         // If the previous operations were successful, get the size of the runtime module
         if (SUCCEEDED(hr))
@@ -420,7 +461,7 @@ HRESULT Runtime::GetClrDataProcess(IXCLRDataProcess** ppClrDataProcess)
         HMODULE hdac = LoadLibraryA(dacFilePath);
         if (hdac == NULL)
         {
-            ExtDbgOut("LoadLibrary(%s) FAILED %08x\n", dacFilePath, HRESULT_FROM_WIN32(GetLastError()));
+            ExtDbgOut("LoadLibraryA(%s) FAILED %08x\n", dacFilePath, HRESULT_FROM_WIN32(GetLastError()));
             return CORDBG_E_MISSING_DEBUGGER_EXPORTS;
         }
         PFN_CLRDataCreateInstance pfnCLRDataCreateInstance = (PFN_CLRDataCreateInstance)GetProcAddress(hdac, "CLRDataCreateInstance");
@@ -454,9 +495,7 @@ HRESULT Runtime::GetClrDataProcess(IXCLRDataProcess** ppClrDataProcess)
 \**********************************************************************/
 HRESULT Runtime::GetCorDebugInterface(ICorDebugProcess** ppCorDebugProcess)
 {
-    HMODULE hModule = NULL;
     HRESULT hr;
-    ToRelease<ICLRDebugging> pClrDebugging;
 
     // We may already have an ICorDebug instance we can use
     if (m_pCorDebugProcess != nullptr)
@@ -481,10 +520,6 @@ HRESULT Runtime::GetCorDebugInterface(ICorDebugProcess** ppCorDebugProcess)
         m_pCorDebugProcess->Release();
         m_pCorDebugProcess = nullptr;
     }
-
-    // SOS now has a statically linked version of the loader code that is normally found in mscoree/mscoreei.dll
-    // Its not much code and takes a big step towards 0 install dependencies
-    // Need to pick the appropriate SKU of CLR to detect
 #if defined(FEATURE_CORESYSTEM)
     GUID skuId = CLR_ID_ONECORE_CLR;
 #else
@@ -496,41 +531,107 @@ HRESULT Runtime::GetCorDebugInterface(ICorDebugProcess** ppCorDebugProcess)
         skuId = CLR_ID_V4_DESKTOP;
     }
 #endif
-    CLRDebuggingImpl* pDebuggingImpl = new CLRDebuggingImpl(skuId, IsWindowsTarget());
-    hr = pDebuggingImpl->QueryInterface(IID_ICLRDebugging, (LPVOID *)&pClrDebugging);
-    if (FAILED(hr))
+    const char* dacFilePath = GetDacFilePath();
+    if (dacFilePath == nullptr)
+    {
+        ExtErr("Could not find matching DAC\n");
+        return CORDBG_E_NO_IMAGE_AVAILABLE;
+    }
+    ArrayHolder<WCHAR> pDacModulePath = new WCHAR[MAX_LONGPATH + 1];
+    int length = MultiByteToWideChar(CP_ACP, 0, dacFilePath, -1, pDacModulePath, MAX_LONGPATH);
+    if (0 >= length)
     {
-        delete pDebuggingImpl;
+        hr = HRESULT_FROM_WIN32(GetLastError());
+        ExtErr("MultiByteToWideChar() DAC FAILED %08x\n", hr);
         return hr;
     }
-
-    ToRelease<ICorDebugMutableDataTarget> pCorDebugDataTarget = new CorDebugDataTarget;
-    pCorDebugDataTarget->AddRef();
-
-    ToRelease<ICLRDebuggingLibraryProvider> pCorDebugLibraryProvider = new CorDebugLibraryProvider(this);
-    pCorDebugLibraryProvider->AddRef();
-
-    CLR_DEBUGGING_VERSION clrDebuggingVersionRequested = {0};
-    clrDebuggingVersionRequested.wMajor = 4;
-
-    CLR_DEBUGGING_VERSION clrDebuggingVersionActual = {0};
-
+    const char* dbiFilePath = GetDbiFilePath();
+    if (dbiFilePath == nullptr) 
+    {
+        ExtErr("Could not find matching DBI\n");
+        return CORDBG_E_NO_IMAGE_AVAILABLE;
+    }
+    HMODULE hDbi = LoadLibraryA(dbiFilePath);
+    if (hDbi == NULL)
+    {
+        hr = HRESULT_FROM_WIN32(GetLastError());
+        ExtErr("LoadLibraryA(%s) FAILED %08x\n", dbiFilePath, hr);
+        return hr;
+    }
+    CLR_DEBUGGING_VERSION clrDebuggingVersionRequested = {0, 4, 0, 0, 0};
     CLR_DEBUGGING_PROCESS_FLAGS clrDebuggingFlags = (CLR_DEBUGGING_PROCESS_FLAGS)0;
+    ToRelease<ICorDebugMutableDataTarget> pDataTarget = new CorDebugDataTarget;
+    ToRelease<IUnknown> pUnkProcess = nullptr;
 
-    ToRelease<IUnknown> pUnkProcess;
-    hr = pClrDebugging->OpenVirtualProcess(
-        GetModuleAddress(),
-        pCorDebugDataTarget,
-        pCorDebugLibraryProvider,
-        &clrDebuggingVersionRequested,
-        IID_ICorDebugProcess,
-        &pUnkProcess,
-        &clrDebuggingVersionActual,
-        &clrDebuggingFlags);
+    // Get access to the latest OVP implementation and call it
+    OpenVirtualProcessImpl2FnPtr ovpFn = (OpenVirtualProcessImpl2FnPtr)GetProcAddress(hDbi, "OpenVirtualProcessImpl2");
+    if (ovpFn != nullptr)
+    {
+        hr = ovpFn(GetModuleAddress(), pDataTarget, pDacModulePath, &clrDebuggingVersionRequested, IID_ICorDebugProcess, &pUnkProcess, &clrDebuggingFlags);
+        if (FAILED(hr)) {
+               ExtErr("DBI OpenVirtualProcessImpl2 FAILED %08x\n", hr);
+            return hr;
+        }
+    }
+    else
+    {
+        HMODULE hDac = LoadLibraryA(dacFilePath);
+        if (hDac == NULL)
+        {
+            ExtErr("LoadLibraryA(%s) FAILED %08x\n", dacFilePath, HRESULT_FROM_WIN32(GetLastError()));
+            return CORDBG_E_MISSING_DEBUGGER_EXPORTS;
+        }
+#ifdef FEATURE_PAL
+        // On Linux/MacOS the DAC module handle needs to be re-created using the DAC PAL instance
+        // before being passed to DBI's OpenVirtualProcess* implementation. The DBI and DAC share 
+        // the same PAL where dbgshim has it's own.
+        LoadLibraryWFnPtr loadLibraryWFn = (LoadLibraryWFnPtr)GetProcAddress(hDac, "LoadLibraryW");
+        if (loadLibraryWFn != nullptr)
+        {
+            hDac = loadLibraryWFn(pDacModulePath);
+            if (hDac == NULL)
+            {
+                       ExtErr("DBI LoadLibraryW(%S) FAILED\n", pDacModulePath.GetPtr());
+                   return CORDBG_E_MISSING_DEBUGGER_EXPORTS;
+            }
+        }
+        else
+        {
+               ExtErr("DBI GetProcAddress(LoadLibraryW) FAILED\n");
+            return CORDBG_E_MISSING_DEBUGGER_EXPORTS;
+           }
+#endif // FEATURE_PAL
 
-    if (FAILED(hr)) {
-        return hr;
+        // Get access to OVP and call it
+        OpenVirtualProcessImplFnPtr ovpFn = (OpenVirtualProcessImplFnPtr)GetProcAddress(hDbi, "OpenVirtualProcessImpl");
+        if (ovpFn != nullptr)
+        {
+            // Have a CLR v4 Beta2+ DBI, call it and let it do the version check
+            hr = ovpFn(GetModuleAddress(), pDataTarget, hDac, &clrDebuggingVersionRequested, IID_ICorDebugProcess, &pUnkProcess, &clrDebuggingFlags);
+            if (FAILED(hr)) {
+                       ExtErr("DBI OpenVirtualProcessImpl FAILED %08x\n", hr);
+                return hr;
+            }
+        }
+        else
+        {
+            // Fallback to CLR v4 Beta1 path, but skip some of the checking we'd normally do (maxSupportedVersion, etc.)
+            OpenVirtualProcess2FnPtr ovp2Fn = (OpenVirtualProcess2FnPtr)GetProcAddress(hDbi, "OpenVirtualProcess2");
+            if (ovp2Fn != nullptr)
+            {
+                   hr = ovp2Fn(GetModuleAddress(), pDataTarget, hDac, IID_ICorDebugProcess, &pUnkProcess, &clrDebuggingFlags);
+            }
+            else
+            {
+                hr = CORDBG_E_LIBRARY_PROVIDER_ERROR;
+            }
+                   if (FAILED(hr)) {
+                       ExtErr("DBI OpenVirtualProcess2 FAILED %08x\n", hr);
+                       return hr;
+                   }
+        }
     }
+    _ASSERTE(pUnkProcess != nullptr);
     hr = pUnkProcess->QueryInterface(IID_ICorDebugProcess, (PVOID*)&m_pCorDebugProcess);
     if (FAILED(hr)) {
         return hr;
@@ -649,56 +750,4 @@ void Runtime::SymbolFileCallback(const char* moduleFileName, const char* symbolF
         SetDbiFilePath(symbolFilePath);
         return;
     }
-}
-
-#ifndef FEATURE_PAL
-
-/**********************************************************************\
- * Internal function to load and check the version of the module
-\**********************************************************************/
-HMODULE LoadLibraryAndCheck(
-    PCWSTR filename,
-    DWORD timestamp,
-    DWORD filesize)
-{
-    HMODULE hModule = LoadLibraryExW(
-        filename,
-        NULL,                               //  __reserved
-        LOAD_WITH_ALTERED_SEARCH_PATH);     // Ensure we check the dir in wszFullPath first
-
-    if (hModule == NULL)
-    {
-        ExtOut("Unable to load '%S'. hr = 0x%x.\n", filename, HRESULT_FROM_WIN32(GetLastError()));
-        return NULL;
-    }
-    
-    // Did we load the right one?
-    MODULEINFO modInfo = {0};
-    if (!GetModuleInformation(
-        GetCurrentProcess(),
-        hModule,
-        &modInfo,
-        sizeof(modInfo)))
-    {
-        ExtOut("Failed to read module information for '%S'. hr = 0x%x.\n", filename, HRESULT_FROM_WIN32(GetLastError()));
-        FreeLibrary(hModule);
-        return NULL;
-    }
-
-    IMAGE_DOS_HEADER * pDOSHeader = (IMAGE_DOS_HEADER *) modInfo.lpBaseOfDll;
-    IMAGE_NT_HEADERS * pNTHeaders = (IMAGE_NT_HEADERS *) (((LPBYTE) modInfo.lpBaseOfDll) + pDOSHeader->e_lfanew);
-    DWORD dwSizeActual = pNTHeaders->OptionalHeader.SizeOfImage;
-    DWORD dwTimeStampActual = pNTHeaders->FileHeader.TimeDateStamp;
-    if ((dwSizeActual != filesize) || (dwTimeStampActual != timestamp))
-    {
-        ExtOut("Found '%S', but it does not match the CLR being debugged.\n", filename);
-        ExtOut("Size: Expected '0x%x', Actual '0x%x'\n", filesize, dwSizeActual);
-        ExtOut("Time stamp: Expected '0x%x', Actual '0x%x'\n", timestamp, dwTimeStampActual);
-        FreeLibrary(hModule);
-        return NULL;
-    }
-
-    return hModule;
-}
-
-#endif // FEATURE_PAL
+}
\ No newline at end of file
index d752da7e559e7bb8a02007d2a68d69c6e676127d..a1e3e9d243dfabf99a2c8e5ad765c27da6a0d96e 100644 (file)
@@ -293,5 +293,5 @@ bool IsWindowsTarget()
     {
         return target->GetOperatingSystem() == ITarget::OperatingSystem::Windows;
     }
-    return ITarget::OperatingSystem::Unknown;
+    return false;
 }
index 23adfbd14faf9d3893139e42634e3e97913f34f0..20e3bd50899e25f76fad8d700bb7cf469f57f0fb 100644 (file)
@@ -44,7 +44,7 @@ ISymUnmanagedBinder3 *g_pSymBinder = nullptr;
 /**********************************************************************\
  * Called when the managed host or plug-in loads/initializes SOS.
 \**********************************************************************/
-extern "C" HRESULT STDMETHODCALLTYPE SOSInitializeByHost(IUnknown* punk)
+extern "C" HRESULT STDMETHODCALLTYPE SOSInitializeByHost(IUnknown* punk, IDebuggerServices* debuggerServices)
 {
     IHost* host = nullptr;
     HRESULT hr;
@@ -56,11 +56,13 @@ extern "C" HRESULT STDMETHODCALLTYPE SOSInitializeByHost(IUnknown* punk)
             return hr;
         }
     }
-    hr = SOSExtensions::Initialize(host);
+    hr = SOSExtensions::Initialize(host, debuggerServices);
     if (FAILED(hr)) {
         return hr;
     }
-    return InitializeSymbolService();
+    // Ignore error so the C++ hosting fallback doesn't fail because there is no symbol service
+    InitializeSymbolService();
+    return S_OK;
 }
 
 /**********************************************************************\
index 67a3c294a2d776a0eaf689f03f39f68547c51c86..b66e84115f25b4ebf8e3f2d92b6b2fa1efcc74e7 100644 (file)
@@ -24,7 +24,6 @@
 #include <metahost.h>
 #include <mscoree.h>
 #include <tchar.h>
-#include "debugshim.h"
 #include "gcinfo.h"
 
 #ifndef STRESS_LOG
index 33760713c1ca5399f938d326f7fb2bd6bf16ffcc..96567c99d4484dcebfac6cb45ad554dc158d23fa 100644 (file)
@@ -125,6 +125,11 @@ inline IHost* GetHost()
     return Extensions::GetInstance()->GetHost();
 }
 
+inline IDebuggerServices* GetDebuggerServices()
+{
+    return Extensions::GetInstance()->GetDebuggerServices();
+}
+
 inline ITarget* GetTarget()
 {
     return Extensions::GetInstance()->GetTarget();
index 09f98e304868ad32f656472d33060f418c7acab0..db124956bce21e8f4a95311b21ac155c41b35574 100644 (file)
@@ -76,7 +76,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)src\SOS\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\SOS\gcdump;$(SolutionDir)src\SOS\debugshim;$(SolutionDir)src\inc;$(SolutionDir)src\pal\prebuilt\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)src\SOS\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\SOS\gcdump;$(SolutionDir)src\inc;$(SolutionDir)src\pal\prebuilt\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>%(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8 /homeparams</AdditionalOptions>
       <AssemblerListingLocation>Debug/</AssemblerListingLocation>
       <BufferSecurityCheck>true</BufferSecurityCheck>
   <ImportGroup Label="ExtensionTargets">
     <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 27f80ae2222539e625fd8a4ff3194900943cd723..f597eae123d23484825f011dadf0aed8c73f1198 100644 (file)
@@ -105,7 +105,7 @@ public:
                         InitializeFunc initializeFunc = (InitializeFunc)dlsym(g_sosHandle, SOSInitialize);
                         if (initializeFunc)
                         {
-                            HRESULT hr = initializeFunc(GetHost());
+                            HRESULT hr = initializeFunc(GetHost(), GetDebuggerServices());
                             if (hr != S_OK)
                             {
                                 g_services->Output(DEBUG_OUTPUT_ERROR, SOSInitialize " failed %08x\n", hr);
index 84b4a006bd79091b90b6654b6d22e10059547a55..617adc8c40abe7ffc9d62e8fca335748715c7fa8 100644 (file)
@@ -16,7 +16,7 @@
 #define SOSInitialize "SOSInitializeByHost"
 
 typedef HRESULT (*CommandFunc)(ILLDBServices* services, const char* args);
-typedef HRESULT (*InitializeFunc)(IUnknown* punk);
+typedef HRESULT (*InitializeFunc)(IUnknown* punk, IDebuggerServices* debuggerServices);
 
 extern char *g_coreclrDirectory;
 extern LLDBServices* g_services;
index ab083dcbbd35fcc613c62935a9fc455673107bd9..8ebf84ee3900883ebdaafc4a79803cd3e5ba92db 100644 (file)
@@ -47,7 +47,7 @@ namespace Microsoft.Diagnostics.DebugServices.UnitTests
             Assert.Equal(defaultPath, symbolService.FormatSymbolStores());
             symbolService.DisableSymbolStore();
             
-            Assert.True(symbolService.ParseSymbolPath("srv*http://msdl.microsoft.com/download/symbols/"));
+            Assert.True(symbolService.ParseSymbolPath("srv*https://msdl.microsoft.com/download/symbols/"));
             Assert.Equal(defaultServer, symbolService.FormatSymbolStores());
             symbolService.DisableSymbolStore();