Add .NET 8.0 testing (#3633)
authorMike McLaughlin <mikem@microsoft.com>
Tue, 7 Feb 2023 18:16:03 +0000 (10:16 -0800)
committerGitHub <noreply@github.com>
Tue, 7 Feb 2023 18:16:03 +0000 (10:16 -0800)
* Add .NET 8.0 testing

Enable DumpGen and ConcurrentDictionaries tests on cdb and lldb. This involved some
small changes and hacks (like assuming the cdb prompt is always "0:000>".

Add script to disable DAC signature checks for Windows legs (not used for now).

Add dump generation xunit fixture to set reg key values.

Better card table error message

* Update versions

* Code review feedback

28 files changed:
eng/DisableSignatureCheck.ps1 [new file with mode: 0644]
eng/InstallRuntimes.proj
eng/Versions.props
global.json
src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.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/DesktopClrHost/CMakeLists.txt
src/SOS/SOS.UnitTests/Debuggees/Directory.Build.props
src/SOS/SOS.UnitTests/DumpGenerationFixture.cs [new file with mode: 0644]
src/SOS/SOS.UnitTests/SOSRunner.cs
src/SOS/SOS.UnitTests/Scripts/ConcurrentDictionaries.script
src/SOS/SOS.UnitTests/Scripts/DumpGen.script
src/SOS/SOS.UnitTests/Scripts/OtherCommands.script
src/SOS/Strike/gcroot.cpp
src/SOS/Strike/sos.cpp
src/SOS/Strike/strike.cpp
src/SOS/lldbplugin/services.cpp
src/tests/CommonTestRunner/ConfigFiles/Unix/Debugger.Tests.Config.txt
src/tests/CommonTestRunner/ConfigFiles/Windows/Debugger.Tests.Config.txt
src/tests/DbgShim.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt
src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt
src/tests/EventPipeTracee/EventPipeTracee.csproj
src/tests/EventPipeTracee/Program.cs
src/tests/ExitCodeTracee/ExitCodeTracee.csproj
src/tests/Microsoft.Diagnostics.NETCore.Client/GetProcessInfoTests.cs
src/tests/StackTracee/StackTracee.csproj
src/tests/Tracee/Tracee.csproj

diff --git a/eng/DisableSignatureCheck.ps1 b/eng/DisableSignatureCheck.ps1
new file mode 100644 (file)
index 0000000..45be433
--- /dev/null
@@ -0,0 +1,49 @@
+Param(
+  [switch] $Restore,
+  [string] $RepoRoot
+)
+$windowsNode = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
+$relevantNodeName = "MiniDumpSettings"
+$relevantNode = "$windowsNode\$relevantNodeName"
+$propName = "DisableAuxProviderSignatureCheck"
+$stateFileDirectory = "$RepoRoot\artifacts\tmp"
+$stateFileName = "$stateFileDirectory\SignatureCheck.state"
+
+if ($Restore)
+{
+    if (Test-Path $stateFileName)
+    {
+        Write-Host "Restoring state"
+        $value = Get-Content -Path $stateFileName
+        Write-Host "Restoring state: Set-ItemProperty $relevantNode -Name $propName -Value $value"
+        Set-ItemProperty $relevantNode -Name $propName -Value $value -Type "DWORD"
+        Write-Host "Restoring state: after Set-ItemProperty"
+    }
+}
+else
+{
+    $value = 0
+    if (Test-Path $relevantNode)
+    {
+        try
+        {
+            Write-Host "Disabling state: Get-ItemPropertyValue -Path $relevantNode -Name $propName"
+            $value = Get-ItemPropertyValue -Path $relevantNode -Name $propName
+        }
+        catch
+        {
+            Write-Host "Disabling state: exception"
+        }
+    }
+    else
+    {
+        Write-Host "Disabling state: New-Item -Path $windowsNode -Name $relevantNodeName"
+        New-Item -Path $windowsNode -Name $relevantNodeName | Out-Null
+    }
+    New-Item -Path $stateFileDirectory -Force -ItemType 'Directory' | Out-Null 
+    Write-Host "Disabling state: Writing state $value file to $stateFileName"
+    Out-File -Encoding ascii -InputObject $value -FilePath $stateFileName
+    Write-Host "Disabling state: Set-ItemProperty $relevantNode -Name $propName -Value 1"
+    Set-ItemProperty $relevantNode -Name $propName -Value 1 -Type "DWORD"
+    Write-Host "Disabling state: after Set-ItemProperty"
+}
index 5e466ed3ad2b90d174faf93aebb980f12d23bb3f..dc16301c66c301935329e4aa3eb2beaf4ca5d967 100644 (file)
 
      $(MicrosoftDotnetSdkInternalVersion) - .NET SDK to use for testing
 
-     $(VSRedistCommonNetCoreSharedFrameworkx6470Version)        - latest dotnet runtime package version (the version to install)
+     $(VSRedistCommonNetCoreSharedFrameworkx6480Version)        - latest dotnet runtime package version (the version to install)
      $(MicrosoftNETCoreAppRuntimewinx64Version)                 - latest dotnet runtime stable version (the version that actually is installed)
 
      $(MicrosoftAspNetCoreAppRefInternalVersion)                - latest dotnet aspnetcore package version (the version to install)
      $(MicrosoftAspNetCoreAppRefVersion)                        - latest dotnet aspnetcore stable version (the version that actually is installed)
 
+     $(MicrosoftNETCoreApp70Version) $(MicrosoftAspNetCoreApp70Version) - 7.0 version
      $(MicrosoftNETCoreApp60Version) $(MicrosoftAspNetCoreApp60Version) - 6.0 version
 
      $(SingleFileRuntimeLatestVersion)  - The latest version of the runtime used to build single-file apps
+     $(SingleFileRuntime70Version)      - The 7.0.x version of the runtime used to build single-file apps
      $(SingleFileRuntime60Version)      - The 6.0.x version of the runtime used to build single-file apps
 
      From Arcade:
     <RegeditCommand>regedit.exe</RegeditCommand>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <Enable31Testing>true</Enable31Testing>
-    <Enable31Testing Condition="'$(BuildArch)' == 'arm64' and $([MSBuild]::IsOsPlatform(OSX))">false</Enable31Testing>
-  </PropertyGroup>
-
   <Choose>
     <When Condition="$([MSBuild]::IsOsPlatform(Windows))">
       <PropertyGroup>
   </Choose>
 
   <ItemGroup Condition="!$(InternalReleaseTesting) and !$(PrivateBuildTesting)">
-    <TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6470Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
+    <TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6480Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
+    <TestVersions Include="70" RuntimeVersion="$(MicrosoftNETCoreApp70Version)" AspNetVersion="$(MicrosoftAspNetCoreApp70Version)" />
+    <TestVersions Include="SingleFile70" RuntimeVersion="$(SingleFileRuntime70Version)" />
     <TestVersions Include="60" RuntimeVersion="$(MicrosoftNETCoreApp60Version)" AspNetVersion="$(MicrosoftAspNetCoreApp60Version)" />
+    <TestVersions Include="SingleFile60" RuntimeVersion="$(SingleFileRuntime60Version)" />
   </ItemGroup>
 
   <!-- Local private build testing -->
   <ItemGroup Condition="$(PrivateBuildTesting)">
-    <TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6470Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
+    <TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6480Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
   </ItemGroup>
 
   <!-- Internal service release testing -->
     <PropertyGroup Condition="'$(PrivateBuildTesting)' != 'true' AND '$(InternalReleaseTesting)' != 'true'">
       <RuntimeVersion60>$(MicrosoftNETCoreApp60Version)</RuntimeVersion60>
       <AspNetCoreVersion60>$(MicrosoftAspNetCoreApp60Version)</AspNetCoreVersion60>
-      <!-- TODO: Add others -->
+      <RuntimeVersion70>$(MicrosoftNETCoreApp70Version)</RuntimeVersion70>
+      <AspNetCoreVersion70>$(MicrosoftAspNetCoreApp70Version)</AspNetCoreVersion70>
     </PropertyGroup>
 
     <PropertyGroup>
   <PrivateBuildTesting>$(PrivateBuildTesting)</PrivateBuildTesting>
   <InternalReleaseTesting>$(InternalReleaseTesting)</InternalReleaseTesting>
 
-  <RuntimeVersion31>$(RuntimeVersion31)</RuntimeVersion31>
-  <AspNetCoreVersion31>$(AspNetCoreVersion31)</AspNetCoreVersion31>
-
   <RuntimeVersion60>$(RuntimeVersion60)</RuntimeVersion60>
   <AspNetCoreVersion60>$(AspNetCoreVersion60)</AspNetCoreVersion60>
 
+  <RuntimeVersion70>$(RuntimeVersion70)</RuntimeVersion70>
+  <AspNetCoreVersion70>$(AspNetCoreVersion70)</AspNetCoreVersion70>
+
   <RuntimeVersionLatest>$(RuntimeVersionLatest)</RuntimeVersionLatest>
   <AspNetCoreVersionLatest>$(AspNetCoreVersionLatest)</AspNetCoreVersionLatest>
 
   <SingleFileRuntimeLatestVersion>$(SingleFileRuntimeLatestVersion)</SingleFileRuntimeLatestVersion>
   <SingleFileRuntime60Version>$(SingleFileRuntime60Version)</SingleFileRuntime60Version>
+  <SingleFileRuntime70Version>$(SingleFileRuntime70Version)</SingleFileRuntime70Version>
 </Configuration>
 ]]>
       </TestConfigFileLines>
index d04a1c3c24ba0bb9045bb8f49ef3c7b0d0cc861e..f50a49ffca458c8b30cb7729b925117110c3cd17 100644 (file)
     <!-- Latest symstore version updated by darc -->
     <MicrosoftSymbolStoreVersion>1.0.410601</MicrosoftSymbolStoreVersion>
     <!-- Latest shared runtime version updated by darc -->
-    <VSRedistCommonNetCoreSharedFrameworkx6470Version>7.0.2</VSRedistCommonNetCoreSharedFrameworkx6470Version>
-    <MicrosoftNETCoreAppRuntimewinx64Version>7.0.2</MicrosoftNETCoreAppRuntimewinx64Version>
+    <VSRedistCommonNetCoreSharedFrameworkx6480Version>8.0.0-alpha.1.23080.2</VSRedistCommonNetCoreSharedFrameworkx6480Version>
+    <MicrosoftNETCoreAppRuntimewinx64Version>8.0.0-alpha.1.23080.2</MicrosoftNETCoreAppRuntimewinx64Version>
     <!-- Latest shared aspnetcore version updated by darc -->
-    <MicrosoftAspNetCoreAppRefInternalVersion>7.0.2</MicrosoftAspNetCoreAppRefInternalVersion>
-    <MicrosoftAspNetCoreAppRefVersion>7.0.2</MicrosoftAspNetCoreAppRefVersion>
+    <MicrosoftAspNetCoreAppRefInternalVersion>8.0.0-alpha.1.23079.1</MicrosoftAspNetCoreAppRefInternalVersion>
+    <MicrosoftAspNetCoreAppRefVersion>8.0.0-alpha.1.23079.1</MicrosoftAspNetCoreAppRefVersion>
     <!-- dotnet/installer: Testing version of the SDK. Needed for the signed & entitled host. -->
-    <MicrosoftDotnetSdkInternalVersion>7.0.103-servicing.23073.22</MicrosoftDotnetSdkInternalVersion>
+    <MicrosoftDotnetSdkInternalVersion>8.0.100-alpha.1.23080.8</MicrosoftDotnetSdkInternalVersion>
   </PropertyGroup>
   <PropertyGroup>
     <!-- Runtime versions to test -->
-    <MicrosoftNETCoreApp60Version>6.0.8</MicrosoftNETCoreApp60Version>
+    <MicrosoftNETCoreApp60Version>6.0.12</MicrosoftNETCoreApp60Version>
     <MicrosoftAspNetCoreApp60Version>$(MicrosoftNETCoreApp60Version)</MicrosoftAspNetCoreApp60Version>
+    <MicrosoftNETCoreApp70Version>7.0.2</MicrosoftNETCoreApp70Version>
+    <MicrosoftAspNetCoreApp70Version>$(MicrosoftNETCoreApp70Version)</MicrosoftAspNetCoreApp70Version>
     <!-- The SDK runtime version used to build single-file apps (currently hardcoded) -->
-    <SingleFileRuntime60Version>6.0.8</SingleFileRuntime60Version>
-    <SingleFileRuntimeLatestVersion>7.0.2</SingleFileRuntimeLatestVersion>
+    <SingleFileRuntime60Version>$(MicrosoftNETCoreApp60Version)</SingleFileRuntime60Version>
+    <SingleFileRuntime70Version>$(MicrosoftNETCoreApp70Version)</SingleFileRuntime70Version>
+    <SingleFileRuntimeLatestVersion>8.0.0-alpha.1.23076.9</SingleFileRuntimeLatestVersion>
   </PropertyGroup>
   <PropertyGroup>
     <!-- Opt-in/out repo features -->
index 8e96bb6033f66e6c6a35be1f67feaa0e63508dd4..8a3db1b2ba8df1a646511b9312f5b94707352c0d 100644 (file)
@@ -1,18 +1,16 @@
 {
   "tools": {
-    "dotnet": "7.0.101",
+    "dotnet": "8.0.100-alpha.1.23063.11",
     "runtimes": {
-      "dotnet/x64": [
+      "dotnet": [
         "$(MicrosoftNETCoreApp60Version)",
-        "$(VSRedistCommonNetCoreSharedFrameworkx6470Version)"
+        "$(MicrosoftNETCoreApp70Version)",
+        "$(VSRedistCommonNetCoreSharedFrameworkx6480Version)"
       ],
       "dotnet/x86": [
         "$(MicrosoftNETCoreApp60Version)",
-        "$(VSRedistCommonNetCoreSharedFrameworkx6470Version)"
-      ],
-      "dotnet/arm64": [
-        "$(MicrosoftNETCoreApp60Version)",
-        "$(VSRedistCommonNetCoreSharedFrameworkx6470Version)"
+        "$(MicrosoftNETCoreApp70Version)",
+        "$(VSRedistCommonNetCoreSharedFrameworkx6480Version)"
       ]
     }
   },
index 071f6ad3444f96c940d6f718900d5443eb633c04..e5e4bd2251b5c3fabbd74cb53277f90206eff1a8 100644 (file)
@@ -670,7 +670,7 @@ namespace Microsoft.Diagnostics.TestHelpers
         }
 
         /// <summary>
-        /// The framework type/version used to build the debuggee like "netcoreapp3.1" or "netstandard2.0".
+        /// The framework type/version used to build the debuggee like "net6.0" or "net7.0"
         /// </summary>
         public string BuildProjectFramework
         {
index c29ae7de11b99a8e2b5ce99cacbb9ea10b3ac14a..bd1568c039711a0fac4de760e14518944e30fdeb 100644 (file)
@@ -24,6 +24,7 @@
   <TestWebApp3>true</TestWebApp3>
   <TestWebApp3 Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp3>
 
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
 
@@ -35,6 +36,7 @@
   <CliPath>$(DotNetRoot)/dotnet</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
       dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
     <!--
         Single file (debuggees cli built)
      -->
-    <Option Condition="'$(RuntimeVersionLatest)' != ''">
+    <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
       <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
       <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
       <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</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>$(TargetRid)</BuildProjectRuntime>
     </Option>
-    <Option Condition="'$(RuntimeVersion60)' != ''">
+    <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+      <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+      <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+      <BuildProjectFramework>net7.0</BuildProjectFramework>
+      <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+      <PublishSingleFile>true</PublishSingleFile>
+      <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+    </Option>
+    <Option Condition="'$(SingleFileRuntime60Version)' != ''">
       <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
       <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
       <BuildProjectFramework>net6.0</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
       <PublishSingleFile>true</PublishSingleFile>
-      <SetSymbolServer>-ms</SetSymbolServer>
       <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
     </Option>
     <!--
       <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
       <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
     </Option>
+    <Option Condition="'$(RuntimeVersion70)' != ''">
+      <BuildProjectFramework>net7.0</BuildProjectFramework>
+      <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+      <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
+    </Option>
     <Option Condition="'$(RuntimeVersion60)' != ''">
       <BuildProjectFramework>net6.0</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
       <DebuggeeBuildRoot>$(RootBinDir)/Debuggees</DebuggeeBuildRoot>
       <TestName>SOS.StackAndOtherTests</TestName>
       <Options>
-        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+        <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</RuntimeFrameworkVersion>
           <PublishSingleFile>true</PublishSingleFile>
-          <SetSymbolServer>-ms</SetSymbolServer>
           <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
         </Option>
-        <Option Condition="'$(RuntimeVersion60)' != ''">
+        <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+        </Option>
+        <Option Condition="'$(SingleFileRuntime60Version)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>net6.0</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
           <PublishSingleFile>true</PublishSingleFile>
-          <SetSymbolServer>-ms</SetSymbolServer>
           <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
         </Option>
         <Option Condition="'$(RuntimeVersionLatest)' != ''">
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(RuntimeVersion70)' != ''">
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+        </Option>
         <Option Condition="'$(RuntimeVersion60)' != ''">
           <BuildProjectFramework>net6.0</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(AspNetCoreVersion70)' != ''">
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+          <FrameworkVersion>$(AspNetCoreVersion70)</FrameworkVersion>
+        </Option>
         <Option Condition="'$(AspNetCoreVersion60)' != ''">
           <BuildProjectFramework>net6.0</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
index 49f7e681cc323a023b53bc77127cc527f53967e5..f4aaf0aaaa5e9f0527f9b1cdbef9eb31913ab79f 100644 (file)
@@ -30,9 +30,9 @@
   <TestDesktop Condition="'$(InternalReleaseTesting)' == 'true'">false</TestDesktop>
   <TestDesktop Condition="'$(TargetArchitecture)' == 'arm64'">false</TestDesktop>
 
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
-  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '5')">net5.0</BuildProjectFrameworkLatest>
 
   <DesktopFrameworkPath Condition="$(TargetArchitecture) == x64">$(WinDir)\Microsoft.Net\Framework64\v4.0.30319\</DesktopFrameworkPath>
   <DesktopFrameworkPath Condition="$(TargetArchitecture) != x64">$(WinDir)\Microsoft.Net\Framework\v4.0.30319\</DesktopFrameworkPath>
@@ -46,6 +46,7 @@
   <CliPath>$(DotNetRoot)\dotnet.exe</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
       dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
         <!--
             Single file (debuggees cli built)
          -->
-        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+        <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
           <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</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>$(TargetRid)</BuildProjectRuntime>
         </Option>
-        <Option Condition="'$(RuntimeVersion60)' != ''">
+        <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+          <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+          <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+        </Option>
+        <Option Condition="'$(SingleFileRuntime60Version)' != ''">
           <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>net6.0</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
           <PublishSingleFile>true</PublishSingleFile>
-          <SetSymbolServer>-ms</SetSymbolServer>
           <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
         </Option>
         <!--
           <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
           <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
         </Option>
+        <Option Condition="'$(RuntimeVersion70)' != ''">
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+          <SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
+        </Option>
         <Option Condition="'$(RuntimeVersion60)' != ''">
           <BuildProjectFramework>net6.0</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees</DebuggeeBuildRoot>
           <TestName>SOS.StackAndOtherTests</TestName>
           <Options>
-            <Option Condition="'$(RuntimeVersionLatest)' != ''">
+            <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
               <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</RuntimeFrameworkVersion>
               <PublishSingleFile>true</PublishSingleFile>
-              <SetSymbolServer>-ms</SetSymbolServer>
               <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
             </Option>
-            <Option Condition="'$(RuntimeVersion60)' != ''">
+            <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+              <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+              <BuildProjectFramework>net7.0</BuildProjectFramework>
+              <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+              <PublishSingleFile>true</PublishSingleFile>
+              <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+            </Option>
+            <Option Condition="'$(SingleFileRuntime60Version)' != ''">
               <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
               <BuildProjectFramework>net6.0</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
               <PublishSingleFile>true</PublishSingleFile>
-              <SetSymbolServer>-ms</SetSymbolServer>
               <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
             </Option>
             <Option Condition="'$(RuntimeVersionLatest)' != ''">
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
             </Option>
+            <Option Condition="'$(RuntimeVersion70)' != ''">
+              <BuildProjectFramework>net7.0</BuildProjectFramework>
+              <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+            </Option>
             <Option Condition="'$(RuntimeVersion60)' != ''">
               <BuildProjectFramework>net6.0</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
             </Option>
           </Options>
           <Options>
-            <Option Condition="'$(AspNetCoreVersionLatest)' != ''">
+            <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
               <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
               <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</RuntimeFrameworkVersion>
               <PublishSingleFile>true</PublishSingleFile>
-              <SetSymbolServer>-ms</SetSymbolServer>
               <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
             </Option> 
             <Option Condition="'$(AspNetCoreVersionLatest)' != ''">
               <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
             </Option>
+            <Option Condition="'$(AspNetCoreVersion70)' != ''">
+              <BuildProjectFramework>net7.0</BuildProjectFramework>
+              <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+              <FrameworkVersion>$(AspNetCoreVersion70)</FrameworkVersion>
+            </Option>
             <Option Condition="'$(AspNetCoreVersion60)' != ''">
               <BuildProjectFramework>net6.0</BuildProjectFramework>
               <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
index 4693d5da1ee353cdc1741e8a20380e91389e0141..3d06e95d2cdc5c30ffc632f520c6a04d7ffb7f88 100644 (file)
@@ -34,3 +34,4 @@ target_link_libraries(DesktopClrHost ${DESKTOPCLRHOST_LIBRARY})
 
 install(TARGETS DesktopClrHost DESTINATION ${CLR_MANAGED_BINARY_DIR}/WebApp3/${CLR_BUILD_TYPE}/net6.0)
 install(TARGETS DesktopClrHost DESTINATION ${CLR_MANAGED_BINARY_DIR}/WebApp3/${CLR_BUILD_TYPE}/net7.0)
+install(TARGETS DesktopClrHost DESTINATION ${CLR_MANAGED_BINARY_DIR}/WebApp3/${CLR_BUILD_TYPE}/net8.0)
index 9fa03e574beea2ea9836b8a05615e65cf91a3899..967ccc3005c6b8aaef6ed1bd730ebeb4ca73293a 100644 (file)
@@ -6,6 +6,6 @@
     <DebugType Condition="'$(TargetFramework)' == 'net462'">full</DebugType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Optimize>false</Optimize>
-    <BuildTargetFrameworks>net6.0;net7.0</BuildTargetFrameworks>
+    <BuildTargetFrameworks>net6.0;net7.0;net8.0</BuildTargetFrameworks>
   </PropertyGroup>
 </Project>
diff --git a/src/SOS/SOS.UnitTests/DumpGenerationFixture.cs b/src/SOS/SOS.UnitTests/DumpGenerationFixture.cs
new file mode 100644 (file)
index 0000000..9efdd48
--- /dev/null
@@ -0,0 +1,89 @@
+using Microsoft.Diagnostics.TestHelpers;
+using Microsoft.Win32;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using Xunit;
+
+public class DumpGenerationFixture : IDisposable
+{
+    private static readonly string _root = RuntimeInformation.ProcessArchitecture == Architecture.X86 ? @"SOFTWARE\WOW6432Node\" : @"SOFTWARE\";
+    private static readonly string _nodePath = _root + @"Microsoft\Windows NT\CurrentVersion\";
+    private static readonly string _auxiliaryNode = _nodePath + "MiniDumpAuxiliaryDlls";
+    private static readonly string _knownNode = _nodePath + "KnownManagedDebuggingDlls";
+
+    private HashSet<string> _paths;
+
+    public DumpGenerationFixture() 
+    {
+        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+        {
+            // Create a unique list of all the runtime paths used by the tests
+            HashSet<string> paths = new();
+            foreach (TestConfiguration config in TestRunConfiguration.Instance.Configurations)
+            {
+                if (config.IsNETCore && config.RuntimeFrameworkVersionMajor >= 8)
+                {
+                    string path = config.RuntimeSymbolsPath;
+                    if (!string.IsNullOrEmpty(path))
+                    {
+                        paths.Add(path);
+                    }
+                }
+            }
+
+            try
+            {
+                using RegistryKey auxiliaryKey = Registry.LocalMachine.CreateSubKey(_auxiliaryNode, writable: true);
+                using RegistryKey knownKey = Registry.LocalMachine.CreateSubKey(_knownNode, writable: true);
+
+                foreach (string path in paths)
+                {
+                    string dacPath = Path.Combine(path, "mscordaccore.dll");
+                    string runtimePath = Path.Combine(path, "coreclr.dll");
+                    knownKey.SetValue(dacPath, 0, RegistryValueKind.DWord);
+                    auxiliaryKey.SetValue(runtimePath, dacPath, RegistryValueKind.String);
+                }
+
+                // Save the paths after writing them successfully to registry
+                _paths = paths;
+            }
+            catch (Exception ex) when (ex is UnauthorizedAccessException)
+            {
+            }
+        }
+    }  
+
+    public void Dispose()
+    {
+        if (_paths is not null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+        {
+            try
+            {
+                IEnumerable<string> paths = _paths;
+                _paths = null;
+
+                using RegistryKey auxiliaryKey = Registry.LocalMachine.CreateSubKey(_auxiliaryNode, writable: true);
+                using RegistryKey knownKey = Registry.LocalMachine.CreateSubKey(_knownNode, writable: true);
+
+                foreach (string path in paths)
+                {
+                    string dacPath = Path.Combine(path, "mscordaccore.dll");
+                    string runtimePath = Path.Combine(path, "coreclr.dll");
+                    knownKey.DeleteValue(dacPath);
+                    auxiliaryKey.DeleteValue(runtimePath);
+                }
+            }
+            catch (Exception ex) when (ex is ArgumentException || ex is IOException || ex is UnauthorizedAccessException)
+            {
+            }
+        }
+    }
+}
+
+[CollectionDefinition("Windows Dump Generation")]
+public class DumpGenerationCollection : ICollectionFixture<DumpGenerationFixture>
+{
+}
index 92e59229d1c83cdbd958c0f2e1cd1e3c080fee01..64638124687fbfe85364f171142f715ddf5af946 100644 (file)
@@ -913,9 +913,21 @@ public class SOSRunner : IDisposable
                         commands.Add($"!SetClrPath {runtimeSymbolsPath}");
                     }
                 }
-                if (!isHostRuntimeNone && !string.IsNullOrEmpty(setSymbolServer))
+                if (!isHostRuntimeNone)
                 {
-                    commands.Add($"!SetSymbolServer {setSymbolServer}");
+                    // If single-file app, add the debuggee directory containing the PDBs and
+                    // 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.
+                    if (_config.PublishSingleFile)
+                    {
+                        string appRootDir = ReplaceVariables(_variables, "%DEBUG_ROOT%");
+                        commands.Add($"!SetSymbolServer -ms -directory {appRootDir}");
+                    }
+                    if (!string.IsNullOrEmpty(setSymbolServer))
+                    {
+                        commands.Add($"!SetSymbolServer {setSymbolServer}");
+                    }
                 }
                 break;
             case NativeDebugger.Lldb:
@@ -935,9 +947,21 @@ public class SOSRunner : IDisposable
                     }
                 }
 #endif
-                if (!isHostRuntimeNone && !string.IsNullOrEmpty(setSymbolServer))
+                if (!isHostRuntimeNone)
                 {
-                    commands.Add($"setsymbolserver {setSymbolServer}");
+                    // If single-file app, add the debuggee directory containing the PDBs and
+                    // 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.
+                    if (_config.PublishSingleFile)
+                    {
+                        string appRootDir = ReplaceVariables(_variables, "%DEBUG_ROOT%");
+                        commands.Add($"setsymbolserver -ms -directory {appRootDir}");
+                    }
+                    if (!string.IsNullOrEmpty(setSymbolServer))
+                    {
+                        commands.Add($"setsymbolserver {setSymbolServer}");
+                    }
                 }
                 SwitchToExceptionThread();
                 break;
@@ -1246,7 +1270,7 @@ public class SOSRunner : IDisposable
                     throw new Exception(poutTag + " can't be used when there is no previous command output");
                 }
                 int startRegexIndex = firstPOUT + poutTag.Length;
-                string poutRegex = input.Substring(startRegexIndex, secondPOUT - startRegexIndex);
+                string poutRegex = input[startRegexIndex..secondPOUT];
                 Match m = Regex.Match(_lastCommandOutput, ReplaceVariables(poutRegex), RegexOptions.Multiline);
                 if (!m.Success)
                 {
@@ -1266,11 +1290,20 @@ public class SOSRunner : IDisposable
         {
             command = ProcessCommand(command);
         }
+        if (Debugger == NativeDebugger.Lldb)
+        {
+            // Back quotes need to be escaped so lldb passes them through
+            command = command.Replace("`", "'`");
+        }
         _processRunner.StandardInputWriteLine(command);
 
         ScriptLogger.CommandResult result = await _scriptLogger.WaitForCommandOutput();
         _lastCommandOutput = result.CommandOutput;
-
+        if (Debugger == NativeDebugger.Cdb)
+        {
+            // Remove the cdb prompt because it interferes with script's regex's
+            _lastCommandOutput = _lastCommandOutput?.Replace("0:000>", string.Empty);
+        }
         return result.CommandSucceeded;
     }
 
index cc08b813e1ac42a638b2ad6a973a0b82cbdf4252..a5f22338b1f922b78f1e1c8ed794818d03bd6872 100644 (file)
@@ -4,20 +4,18 @@
 # 3) Take a dump of the executable before it exits
 # 4) Open the dump, find concurrent dictionaries and compare the output
 
-!IFDEF:CDB
-!IFDEF:LLDB
 IFDEF:NETCORE_OR_DOTNETDUMP
 
 # Load SOS even though it doesn't actually load the sos module on dotnet-dump but it runs some initial settings/commands.
 LOADSOS
 
-COMMAND: dcd
+EXTCOMMAND: dcd
 VERIFY: Missing ConcurrentDictionary address
 
-COMMAND: dcd abcdefgh
+EXTCOMMAND: dcd abcdefgh
 VERIFY: Hexadecimal address expected
 
-COMMAND: dcd 0000000000000001
+EXTCOMMAND: dcd 0000000000000001
 VERIFY: is not referencing an object
 
 # Checks on ConcurrentDictionary<int, string[]>
@@ -28,45 +26,45 @@ ENDIF:DESKTOP
 !IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.Int32, System.Private.CoreLib\],\[System.String\[\], System.Private.CoreLib\]\]<POUT>
 ENDIF:DESKTOP
-COMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
+EXTCOMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
 VERIFY: 2 items
 VERIFY: Key: 2
-COMMAND: dumparray <POUT>Key: 1\s+Value: dumparray (<HEXVAL>)<POUT>
+EXTCOMMAND: dumparray <POUT>Key: 1\s+Value: dumparray (<HEXVAL>)<POUT>
 VERIFY: Name:\s+System.String\[\]
 VERIFY: Number of elements 4
 
 # Checks on ConcurrentDictionary<int, int>
-SOSCOMMAND: dumpheap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
+SOSCOMMAND: DumpHeap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
 IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.Int32, mscorlib\],\[System.Int32, mscorlib\]\]<POUT>
 ENDIF:DESKTOP
 !IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.Int32, System.Private.CoreLib\],\[System.Int32, System.Private.CoreLib\]\]<POUT>
 ENDIF:DESKTOP
-COMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
+EXTCOMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
 VERIFY: 3 items
 VERIFY: Key: 0\s+Value: 1
 VERIFY: Key: 31\s+Value: 17
 VERIFY: Key: 1521482\s+Value: 512487
 
 # Checks on ConcurrentDictionary<string, bool>
-SOSCOMMAND: dumpheap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
+SOSCOMMAND: DumpHeap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
 IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.String, mscorlib\],\[System.Boolean, mscorlib\]\]<POUT>
 ENDIF:DESKTOP
 !IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.String, System.Private.CoreLib\],\[System.Boolean, System.Private.CoreLib\]\]<POUT>
 ENDIF:DESKTOP
-COMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
+EXTCOMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
 VERIFY: 3 items
 VERIFY: Key: "String true"\s+Value: True
 VERIFY: Key: "String false"\s+Value: False
 VERIFY: Key: "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\.\.\.\s+Value: False
 
 # Checks on ConcurrentDictionary<DumpSampleStruct, DumpSampleClass>
-SOSCOMMAND: dumpheap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
+SOSCOMMAND: DumpHeap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[DotnetDumpCommands\.Program\+DumpSampleStruct, DotnetDumpCommands\],\[DotnetDumpCommands\.Program\+DumpSampleClass, DotnetDumpCommands\]\]<POUT>
-COMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
+EXTCOMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
 VERIFY: 2 items
 VERIFY: Key: dumpvc <HEXVAL> <HEXVAL>\s+Value: null
 VERIFY: Key: dumpvc <HEXVAL> <HEXVAL>\s+Value: dumpobj <HEXVAL>
@@ -81,14 +79,14 @@ VERIFY: instance\s+00000000\s+\<Value2\>
 ENDIF:32BIT
 
 # Checks on ConcurrentDictionary<int, DumpSampleStruct>
-SOSCOMMAND: dumpheap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
+SOSCOMMAND: DumpHeap -stat -type System.Collections.Concurrent.ConcurrentDictionary`2[[
 IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.Int32, mscorlib\],\[DotnetDumpCommands\.Program\+DumpSampleStruct, DotnetDumpCommands\]\]<POUT>
 ENDIF:DESKTOP
 !IFDEF:DESKTOP
 SOSCOMMAND: DumpHeap -mt <POUT>^(<HEXVAL>) .*System.Collections.Concurrent.ConcurrentDictionary`2\[\[System.Int32, System.Private.CoreLib\],\[DotnetDumpCommands\.Program\+DumpSampleStruct, DotnetDumpCommands\]\]<POUT>
 ENDIF:DESKTOP
-COMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
+EXTCOMMAND: dcd <POUT>^(<HEXVAL>)\s+<HEXVAL>\s+\d+<POUT>
 VERIFY: 1 items
 VERIFY: Key: 0\s+Value: dumpvc <HEXVAL> <HEXVAL>
 SOSCOMMAND: dumpvc <POUT>dumpvc (<HEXVAL> <HEXVAL>)<POUT>
@@ -96,6 +94,5 @@ VERIFY: Name:\s+DotnetDumpCommands\.Program\+DumpSampleStruct
 VERIFY: instance\s+12\s+IntValue
 VERIFY: instance\s+<HEXVAL>\s+StringValue
 VERIFY: instance\s+<HEXVAL>\s+Date
-ENDIF:NETCORE_OR_DOTNETDUMP
-ENDIF:LLDB
-ENDIF:CDB
\ No newline at end of file
+
+ENDIF:NETCORE_OR_DOTNETDUMP
\ No newline at end of file
index 23b894e450b6d6d18c3bd9bb889133205510ced4..8dde6335bdf081a97d905a72a2152ea77129a766 100644 (file)
@@ -1,64 +1,62 @@
-# Concurrent dictionaries dump command
+# Test the dumpgen command
 # 1) Load the executable
 # 2) Run the executable
 # 3) Take a dump of the executable before it exits
 # 4) Open the dump, find objects in different generations and compare the output
 
-!IFDEF:CDB
-!IFDEF:LLDB
 IFDEF:NETCORE_OR_DOTNETDUMP
 
 # Load SOS even though it doesn't actually load the sos module on dotnet-dump but it runs some initial settings/commands.
 LOADSOS
 
-COMMAND: dumpgen
+EXTCOMMAND: dumpgen
 VERIFY: Generation argument is missing
 
-COMMAND: dumpgen invalid
+EXTCOMMAND: dumpgen invalid
 VERIFY: invalid is not a supported generation
 
-COMMAND: dumpgen gen0 -mt
+!IFDEF:LLDB
+EXTCOMMAND: dumpgen gen0 -mt
 VERIFY: Required argument missing for option: -mt
 
-COMMAND: dumpgen gen1 -mt zzzzz
+EXTCOMMAND: dumpgen gen1 -mt zzzzz
 VERIFY: Hexadecimal address expected for -mt option
+ENDIF:LLDB
 
-COMMAND: dumpgen gen0
+EXTCOMMAND: dumpgen gen0
 VERIFY: ^\s+MT\s+Count\s+TotalSize\s+Class Name
 VERIFY: ^<HEXVAL>\s+10\s+<DECVAL>\s+DotnetDumpCommands\.Program\+DumpSampleClass
 
-COMMAND: dumpgen gen0 -type DotnetDumpCommands
+EXTCOMMAND: dumpgen gen0 -type DotnetDumpCommands
 VERIFY: ^<HEXVAL>\s+10\s+<DECVAL>\s+DotnetDumpCommands\.Program\+DumpSampleClass
 VERIFY: Total 10 objects
 
-COMMAND: dumpgen gen0 -mt <POUT>^(<HEXVAL>)<POUT>
+EXTCOMMAND: dumpgen gen0 -mt <POUT>^(<HEXVAL>)<POUT>
 VERIFY: ^\s+Address\s+MT\s+Size
 VERIFY: Total 10 objects
 VERIFY: (<HEXVAL>\s+<HEXVAL>\s+<DECVAL>){10}
 
-COMMAND: dumpgen gen0 -mt 00000001
+EXTCOMMAND: dumpgen gen0 -mt 00000001
 VERIFY: Total 0 objects
 
-COMMAND: dumpgen gen0 -type NoMatchingType
+EXTCOMMAND: dumpgen gen0 -type NoMatchingType
 VERIFY: Total 0 objects
 
-COMMAND: dumpgen gen1
+EXTCOMMAND: dumpgen gen1
 VERIFY: ^<HEXVAL>\s+3\s+<DECVAL>\s+DotnetDumpCommands\.Program\+DumpSampleClass
 
-COMMAND: dumpgen gen2
+EXTCOMMAND: dumpgen gen2
 VERIFY: ^<HEXVAL>\s+5\s+<DECVAL>\s+DotnetDumpCommands\.Program\+DumpSampleClass
 !VERIFY: ^<HEXVAL>\s+1\s+100<DECVAL>\s+System.Byte\[\]
 
-COMMAND: dumpgen loh
+EXTCOMMAND: dumpgen loh
 VERIFY: ^<HEXVAL>\s+1\s+<DECVAL>\s+DotnetDumpCommands\.Program\+DumpSampleClass\[\]
 
 IFDEF:MAJOR_RUNTIME_VERSION_GE_5
-COMMAND: dumpgen poh
+EXTCOMMAND: dumpgen poh
 VERIFY: ^<HEXVAL>\s+1\s+100<DECVAL>\s+System.Byte\[\]
 ENDIF:MAJOR_RUNTIME_VERSION_GE_5
 
 SOSCOMMAND: dumpheap -stat
 
-ENDIF:NETCORE_OR_DOTNETDUMP
-ENDIF:LLDB
-ENDIF:CDB
\ No newline at end of file
+ENDIF:NETCORE_OR_DOTNETDUMP
\ No newline at end of file
index 0b0ef66ef5d780e5de115c380e1b7e73b1f394d8..8cb99a9cff40e8b382f2406659aabdfecfd667be 100644 (file)
@@ -121,6 +121,12 @@ VERIFY:\s*Name:\s+SymbolTestApp.Program\s+
 VERIFY:\s*File:\s+.*SymbolTestApp\.(dll|exe)\s+
 ENDIF:MAJOR_RUNTIME_VERSION_GE_7
 
+IFDEF:MAJOR_RUNTIME_VERSION_GE_8
+SOSCOMMAND:DumpMT <POUT>\s*Method Table:\s+(<HEXVAL>)\s+<POUT>
+VERIFY:\s*Name:\s+SymbolTestApp.Program\s+
+VERIFY:\s*File:\s+.*SymbolTestApp\.(dll|exe)\s+
+ENDIF:MAJOR_RUNTIME_VERSION_GE_8
+
 SOSCOMMAND:FinalizeQueue
 VERIFY:\s*SyncBlocks to be cleaned up:\s+<DECVAL>\s+
 VERIFY:(\s*Free-Threaded Interfaces to be released:\s+<DECVAL>\s+)?
index 22f50ed23d79b1cd0486817f2bff5bc24839ea4d..986b50d29e0fa174b39b0dd75897e21b6126a0d0 100644 (file)
@@ -1379,10 +1379,11 @@ BOOL CardIsSet(const GCHeapDetails &heap, TADDR objAddr)
         }
 
         size_t card = (objAddr - card_table_lowest_addr) / card_size;
+        TADDR card_addr = card_table + (card_word(card) * sizeof(DWORD));
         DWORD value;
-        if (MOVE(value, card_table + card_word(card)*sizeof(DWORD)) != S_OK)
+        if (MOVE(value, card_addr) != S_OK)
         {
-            ExtErr("Error reading card bits\n");
+            ExtErr("Error reading card bits - obj %p card %08x card_addr %p card_table %p\n", objAddr, card, card_addr, card_table);
             return FALSE;
         }
 
index 4040947155178e5bf7b546b83ebaff279414fe44..781a76ece9fdf5abdb819830bfb5884ce7cc7db1 100644 (file)
@@ -803,9 +803,10 @@ namespace sos
         // there are no SyncBlocks in the process.
         DacpSyncBlockData syncBlockData;
         if (SUCCEEDED(syncBlockData.Request(g_sos, 1)))
+        {
             mTotal = syncBlockData.SyncBlockCount;
-
-        mSyncBlk = mCurr;
+            mSyncBlk = mCurr;
+        }
     }
 
     GCHeap::GCHeap()
index 0b97c1559fb751bad1814937c428870ef8eefd3b..9725b2e9b4f4daebc4f16809ff4fdf297aae0dfa 100644 (file)
@@ -8626,7 +8626,7 @@ DECLARE_API(ThreadPool)
         ExtOut ("\n");
     }
 
-    return Status;
+    return S_OK;
 }
 
 DECLARE_API(FindAppDomain)
index ffdadb0b611a3a8174c12a12405b51ccac682a7d..61f797e5b81b5892e117e857b0172ea8116615db 100644 (file)
@@ -802,9 +802,10 @@ LLDBServices::ReadVirtual(
     }
 
     // As it turns out the lldb ReadMemory API doesn't do partial reads and the SOS
-    // caching depends on that behavior. Round up to the next page boundry and attempt
-    // to read up to the page boundries.
-    nextPageStart = (offset + PAGE_SIZE - 1) & PAGE_MASK;
+    // caching depends on that behavior. Round up to the next page boundary and attempt
+    // to read up to the page boundaries.
+    nextPageStart = (offset + PAGE_SIZE) & PAGE_MASK;
+    bytesRead = 0;
 
     while (bufferSize > 0)
     {
index 2bb1ac9fee8dba9f37a216684aab07b4eb5d9dfc..a557ad10f53ab1dae658a94f8ad79b0c571b3068 100644 (file)
@@ -8,9 +8,9 @@
   <LogDir>$(RootBinDir)/TestResults/$(TargetConfiguration)/common.unittests_$(Timestamp)</LogDir>
  
   <!-- Build the debuggee for this framework version but run it on latest -->
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
-  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '5')">net5.0</BuildProjectFrameworkLatest>
 
   <TestProduct>ProjectK</TestProduct>
   <DebuggeeSourceRoot>$(RepoRootDir)/src/tests</DebuggeeSourceRoot>
@@ -22,6 +22,8 @@
   <CliPath>$(DotNetRoot)/dotnet</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
+      dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
       dotnet-public=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json
       <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
     </Option>
+    <Option Condition="'$(RuntimeVersion70)' != ''">
+      <BuildProjectFramework>net7.0</BuildProjectFramework>
+      <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+    </Option>
     <Option Condition="'$(RuntimeVersion60)' != ''">
       <BuildProjectFramework>net6.0</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
index 704c426a2cc9f84467ac34592e9efc58fb7e10b9..d174a96eef5e3be18d6014af1317a234e1685d6f 100644 (file)
@@ -9,9 +9,9 @@
   <LogDir>$(RootBinDir)\TestResults\$(TargetConfiguration)\common.unittests_$(Timestamp)</LogDir>
 
   <!-- Build the debuggee for this framework version but run it on latest -->
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
-  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '5')">net5.0</BuildProjectFrameworkLatest>
 
   <TestProduct>ProjectK</TestProduct>
   <DebuggeeSourceRoot>$(RepoRootDir)\src\tests</DebuggeeSourceRoot>
@@ -21,6 +21,8 @@
   <CliPath>$(DotNetRoot)\dotnet.exe</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
+      dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
       dotnet-public=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json
       <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
     </Option>
+    <Option Condition="'$(RuntimeVersion70)' != ''">
+      <BuildProjectFramework>net7.0</BuildProjectFramework>
+      <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+    </Option>
     <Option Condition="'$(RuntimeVersion60)' != ''">
       <BuildProjectFramework>net6.0</BuildProjectFramework>
       <RuntimeFrameworkVersion>$(RuntimeVersion60)</RuntimeFrameworkVersion>
index 0fac8d369804f2f4ded59e78b1b750de6620adaf..bc520c2583f3e1b5fa56ba7a335f543c9f12ada8 100644 (file)
@@ -7,6 +7,7 @@
   <InstallDir>$(RootBinDir)/bin/$(OS).$(TargetArchitecture).$(TargetConfiguration)</InstallDir>
   <LogDir>$(RootBinDir)/TestResults/$(TargetConfiguration)/dbgshim.unittests_$(Timestamp)</LogDir>
  
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
 
@@ -20,6 +21,7 @@
   <CliPath>$(DotNetRoot)/dotnet</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
       dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
         <!--
             Single file
          -->
-        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+        <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <PublishSingleFile>true</PublishSingleFile>
           <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
           <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+        </Option>
+        <Option Condition="'$(SingleFileRuntime60Version)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net6.0</BuildProjectFramework>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
+        </Option>
         <!--
             Default
          -->
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(RuntimeVersion70)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)/Debuggees</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+        </Option>
         <Option Condition="'$(RuntimeVersion60)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)/Debuggees</DebuggeeBuildRoot>
           <BuildProjectFramework>net6.0</BuildProjectFramework>
index 53d6d646f05799a8000fd4b4a1906bf292d44537..ea93a2ad15a276770ac23c775477a07fbb32d72f 100644 (file)
@@ -8,6 +8,7 @@
   <InstallDir>$(RootBinDir)\bin\Windows_NT.$(TargetArchitecture).$(TargetConfiguration)</InstallDir>
   <LogDir>$(RootBinDir)\TestResults\$(TargetConfiguration)\dbgshim.unittests_$(Timestamp)</LogDir>
 
+  <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '8')">net8.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '7')">net7.0</BuildProjectFrameworkLatest>
   <BuildProjectFrameworkLatest Condition="StartsWith('$(RuntimeVersionLatest)', '6')">net6.0</BuildProjectFrameworkLatest>
 
@@ -20,6 +21,7 @@
   <CliPath>$(DotNetRoot)\dotnet.exe</CliPath>
 
   <NuGetPackageFeeds>
+      dotnet8=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json;
       dotnet7=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet7/nuget/v3/index.json;
       dotnet6=https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json;
       dotnet-core=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
         <!--
             Single file
          -->
-        <Option Condition="'$(RuntimeVersionLatest)' != ''">
+        <Option Condition="'$(SingleFileRuntimeLatestVersion)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <PublishSingleFile>true</PublishSingleFile>
           <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
           <RuntimeFrameworkVersion>$(SingleFileRuntimeLatestVersion)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(SingleFileRuntime70Version)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime70Version)</RuntimeFrameworkVersion>
+        </Option>
+        <Option Condition="'$(SingleFileRuntime60Version)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+          <BuildProjectFramework>net6.0</BuildProjectFramework>
+          <PublishSingleFile>true</PublishSingleFile>
+          <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+          <RuntimeFrameworkVersion>$(SingleFileRuntime60Version)</RuntimeFrameworkVersion>
+        </Option>
         <!--
             Default
           -->
           <BuildProjectFramework>$(BuildProjectFrameworkLatest)</BuildProjectFramework>
           <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
         </Option>
+        <Option Condition="'$(RuntimeVersion70)' != ''">
+          <DebuggeeBuildRoot>$(RootBinDir)\Debuggees</DebuggeeBuildRoot>
+          <BuildProjectFramework>net7.0</BuildProjectFramework>
+          <RuntimeFrameworkVersion>$(RuntimeVersion70)</RuntimeFrameworkVersion>
+        </Option>
         <Option Condition="'$(RuntimeVersion60)' != ''">
           <DebuggeeBuildRoot>$(RootBinDir)\Debuggees</DebuggeeBuildRoot>
           <BuildProjectFramework>net6.0</BuildProjectFramework>
index fad4801e1797fc844ca735d430697160b3a3f342..b94bb2b3cd6a32420b84ae4a8466550c9ad97e2f 100644 (file)
@@ -2,7 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
-    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0</TargetFrameworks>
+    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>
index 752c803ea747714e439c45add10a773cffb6bb44..18d256072a269b8d9ad7e0365146231c230c2ec1 100644 (file)
@@ -9,6 +9,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO.Pipes;
 using System.Linq;
+using System.Threading;
 
 namespace EventPipeTracee
 {
@@ -76,7 +77,7 @@ namespace EventPipeTracee
                 while (DateTime.UtcNow < targetDateTime)
                 {
                     acc++;
-                    if (acc % 1_000_000 == 0)
+                    if (acc % 10_000_000 == 0)
                     {
                         Console.WriteLine($"{pid} Spin waiting...");
                     }
index 05388fd5f4c717b34f2374205e88f7c13d445f74..b75c5bb4b47bc140a09eb9a7fe7cc6a1d7ab7bc1 100644 (file)
@@ -2,6 +2,6 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
-    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0</TargetFrameworks>
+    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
 </Project>
index d61819b2bcb9089ee9593095433ecf62b061da5a..ee7b056ba5a46db4ce19167e685ef85d6a33e447 100644 (file)
@@ -77,7 +77,7 @@ namespace Microsoft.Diagnostics.NETCore.Client
                 {
                     processInfoBeforeResume = await clientShim.GetProcessInfo();
                     ValidateProcessInfo(runner.Pid, processInfoBeforeResume);
-                    Assert.True(string.IsNullOrEmpty(processInfoBeforeResume.ManagedEntrypointAssemblyName));
+                    Assert.True((config.RuntimeFrameworkVersionMajor < 8) == string.IsNullOrEmpty(processInfoBeforeResume.ManagedEntrypointAssemblyName));
 
                     await clientShim.ResumeRuntime();
 
index 05388fd5f4c717b34f2374205e88f7c13d445f74..b75c5bb4b47bc140a09eb9a7fe7cc6a1d7ab7bc1 100644 (file)
@@ -2,6 +2,6 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
-    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0</TargetFrameworks>
+    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
 </Project>
index 05388fd5f4c717b34f2374205e88f7c13d445f74..b75c5bb4b47bc140a09eb9a7fe7cc6a1d7ab7bc1 100644 (file)
@@ -2,6 +2,6 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
-    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0</TargetFrameworks>
+    <TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">net6.0;net7.0;net8.0</TargetFrameworks>
   </PropertyGroup>
 </Project>