Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions debuggees.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDumpCommands", "src\S
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicMethod", "src\SOS\SOS.UnitTests\Debuggees\DynamicMethod\DynamicMethod.csproj", "{2F9AA5A9-D42A-42C6-B483-1B9284C62F91}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SOS.UnitTests", "SOS.UnitTests", "{CC1781EF-A87B-E78E-5BE6-88998E9D9058}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debuggees", "Debuggees", "{D25F6D55-E7B6-4231-F185-513E693BEEA2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpGCData", "src\SOS\SOS.UnitTests\Debuggees\DumpGCData\DumpGCData.csproj", "{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FindRootsOlderGeneration", "src\SOS\SOS.UnitTests\Debuggees\FindRootsOlderGeneration\FindRootsOlderGeneration.csproj", "{009B81D5-D5DE-406C-B191-542AA4C70995}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Checked|Any CPU = Checked|Any CPU
Expand Down Expand Up @@ -705,6 +713,86 @@ Global
{2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
{2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU
{2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x86.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|Any CPU.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|ARM.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|ARM.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|ARM64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|ARM64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|x64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|x64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|x86.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Checked|x86.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|ARM.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|ARM.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|ARM64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|x64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|x64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|x86.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Debug|x86.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|Any CPU.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|ARM.ActiveCfg = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|ARM.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|ARM64.ActiveCfg = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|ARM64.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|x64.ActiveCfg = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|x64.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|x86.ActiveCfg = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.Release|x86.Build.0 = Release|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|ARM.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|ARM.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|ARM64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|ARM64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|Any CPU.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|ARM.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|ARM.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|ARM64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|ARM64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|x64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|x64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|x86.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Checked|x86.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|Any CPU.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|ARM.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|ARM.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|ARM64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|x64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|x64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|x86.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Debug|x86.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|Any CPU.ActiveCfg = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|Any CPU.Build.0 = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|ARM.ActiveCfg = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|ARM.Build.0 = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|ARM64.ActiveCfg = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|ARM64.Build.0 = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|x64.ActiveCfg = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|x64.Build.0 = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|x86.ActiveCfg = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.Release|x86.Build.0 = Release|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|Any CPU.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|Any CPU.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|ARM.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|ARM.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|ARM64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|ARM64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|x64.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|x64.Build.0 = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
{009B81D5-D5DE-406C-B191-542AA4C70995}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -728,6 +816,10 @@ Global
{0A34CA51-8B8C-41A1-BE24-AB2C574EA144} = {C3072949-6D24-451B-A308-2F3621F858B0}
{F9A69812-DC52-428D-9DB1-8B831A8FF776} = {C3072949-6D24-451B-A308-2F3621F858B0}
{2F9AA5A9-D42A-42C6-B483-1B9284C62F91} = {C3072949-6D24-451B-A308-2F3621F858B0}
{CC1781EF-A87B-E78E-5BE6-88998E9D9058} = {41638A4C-0DAF-47ED-A774-ECBBAC0315D7}
{D25F6D55-E7B6-4231-F185-513E693BEEA2} = {CC1781EF-A87B-E78E-5BE6-88998E9D9058}
{06CFD7F3-72D9-4DEB-AC5E-193CE92A7880} = {D25F6D55-E7B6-4231-F185-513E693BEEA2}
{009B81D5-D5DE-406C-B191-542AA4C70995} = {D25F6D55-E7B6-4231-F185-513E693BEEA2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46465737-C938-44FC-BE1A-4CE139EBB5E0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class RootCacheService

public bool IsDependentHandleLink(ulong source, ulong target)
{
InitializeHandleRoots();

int i = _dependentHandles.BinarySearch((source, target));
Comment on lines +43 to 45
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this bug while working on the tests. In some cases, this is not initialized before referencing.

return i >= 0;
}
Expand Down
39 changes: 39 additions & 0 deletions src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,45 @@
</Option>
</Options>
</Option>

<!--
GC Related Tests
-->
<Option>
<TestName>GC</TestName>

<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkLatest)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>

<Options>
<Option><GCServer>1</GCServer></Option>
<Option><GCServer>0</GCServer></Option>
</Options>

<Options>
<Option Condition="'$(RuntimeVersionLatest)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkLatest)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing1)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing1)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing2)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing2)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing3)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing3)</BuildProjectFramework>
</Option>
</Options>
</Option>

</Options>

<FrameworkVersion Condition="'$(FrameworkVersion)' == ''">$(RuntimeFrameworkVersion)</FrameworkVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,45 @@
</Option>
</Options>
</Option>

<!--
GC Related Tests
-->
<Option>
<TestName>GC</TestName>

<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkLatest)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>

<Options>
<Option><GCServer>1</GCServer></Option>
<Option><GCServer>0</GCServer></Option>
</Options>

<Options>
<Option Condition="'$(RuntimeVersionLatest)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkLatest)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing1)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing1)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing2)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing2)</BuildProjectFramework>
<SetHostRuntime>$(DotNetRoot)/shared/Microsoft.NETCore.App/$(RuntimeFrameworkVersion)</SetHostRuntime>
</Option>
<Option Condition="'$(RuntimeVersionServicing3)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
<BuildProjectFramework>$(TargetFrameworkServicing3)</BuildProjectFramework>
</Option>
</Options>
</Option>

</Options>

<FrameworkVersion Condition="'$(FrameworkVersion)' == ''">$(RuntimeFrameworkVersion)</FrameworkVersion>
Expand All @@ -254,6 +293,7 @@
<HostExe Condition="'$(SetHostExe)' == 'true'">$(DotNetRoot)\dotnet.exe</HostExe>
<HostArgs Condition="'$(SetFxVersion)' == 'true'">--fx-version $(FrameworkVersion)</HostArgs>
</Option>

<!--
Desktop Runtime (debuggees cli built)
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
<TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">$(SupportedSubProcessTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
</Project>
23 changes: 23 additions & 0 deletions src/SOS/SOS.UnitTests/Debuggees/DumpGCData/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace DumpGCData;

internal class Program
{
private static void Main()
{
Debugger.Break();

byte[] data = new byte[1024 * 1024];

GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
GC.Collect();
Debugger.Break();
Console.WriteLine(handle.ToString());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework Condition="'$(BuildProjectFramework)' != ''">$(BuildProjectFramework)</TargetFramework>
<TargetFrameworks Condition="'$(BuildProjectFramework)' == ''">$(SupportedSubProcessTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.InteropServices;

namespace FindRootsOlderGeneration;

internal class Program
{
private static void Main()
{
Debugger.Break();

// Allocate a large object to ensure it goes on the LOH
Thing[] data = new Thing[1024 * 1024 * 3];
int dataGen = GC.GetGeneration(data);
data[0] = new Thing() { Name = "First" };
int thingGen = GC.GetGeneration(data[0]);

Console.WriteLine("Enable CLRN notifications: SXE CLRN");
Debugger.Break();

Console.WriteLine("Forcing GC...");
GC.Collect(0, GCCollectionMode.Forced, true);
GC.Collect(0, GCCollectionMode.Forced, true);
Console.WriteLine("GC complete.");
Console.WriteLine("Disable CLRN notifications: SXN CLRN");
Debugger.Break();

Console.WriteLine(data[0].Name);
Console.WriteLine($"Array Gen: {dataGen}, Thing Gen: {thingGen}");
}
}

internal class Thing
{
public string Name { get; set; }
}
33 changes: 31 additions & 2 deletions src/SOS/SOS.UnitTests/SOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,36 @@ public SOS(ITestOutputHelper output)

public static IEnumerable<object[]> Configurations => SOSTestHelpers.GetConfigurations("TestName", value: null);

[SkippableTheory, MemberData(nameof(Configurations)), Trait("Category", "CDACCompatible")]
[SkippableTheory, MemberData(nameof(SOSTestHelpers.GetConfigurations), "TestName", "GC", MemberType = typeof(SOSTestHelpers))]
public async Task FindRootsOlderGeneration(TestConfiguration config)
{
if (OS.Kind != OSKind.Windows)
{
throw new SkipTestException("Test only supports CDB and therefore only runs on Windows");
}

await SOSTestHelpers.RunTest(
config,
debuggeeName: "FindRootsOlderGeneration",
scriptName: "FindRootsOlderGeneration.script",
Output,
testName: "SOS.FindRootsOlderGeneration",
testDump: false);
}

[SkippableTheory, MemberData(nameof(SOSTestHelpers.GetConfigurations), "TestName", "GC", MemberType = typeof(SOSTestHelpers))]
public async Task DumpGCData(TestConfiguration config)
{
await SOSTestHelpers.RunTest(
config,
debuggeeName: "DumpGCData",
scriptName: "DumpGCData.script",
Output,
testName: "SOS.DumpGCData",
testDump: false);
}

[SkippableTheory, MemberData(nameof(Configurations))]
public async Task StackTraceSoftwareExceptionFrame(TestConfiguration config)
{
if (config.RuntimeFrameworkVersionMajor < 10)
Expand All @@ -219,7 +248,7 @@ await SOSTestHelpers.RunTest(
testTriage: true);
}

[SkippableTheory, MemberData(nameof(Configurations)), Trait("Category", "CDACCompatible")]
[SkippableTheory, MemberData(nameof(Configurations))]
public async Task StackTraceFaultingExceptionFrame(TestConfiguration config)
{
SOSTestHelpers.SkipIfWinX86(config);
Expand Down
6 changes: 6 additions & 0 deletions src/SOS/SOS.UnitTests/SOSRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,12 @@ public static async Task<SOSRunner> StartDebugger(TestInformation information, D
processRunner.WithEnvironmentVariable("DOTNET_DIAGNOSTIC_EXTENSIONS", extensions);
}

string gcServerMode = config.GetValue("GCServer");
if (!string.IsNullOrEmpty(gcServerMode))
{
processRunner.WithEnvironmentVariable("DOTNET_gcServer", gcServerMode);
}

DumpType? dumpType = null;
if (action is DebuggerAction.LoadDump or DebuggerAction.LoadDumpWithDotNetDump)
{
Expand Down
21 changes: 21 additions & 0 deletions src/SOS/SOS.UnitTests/Scripts/DumpGCData.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Verifies DumpGCData command
#

# Continue to the DebugBreak
CONTINUE
IFDEF:CDB
VERIFY:Break instruction exception - code 80000003
ENDIF:CDB

LOADSOS

# At start of main, there should be no pinned objects
SOSCOMMAND:DumpGCData
VERIFY: pre and post pin: 0

CONTINUE

# At second break, there should be a single pinned object
SOSCOMMAND:DumpGCData
VERIFY: pre and post pin: 1
Loading
Loading