From 416635ecd2f3d2287921031a2f5ae5526c31176a Mon Sep 17 00:00:00 2001 From: rcj1 Date: Tue, 31 Mar 2026 16:40:33 -0700 Subject: [PATCH 01/10] adding symbols and using heap dumps --- .../DumpTests/AsyncContinuationDumpTests.cs | 2 +- .../cdac/tests/DumpTests/CCWDumpTests.cs | 2 +- .../cdac/tests/DumpTests/ClrMdDumpHost.cs | 21 ++++++- .../tests/DumpTests/ComWrappersDumpTests.cs | 2 +- .../AsyncContinuation.csproj | 3 +- .../tests/DumpTests/Debuggees/CCW/CCW.csproj | 2 +- .../Debuggees/ComWrappers/ComWrappers.csproj | 2 +- .../ExceptionHandlingInfo.csproj | 2 +- .../LocalVariables/LocalVariables.csproj | 2 +- .../Debuggees/MultiModule/MultiModule.csproj | 2 +- .../tests/DumpTests/Debuggees/RCW/RCW.csproj | 2 +- .../RCWCleanupList/RCWCleanupList.csproj | 2 +- .../Debuggees/StackWalk/StackWalk.csproj | 2 +- .../Debuggees/SyncBlock/SyncBlock.csproj | 2 +- .../cdac/tests/DumpTests/DumpTestBase.cs | 62 ++++++++++++++++++- .../tests/DumpTests/EcmaMetadataDumpTests.cs | 2 +- .../ExceptionHandlingInfoDumpTests.cs | 2 +- .../DumpTests/ISOSDacInterface13Tests.cs | 2 +- .../DumpTests/IXCLRDataAppDomainDumpTests.cs | 2 +- .../DumpTests/IXCLRDataFrameDumpTests.cs | 2 +- .../DumpTests/IXCLRDataValueDumpTests.cs | 2 +- .../cdac/tests/DumpTests/LoaderDumpTests.cs | 2 +- .../DumpTests/RCWCleanupListDumpTests.cs | 2 +- .../cdac/tests/DumpTests/RCWDumpTests.cs | 2 +- .../tests/DumpTests/StackWalkDumpTests.cs | 2 +- .../tests/DumpTests/SyncBlockDumpTests.cs | 2 +- .../cdac/tests/DumpTests/cdac-dump-helix.proj | 36 +++++++++++ 27 files changed, 140 insertions(+), 28 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs index 29a9560735ab46..063cee1293cf74 100644 --- a/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class AsyncContinuationDumpTests : DumpTestBase { protected override string DebuggeeName => "AsyncContinuation"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs index 6e08d149c42639..b560739ff34b3e 100644 --- a/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class CCWDumpTests : DumpTestBase { protected override string DebuggeeName => "CCW"; - protected override string DumpType => "full"; + /// /// Enumerates all strong GC handles from the dump, dereferences each one to get diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index e94f7c5ebbc2f1..ffb3c3e37c0eeb 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Generic; +using System.Linq; using Microsoft.Diagnostics.Runtime; namespace Microsoft.Diagnostics.DataContractReader.DumpTests; @@ -32,9 +34,24 @@ private ClrMdDumpHost(string dumpPath, DataTarget dataTarget) /// /// Open a crash dump and prepare it for cDAC analysis. /// - public static ClrMdDumpHost Open(string dumpPath) + /// Path to the crash dump file. + /// + /// Optional local directories to search for symbol files (e.g., System.Private.CoreLib, + /// debuggee DLLs). + /// + public static ClrMdDumpHost Open(string dumpPath, IEnumerable? additionalSymbolPaths = null) { - DataTarget dataTarget = DataTarget.LoadDump(dumpPath); + // Local paths first so they resolve before the network fallback. + string localPaths = additionalSymbolPaths is not null + ? string.Join(";", additionalSymbolPaths.Where(p => !string.IsNullOrEmpty(p))) + : string.Empty; + + string symbolPaths = localPaths.Length > 0 + ? localPaths + ";" + SymbolPath.MicrosoftSymbolServerPath + : SymbolPath.MicrosoftSymbolServerPath; + + DataTarget dataTarget = DataTarget.LoadDump(dumpPath, new DataTargetOptions(SymbolPaths = symbolPaths)); + return new ClrMdDumpHost(dumpPath, dataTarget); } diff --git a/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs index 8af9f758deef0e..53050f2428371b 100644 --- a/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class ComWrappersDumpTests : DumpTestBase { protected override string DebuggeeName => "ComWrappers"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/AsyncContinuation.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/AsyncContinuation.csproj index f2c96fe50c786d..0c19ddc25f5675 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/AsyncContinuation.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/AsyncContinuation/AsyncContinuation.csproj @@ -4,7 +4,6 @@ $(Features);runtime-async=on true $(NoWarn);CA2007;CA2252 - - Full + Heap diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/CCW/CCW.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/CCW/CCW.csproj index 9d3e9f517d21fd..af8d23ccbb4fb4 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/CCW/CCW.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/CCW/CCW.csproj @@ -1,6 +1,6 @@ - Full + Heap true diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/ComWrappers/ComWrappers.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/ComWrappers/ComWrappers.csproj index bb776824769fe6..75ae87c9e7195f 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/ComWrappers/ComWrappers.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/ComWrappers/ComWrappers.csproj @@ -1,5 +1,5 @@ - Full + Heap diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/ExceptionHandlingInfo/ExceptionHandlingInfo.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/ExceptionHandlingInfo/ExceptionHandlingInfo.csproj index 51f5b66e60bf15..3168075e00e18e 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/ExceptionHandlingInfo/ExceptionHandlingInfo.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/ExceptionHandlingInfo/ExceptionHandlingInfo.csproj @@ -1,6 +1,6 @@ - Full + Heap R2R;Jit diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/LocalVariables/LocalVariables.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/LocalVariables/LocalVariables.csproj index ff74b3456316da..1e89fd20359ec9 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/LocalVariables/LocalVariables.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/LocalVariables/LocalVariables.csproj @@ -1,6 +1,6 @@ - Full + Heap Jit true diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/MultiModule/MultiModule.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/MultiModule/MultiModule.csproj index bb776824769fe6..75ae87c9e7195f 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/MultiModule/MultiModule.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/MultiModule/MultiModule.csproj @@ -1,5 +1,5 @@ - Full + Heap diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/RCW/RCW.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/RCW/RCW.csproj index 8fbeb470e46055..4ddb526b439e94 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/RCW/RCW.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/RCW/RCW.csproj @@ -2,7 +2,7 @@ $(NoWarn);CA1416 - Full + Heap true diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/RCWCleanupList/RCWCleanupList.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/RCWCleanupList/RCWCleanupList.csproj index 8fbeb470e46055..4ddb526b439e94 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/RCWCleanupList/RCWCleanupList.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/RCWCleanupList/RCWCleanupList.csproj @@ -2,7 +2,7 @@ $(NoWarn);CA1416 - Full + Heap true diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/StackWalk/StackWalk.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/StackWalk/StackWalk.csproj index 51f5b66e60bf15..3168075e00e18e 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/StackWalk/StackWalk.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/StackWalk/StackWalk.csproj @@ -1,6 +1,6 @@ - Full + Heap R2R;Jit diff --git a/src/native/managed/cdac/tests/DumpTests/Debuggees/SyncBlock/SyncBlock.csproj b/src/native/managed/cdac/tests/DumpTests/Debuggees/SyncBlock/SyncBlock.csproj index bb776824769fe6..75ae87c9e7195f 100644 --- a/src/native/managed/cdac/tests/DumpTests/Debuggees/SyncBlock/SyncBlock.csproj +++ b/src/native/managed/cdac/tests/DumpTests/Debuggees/SyncBlock/SyncBlock.csproj @@ -1,5 +1,5 @@ - Full + Heap diff --git a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs index c5e0f0d1540512..f0bb46664961e1 100644 --- a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs +++ b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs @@ -98,7 +98,7 @@ protected void InitializeDumpTest(TestConfiguration config, string debuggeeName, throw new SkipTestException($"No {config.R2RMode} dump for {debuggeeName}: {dumpPath}"); } - _host = ClrMdDumpHost.Open(dumpPath); + _host = ClrMdDumpHost.Open(dumpPath, GetSymbolPaths(debuggeeName, versionDir)); ulong contractDescriptor = _host.FindContractDescriptorAddress(); bool created = ContractDescriptorTarget.TryCreate( @@ -198,6 +198,66 @@ private static bool IsVersionSkipped(string version) return false; } + /// + /// Collects local symbol paths for ClrMD to resolve modules in the dump. + /// Checks two sources in order: + /// + /// A symbols/ directory in the dump version directory (Helix and xplat dumps) + /// Auto-detection from the repository artifact layout (local development fallback) + /// + /// + private static List GetSymbolPaths(string debuggeeName, string versionDir) + { + List paths = []; + + // Symbols directory in the dump tree (populated by Helix commands before tarring) + string symbolsDir = Path.Combine(versionDir, "symbols"); + if (Directory.Exists(symbolsDir)) + { + string runtimeSymbols = Path.Combine(symbolsDir, "runtime"); + if (Directory.Exists(runtimeSymbols)) + paths.Add(runtimeSymbols); + + string debuggeeSymbols = Path.Combine(symbolsDir, "debuggees", debuggeeName); + if (Directory.Exists(debuggeeSymbols)) + paths.Add(debuggeeSymbols); + } + + // Local development fallback: find testhost and debuggees from repo artifacts + if (paths.Count == 0) + { + string? repoRoot = FindRepoRoot(); + if (repoRoot is not null) + { + string testhostBase = Path.Combine(repoRoot, "artifacts", "bin", "testhost"); + if (Directory.Exists(testhostBase)) + { + foreach (string hostDir in Directory.GetDirectories(testhostBase, "net*")) + { + string sharedFxDir = Path.Combine(hostDir, "shared", "Microsoft.NETCore.App"); + if (Directory.Exists(sharedFxDir)) + { + foreach (string versionPath in Directory.GetDirectories(sharedFxDir)) + paths.Add(versionPath); + } + } + } + + string debuggeeBinBase = Path.Combine(repoRoot, "artifacts", "bin", "DumpTests", debuggeeName); + if (Directory.Exists(debuggeeBinBase)) + { + foreach (string configDir in Directory.GetDirectories(debuggeeBinBase)) + { + foreach (string tfmDir in Directory.GetDirectories(configDir)) + paths.Add(tfmDir); + } + } + } + } + + return paths; + } + private static string? FindRepoRoot() { string? dir = AppContext.BaseDirectory; diff --git a/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs index 97560b619c838f..ff748f8e8621ca 100644 --- a/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class EcmaMetadataDumpTests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs index 4b9ef9ffc4cf85..2c317f6eb6e915 100644 --- a/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class ExceptionHandlingInfoDumpTests : DumpTestBase { protected override string DebuggeeName => "ExceptionHandlingInfo"; - protected override string DumpType => "full"; + /// /// Finds the CodeBlockHandle for the CrashInExceptionHandler method by walking diff --git a/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs b/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs index 8d68373c1ad893..8b631ab527e3f8 100644 --- a/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs @@ -15,7 +15,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class ISOSDacInterface13Tests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs index a4e01f3b5f1100..6ad04d732077b9 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public unsafe class IXCLRDataAppDomainDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - protected override string DumpType => "full"; + // ========== GetName ========== diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs index 49c1fee40eaa88..79a75c66b2fa23 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public unsafe class IXCLRDataFrameDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - protected override string DumpType => "full"; + // ========== GetContext ========== diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs index d838794a6c90be..d8a99c6049ca39 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public unsafe class IXCLRDataValueDumpTests : DumpTestBase { protected override string DebuggeeName => "LocalVariables"; - protected override string DumpType => "full"; + // ========== GetSize ========== diff --git a/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs index fc1d2b04c86be1..1f6dc117a45f8b 100644 --- a/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs @@ -15,7 +15,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class LoaderDumpTests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs index 4312653a33c566..b08fa14bdc9bb7 100644 --- a/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class RCWCleanupListDumpTests : DumpTestBase { protected override string DebuggeeName => "RCWCleanupList"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs index c2d2e7a26d9592..6300db917715b8 100644 --- a/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class RCWDumpTests : DumpTestBase { protected override string DebuggeeName => "RCW"; - protected override string DumpType => "full"; + /// /// Walks all strong GC handles and returns all RCW pointers found, diff --git a/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs index bb45d3b6452588..f7afe465171ec2 100644 --- a/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class StackWalkDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs index 6b6fdcc2bb20a7..2c4e7a56342032 100644 --- a/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class SyncBlockDumpTests : DumpTestBase { protected override string DebuggeeName => "SyncBlock"; - protected override string DumpType => "full"; + [ConditionalTheory] [MemberData(nameof(TestConfigurations))] diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index cb0702d762d63d..5b91f7e1efbafe 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -165,6 +165,42 @@ Include="echo '{"os":"$(TargetOS)","arch":"$(TargetArchitecture)","debuggees":[$(_EvalDebuggeeJsonArray)]}' > $HELIX_WORKITEM_PAYLOAD/dumps/local/dump-info.json" /> + + + + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="echo === Copying symbols ===" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\" >nul" /> + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="@(_UniqueDebuggee->'mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)')" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="@(_UniqueDebuggee->'copy "%25HELIX_WORKITEM_PAYLOAD%25\debuggees\%(Identity)\%(Identity).dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)\" >nul')" /> + + + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="echo '=== Copying symbols ==='" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="mkdir -p $HELIX_WORKITEM_PAYLOAD/dumps/local/symbols/runtime" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="cp $HELIX_CORRELATION_PAYLOAD/shared/Microsoft.NETCore.App/*/System.Private.CoreLib.dll $HELIX_WORKITEM_PAYLOAD/dumps/local/symbols/runtime/" /> + + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="@(_UniqueDebuggee->'mkdir -p $HELIX_WORKITEM_PAYLOAD/dumps/local/symbols/debuggees/%(Identity)')" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="@(_UniqueDebuggee->'cp $HELIX_WORKITEM_PAYLOAD/debuggees/%(Identity)/%(Identity).dll $HELIX_WORKITEM_PAYLOAD/dumps/local/symbols/debuggees/%(Identity)/')" /> + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" From d23c4a9646740652d37bcc7bddf813a01b9fec2b Mon Sep 17 00:00:00 2001 From: rcj1 Date: Wed, 1 Apr 2026 17:21:16 -0700 Subject: [PATCH 02/10] bump clrmd --- eng/Versions.props | 2 +- .../System.Net.Http/tests/UnitTests/DiagnosticsHelperTest.cs | 1 - .../UnmanagedToManagedCustomMarshallingTests.cs | 1 - .../tests/X509Certificates/PublicKeyTests.cs | 1 - src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs | 4 ++-- src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj | 4 ++-- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 758eedf0864261..3e4f0eebbc8c23 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -155,7 +155,7 @@ 13.0.3 1.0.2 4.18.4 - 3.1.512801 + 4.0.0-beta.26072.1 8.0.2 2.14.3 2.9.1 diff --git a/src/libraries/System.Net.Http/tests/UnitTests/DiagnosticsHelperTest.cs b/src/libraries/System.Net.Http/tests/UnitTests/DiagnosticsHelperTest.cs index 4086d9344080c9..5e42084ba62cf1 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/DiagnosticsHelperTest.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/DiagnosticsHelperTest.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using Microsoft.Diagnostics.Runtime.Utilities; using Microsoft.DotNet.RemoteExecutor; using Xunit; diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/UnmanagedToManagedCustomMarshallingTests.cs b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/UnmanagedToManagedCustomMarshallingTests.cs index af89c22e25fd3b..32c60575c8139c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/UnmanagedToManagedCustomMarshallingTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Tests/UnmanagedToManagedCustomMarshallingTests.cs @@ -7,7 +7,6 @@ using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; using System.Threading; -using Microsoft.Diagnostics.Runtime; using SharedTypes; using Xunit; using static ComInterfaceGenerator.Tests.UnmanagedToManagedCustomMarshallingTests; diff --git a/src/libraries/System.Security.Cryptography/tests/X509Certificates/PublicKeyTests.cs b/src/libraries/System.Security.Cryptography/tests/X509Certificates/PublicKeyTests.cs index 61bbd4a537d047..3e15c11df3fb3b 100644 --- a/src/libraries/System.Security.Cryptography/tests/X509Certificates/PublicKeyTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/X509Certificates/PublicKeyTests.cs @@ -5,7 +5,6 @@ using System.IO; using System.Security.Cryptography.SLHDsa.Tests; using System.Security.Cryptography.Tests; -using Microsoft.Diagnostics.Runtime.Interop; using Test.Cryptography; using Xunit; diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index ffb3c3e37c0eeb..b3ca951c5a8640 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -47,8 +47,8 @@ public static ClrMdDumpHost Open(string dumpPath, IEnumerable? additiona : string.Empty; string symbolPaths = localPaths.Length > 0 - ? localPaths + ";" + SymbolPath.MicrosoftSymbolServerPath - : SymbolPath.MicrosoftSymbolServerPath; + ? localPaths + ";" + : string.Empty; DataTarget dataTarget = DataTarget.LoadDump(dumpPath, new DataTargetOptions(SymbolPaths = symbolPaths)); diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index 5b91f7e1efbafe..45fb29088d6ee5 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -180,12 +180,12 @@ <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" - Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\" >nul" /> + Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do (echo === Processing folder: %25%25v === & dir %25%25v & echo Copying System.Private.CoreLib.dll & copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\" & echo === Done with %25%25v === & echo)" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="@(_UniqueDebuggee->'mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)')" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" - Include="@(_UniqueDebuggee->'copy "%25HELIX_WORKITEM_PAYLOAD%25\debuggees\%(Identity)\%(Identity).dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)\" >nul')" /> + Include="@(_UniqueDebuggee->'copy "%25HELIX_WORKITEM_PAYLOAD%25\debuggees\%(Identity)\%(Identity).dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)\"')" /> <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" From 63365e25cbb64bc4059d271267c3d585e1ebb50c Mon Sep 17 00:00:00 2001 From: Rachel Date: Wed, 1 Apr 2026 19:34:39 -0700 Subject: [PATCH 03/10] Update to ensure reading of needed metadata --- .../DumpTests/AsyncContinuationDumpTests.cs | 1 - .../cdac/tests/DumpTests/CCWDumpTests.cs | 1 - .../cdac/tests/DumpTests/ClrMdDumpHost.cs | 55 ++++++++++++++++--- .../tests/DumpTests/ComWrappersDumpTests.cs | 1 - .../cdac/tests/DumpTests/DumpTestBase.cs | 38 +------------ .../tests/DumpTests/EcmaMetadataDumpTests.cs | 1 - .../ExceptionHandlingInfoDumpTests.cs | 1 - .../DumpTests/ISOSDacInterface13Tests.cs | 1 - .../DumpTests/IXCLRDataAppDomainDumpTests.cs | 1 - .../DumpTests/IXCLRDataFrameDumpTests.cs | 1 - .../DumpTests/IXCLRDataValueDumpTests.cs | 1 - .../cdac/tests/DumpTests/LoaderDumpTests.cs | 1 - .../DumpTests/RCWCleanupListDumpTests.cs | 1 - .../cdac/tests/DumpTests/RCWDumpTests.cs | 1 - .../managed/cdac/tests/DumpTests/README.md | 20 ++++--- .../tests/DumpTests/StackWalkDumpTests.cs | 1 - .../tests/DumpTests/SyncBlockDumpTests.cs | 1 - .../cdac/tests/DumpTests/cdac-dump-helix.proj | 2 +- 18 files changed, 60 insertions(+), 69 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs index 063cee1293cf74..ce52b0cfec4ccd 100644 --- a/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/AsyncContinuationDumpTests.cs @@ -17,7 +17,6 @@ public class AsyncContinuationDumpTests : DumpTestBase { protected override string DebuggeeName => "AsyncContinuation"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] [SkipOnVersion("net10.0", "Continuation support is not available in .NET 10")] diff --git a/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs index b560739ff34b3e..87092fefe01950 100644 --- a/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/CCWDumpTests.cs @@ -18,7 +18,6 @@ public class CCWDumpTests : DumpTestBase { protected override string DebuggeeName => "CCW"; - /// /// Enumerates all strong GC handles from the dump, dereferences each one to get /// the managed object address, then uses the Object contract to find objects that diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index b3ca951c5a8640..088db29d2a70cc 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection.PortableExecutable; using Microsoft.Diagnostics.Runtime; namespace Microsoft.Diagnostics.DataContractReader.DumpTests; @@ -41,16 +42,12 @@ private ClrMdDumpHost(string dumpPath, DataTarget dataTarget) /// public static ClrMdDumpHost Open(string dumpPath, IEnumerable? additionalSymbolPaths = null) { - // Local paths first so they resolve before the network fallback. - string localPaths = additionalSymbolPaths is not null + string symbolPaths = additionalSymbolPaths is not null ? string.Join(";", additionalSymbolPaths.Where(p => !string.IsNullOrEmpty(p))) : string.Empty; - string symbolPaths = localPaths.Length > 0 - ? localPaths + ";" - : string.Empty; - - DataTarget dataTarget = DataTarget.LoadDump(dumpPath, new DataTargetOptions(SymbolPaths = symbolPaths)); + DataTarget dataTarget = DataTarget.LoadDump(dumpPath); + dataTarget.SetSymbolPath(symbolPaths); return new ClrMdDumpHost(dumpPath, dataTarget); } @@ -62,7 +59,39 @@ public static ClrMdDumpHost Open(string dumpPath, IEnumerable? additiona public int ReadFromTarget(ulong address, Span buffer) { int bytesRead = _dataTarget.DataReader.Read(address, buffer); - return bytesRead == buffer.Length ? 0 : -1; + if (bytesRead == buffer.Length) + return 0; // success + + // If we couldn't read the full buffer, maybe it's in a PE image + ModuleInfo? info = GetModuleForAddress(address); + if (info is null || info.FileName is null) + return -1; + + string? foundFile = _dataTarget.FileLocator?.FindPEImage(info.FileName, info.IndexTimeStamp, info.IndexFileSize, checkProperties: false); + if (foundFile is null) + return -1; + + using FileStream fs = File.OpenRead(foundFile); + using PEReader peReader = new PEReader(fs); + + int filled = 0; + ulong current = address; + while (filled < buffer.Length) + { + PEMemoryBlock block = peReader.GetSectionData((int)(current - info.ImageBase)); + if (block.Length == 0) + return -1; + + int toCopy = Math.Min(block.Length, buffer.Length - filled); + unsafe + { + new ReadOnlySpan(block.Pointer, toCopy).CopyTo(buffer.Slice(filled)); + } + filled += toCopy; + current += (ulong)toCopy; + } + + return 0; } /// @@ -74,6 +103,16 @@ public int GetThreadContext(uint threadId, uint contextFlags, Span buffer) return _dataTarget.DataReader.GetThreadContext(threadId, contextFlags, buffer) ? 0 : -1; } + private ModuleInfo? GetModuleForAddress(ulong address) + { + foreach (ModuleInfo module in _dataTarget.DataReader.EnumerateModules()) + { + if (address >= module.ImageBase && address < module.ImageBase + module.FileSize) + return module; + } + return null; + } + /// /// Locate the DotNetRuntimeContractDescriptor symbol address in the dump. /// Uses ClrMD's built-in export resolution which handles PE, ELF, and Mach-O formats. diff --git a/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs index 53050f2428371b..51475936a7468d 100644 --- a/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ComWrappersDumpTests.cs @@ -18,7 +18,6 @@ public class ComWrappersDumpTests : DumpTestBase { protected override string DebuggeeName => "ComWrappers"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] [SkipOnVersion("net10.0", "ComWrappers cDAC support not available in .NET 10")] diff --git a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs index f0bb46664961e1..5a9a92c9826b83 100644 --- a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs +++ b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs @@ -200,11 +200,7 @@ private static bool IsVersionSkipped(string version) /// /// Collects local symbol paths for ClrMD to resolve modules in the dump. - /// Checks two sources in order: - /// - /// A symbols/ directory in the dump version directory (Helix and xplat dumps) - /// Auto-detection from the repository artifact layout (local development fallback) - /// + /// Checks symbols/ directories in the helix payload (Helix and xplat dumps) /// private static List GetSymbolPaths(string debuggeeName, string versionDir) { @@ -223,38 +219,6 @@ private static List GetSymbolPaths(string debuggeeName, string versionDi paths.Add(debuggeeSymbols); } - // Local development fallback: find testhost and debuggees from repo artifacts - if (paths.Count == 0) - { - string? repoRoot = FindRepoRoot(); - if (repoRoot is not null) - { - string testhostBase = Path.Combine(repoRoot, "artifacts", "bin", "testhost"); - if (Directory.Exists(testhostBase)) - { - foreach (string hostDir in Directory.GetDirectories(testhostBase, "net*")) - { - string sharedFxDir = Path.Combine(hostDir, "shared", "Microsoft.NETCore.App"); - if (Directory.Exists(sharedFxDir)) - { - foreach (string versionPath in Directory.GetDirectories(sharedFxDir)) - paths.Add(versionPath); - } - } - } - - string debuggeeBinBase = Path.Combine(repoRoot, "artifacts", "bin", "DumpTests", debuggeeName); - if (Directory.Exists(debuggeeBinBase)) - { - foreach (string configDir in Directory.GetDirectories(debuggeeBinBase)) - { - foreach (string tfmDir in Directory.GetDirectories(configDir)) - paths.Add(tfmDir); - } - } - } - } - return paths; } diff --git a/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs index ff748f8e8621ca..189c697a04d4ad 100644 --- a/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/EcmaMetadataDumpTests.cs @@ -15,7 +15,6 @@ public class EcmaMetadataDumpTests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] [SkipOnVersion("net10.0", "Assembly type does not include IsDynamic/IsLoaded fields in .NET 10")] diff --git a/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs index 2c317f6eb6e915..d8664081aeeaba 100644 --- a/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ExceptionHandlingInfoDumpTests.cs @@ -21,7 +21,6 @@ public class ExceptionHandlingInfoDumpTests : DumpTestBase { protected override string DebuggeeName => "ExceptionHandlingInfo"; - /// /// Finds the CodeBlockHandle for the CrashInExceptionHandler method by walking /// the crashing thread's stack, resolving method names, then using the method's diff --git a/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs b/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs index 8b631ab527e3f8..d4022249f04eb2 100644 --- a/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs +++ b/src/native/managed/cdac/tests/DumpTests/ISOSDacInterface13Tests.cs @@ -16,7 +16,6 @@ public class ISOSDacInterface13Tests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public unsafe void GetLoaderAllocatorHeapNames_MatchExpectedOrder(TestConfiguration config) diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs index 6ad04d732077b9..20c7f5cdeaa4c3 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataAppDomainDumpTests.cs @@ -17,7 +17,6 @@ public unsafe class IXCLRDataAppDomainDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - // ========== GetName ========== [ConditionalTheory] diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs index 79a75c66b2fa23..8fe1d7607ea5ba 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataFrameDumpTests.cs @@ -17,7 +17,6 @@ public unsafe class IXCLRDataFrameDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - // ========== GetContext ========== [ConditionalTheory] diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs index d8a99c6049ca39..11b4363288f490 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataValueDumpTests.cs @@ -20,7 +20,6 @@ public unsafe class IXCLRDataValueDumpTests : DumpTestBase { protected override string DebuggeeName => "LocalVariables"; - // ========== GetSize ========== [ConditionalTheory] diff --git a/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs index 1f6dc117a45f8b..66a73a30c84cdd 100644 --- a/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/LoaderDumpTests.cs @@ -16,7 +16,6 @@ public class LoaderDumpTests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public void Loader_CanGetRootAssembly(TestConfiguration config) diff --git a/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs index b08fa14bdc9bb7..6575594de0e329 100644 --- a/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RCWCleanupListDumpTests.cs @@ -18,7 +18,6 @@ public class RCWCleanupListDumpTests : DumpTestBase { protected override string DebuggeeName => "RCWCleanupList"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] [SkipOnOS(IncludeOnly = "windows", Reason = "BuiltInCOM contract is only available on Windows")] diff --git a/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs index 6300db917715b8..78d8dcda0848c2 100644 --- a/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RCWDumpTests.cs @@ -17,7 +17,6 @@ public class RCWDumpTests : DumpTestBase { protected override string DebuggeeName => "RCW"; - /// /// Walks all strong GC handles and returns all RCW pointers found, /// paired with their . diff --git a/src/native/managed/cdac/tests/DumpTests/README.md b/src/native/managed/cdac/tests/DumpTests/README.md index 584c863a4d36d5..e030eaf9c80b25 100644 --- a/src/native/managed/cdac/tests/DumpTests/README.md +++ b/src/native/managed/cdac/tests/DumpTests/README.md @@ -29,16 +29,19 @@ features and then calls `Environment.FailFast()` to produce a crash dump. | BasicThreads | Thread management, thread store | Heap | | GCRoots | GC object graphs, pinned handles | Heap | | ServerGC | Server GC mode heap structures | Heap | -| StackWalk | Deterministic call stack (Main→A→B→C→FailFast) | Full | -| MultiModule | Multi-assembly metadata resolution | Full | +| StackWalk | Deterministic call stack (Main→A→B→C→FailFast) | Heap | +| MultiModule | Multi-assembly metadata resolution | Heap | | TypeHierarchy | Type inheritance, method tables | Heap | | PInvokeStub | P/Invoke with SetLastError ILStub | Full | | VarargPInvoke | Vararg P/Invoke via __arglist (sprintf) | Full | -| SyncBlock | Sync block locks | Full | -| CCW | COM callable wrappers (CCW) on Windows | Full | -| RCWCleanupList | STA-context RCW entries in g_pRCWCleanupList on Windows | Full | -| RCW | COM RCW with populated interface entry cache on Windows | Full | -| ComWrappers | ComWrappers-based MOW and RCW | Full | +| SyncBlock | Sync block locks | Heap | +| CCW | COM callable wrappers (CCW) on Windows | Heap | +| RCWCleanupList | STA-context RCW entries in g_pRCWCleanupList on Windows | Heap | +| RCW | COM RCW with populated interface entry cache on Windows | Heap | +| ComWrappers | ComWrappers-based MOW and RCW | Heap | +| ExceptionHandlingInfo | EH clause reading test | Heap | +| LocalVariables | Info about local variables | Heap | +| AsyncContinuation | Reading async continuation method tables | Heap | The dump type is configured per-debuggee via the `DumpTypes` property in each debuggee's `.csproj` (default: `Heap`, set in `Debuggees/Directory.Build.props`). Debuggees that @@ -130,11 +133,10 @@ artifacts/dumps/cdac/ heap/ BasicThreads/BasicThreads.dmp full/ - StackWalk/StackWalk.dmp PInvokeStub/PInvokeStub.dmp net10.0/ dump-info.json - full/ + heap/ TypeHierarchy/TypeHierarchy.dmp ``` diff --git a/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs index f7afe465171ec2..ddfc5c5bad2248 100644 --- a/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/StackWalkDumpTests.cs @@ -17,7 +17,6 @@ public class StackWalkDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] [SkipOnVersion("net10.0", "InlinedCallFrame.Datum was added after net10.0")] diff --git a/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs index 2c4e7a56342032..8ccb7ffb95fb0e 100644 --- a/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/SyncBlockDumpTests.cs @@ -15,7 +15,6 @@ public class SyncBlockDumpTests : DumpTestBase { protected override string DebuggeeName => "SyncBlock"; - [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public void SyncBlockContract_CanFindHeldMonitor(TestConfiguration config) diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index 45fb29088d6ee5..941701dc0392d9 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -180,7 +180,7 @@ <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" - Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do (echo === Processing folder: %25%25v === & dir %25%25v & echo Copying System.Private.CoreLib.dll & copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\" & echo === Done with %25%25v === & echo)" /> + Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\"" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="@(_UniqueDebuggee->'mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)')" /> From dcd6cc6928ad3c3f12c0cab1135cc61262d50486 Mon Sep 17 00:00:00 2001 From: rcj1 Date: Thu, 2 Apr 2026 17:25:43 -0700 Subject: [PATCH 04/10] update --- src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index 088db29d2a70cc..1054703a8a7716 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection.PortableExecutable; +using System.IO; using Microsoft.Diagnostics.Runtime; namespace Microsoft.Diagnostics.DataContractReader.DumpTests; @@ -107,7 +108,7 @@ public int GetThreadContext(uint threadId, uint contextFlags, Span buffer) { foreach (ModuleInfo module in _dataTarget.DataReader.EnumerateModules()) { - if (address >= module.ImageBase && address < module.ImageBase + module.FileSize) + if (address >= module.ImageBase && address < module.ImageBase + module.ImageSize) return module; } return null; From 94c4d423012da5d8677539267b94d57dcdc93eba Mon Sep 17 00:00:00 2001 From: Rachel Date: Thu, 2 Apr 2026 17:34:07 -0700 Subject: [PATCH 05/10] Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> we don't need the filelocator --- .../cdac/tests/DumpTests/ClrMdDumpHost.cs | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index 1054703a8a7716..669955bedfa4dc 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -24,13 +24,15 @@ internal sealed class ClrMdDumpHost : IDisposable }; private readonly DataTarget _dataTarget; + private readonly string[] _searchPaths; public string DumpPath { get; } - private ClrMdDumpHost(string dumpPath, DataTarget dataTarget) + private ClrMdDumpHost(string dumpPath, DataTarget dataTarget, string[] searchPaths) { DumpPath = dumpPath; _dataTarget = dataTarget; + _searchPaths = searchPaths; } /// @@ -41,16 +43,11 @@ private ClrMdDumpHost(string dumpPath, DataTarget dataTarget) /// Optional local directories to search for symbol files (e.g., System.Private.CoreLib, /// debuggee DLLs). /// - public static ClrMdDumpHost Open(string dumpPath, IEnumerable? additionalSymbolPaths = null) + public static ClrMdDumpHost Open(string dumpPath, List additionalSymbolPaths) { - string symbolPaths = additionalSymbolPaths is not null - ? string.Join(";", additionalSymbolPaths.Where(p => !string.IsNullOrEmpty(p))) - : string.Empty; - DataTarget dataTarget = DataTarget.LoadDump(dumpPath); - dataTarget.SetSymbolPath(symbolPaths); - return new ClrMdDumpHost(dumpPath, dataTarget); + return new ClrMdDumpHost(dumpPath, dataTarget, additionalSymbolPaths.ToArray()); } /// @@ -66,11 +63,17 @@ public int ReadFromTarget(ulong address, Span buffer) // If we couldn't read the full buffer, maybe it's in a PE image ModuleInfo? info = GetModuleForAddress(address); if (info is null || info.FileName is null) + { + Console.WriteLine($"Failed to find module for {buffer.Length} at 0x{address:x8}."); return -1; + } - string? foundFile = _dataTarget.FileLocator?.FindPEImage(info.FileName, info.IndexTimeStamp, info.IndexFileSize, checkProperties: false); + string? foundFile = FindFileOnDisk(info.FileName); if (foundFile is null) + { + Console.WriteLine($"Failed to find {info.FileName}"); return -1; + } using FileStream fs = File.OpenRead(foundFile); using PEReader peReader = new PEReader(fs); @@ -81,7 +84,10 @@ public int ReadFromTarget(ulong address, Span buffer) { PEMemoryBlock block = peReader.GetSectionData((int)(current - info.ImageBase)); if (block.Length == 0) + { + Console.WriteLine($"Failed to read {foundFile} at RVA 0x{(current-info.ImageBase):x8}."); return -1; + } int toCopy = Math.Min(block.Length, buffer.Length - filled); unsafe @@ -108,7 +114,7 @@ public int GetThreadContext(uint threadId, uint contextFlags, Span buffer) { foreach (ModuleInfo module in _dataTarget.DataReader.EnumerateModules()) { - if (address >= module.ImageBase && address < module.ImageBase + module.ImageSize) + if (address >= module.ImageBase && address < module.ImageBase + (ulong)module.ImageSize) return module; } return null; @@ -150,6 +156,21 @@ public ulong FindContractDescriptorAddress() throw new InvalidOperationException("Could not find DotNetRuntimeContractDescriptor export in any runtime module in the dump."); } + private string? FindFileOnDisk(string modulePath) + { + int lastSep = Math.Max(modulePath.LastIndexOf('/'), modulePath.LastIndexOf('\\')); + string fileName = lastSep >= 0 ? modulePath[(lastSep + 1)..] : modulePath; + + foreach (string searchPath in _searchPaths) + { + string candidate = Path.Combine(searchPath, fileName); + if (File.Exists(candidate)) + return candidate; + } + + return null; + } + private static bool IsRuntimeModule(string fileName) { foreach (string name in s_runtimeModuleNames) From a57f9717453d26ea8cf280a6211f3912425b7789 Mon Sep 17 00:00:00 2001 From: Rachel Date: Fri, 3 Apr 2026 13:16:53 -0700 Subject: [PATCH 06/10] Update cdac-dump-helix.proj --- src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index 941701dc0392d9..45fb29088d6ee5 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -180,7 +180,7 @@ <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" - Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\"" /> + Include="for /D %25%25v in (%25HELIX_CORRELATION_PAYLOAD%25\shared\Microsoft.NETCore.App\*) do (echo === Processing folder: %25%25v === & dir %25%25v & echo Copying System.Private.CoreLib.dll & copy "%25%25v\System.Private.CoreLib.dll" "%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\runtime\" & echo === Done with %25%25v === & echo)" /> <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="@(_UniqueDebuggee->'mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\symbols\debuggees\%(Identity)')" /> From 28fc520c0a8b560cf48b731871c043666d002760 Mon Sep 17 00:00:00 2001 From: rcj1 Date: Mon, 27 Apr 2026 17:25:42 -0700 Subject: [PATCH 07/10] code review --- .../managed/cdac/tests/DumpTests/ClrMdDumpHost.cs | 10 ++++++---- src/native/managed/cdac/tests/DumpTests/README.md | 13 +++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index 669955bedfa4dc..cf69e1909af65c 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection.PortableExecutable; using System.IO; using Microsoft.Diagnostics.Runtime; @@ -40,7 +39,7 @@ private ClrMdDumpHost(string dumpPath, DataTarget dataTarget, string[] searchPat /// /// Path to the crash dump file. /// - /// Optional local directories to search for symbol files (e.g., System.Private.CoreLib, + /// Local directories to search for symbol files (e.g., System.Private.CoreLib, /// debuggee DLLs). /// public static ClrMdDumpHost Open(string dumpPath, List additionalSymbolPaths) @@ -78,8 +77,8 @@ public int ReadFromTarget(ulong address, Span buffer) using FileStream fs = File.OpenRead(foundFile); using PEReader peReader = new PEReader(fs); - int filled = 0; - ulong current = address; + int filled = bytesRead; + ulong current = address + (ulong)bytesRead; while (filled < buffer.Length) { PEMemoryBlock block = peReader.GetSectionData((int)(current - info.ImageBase)); @@ -158,6 +157,9 @@ public ulong FindContractDescriptorAddress() private string? FindFileOnDisk(string modulePath) { + // for local runs + if (File.Exists(modulePath)) + return modulePath; int lastSep = Math.Max(modulePath.LastIndexOf('/'), modulePath.LastIndexOf('\\')); string fileName = lastSep >= 0 ? modulePath[(lastSep + 1)..] : modulePath; diff --git a/src/native/managed/cdac/tests/DumpTests/README.md b/src/native/managed/cdac/tests/DumpTests/README.md index e030eaf9c80b25..a8aabf0485993b 100644 --- a/src/native/managed/cdac/tests/DumpTests/README.md +++ b/src/native/managed/cdac/tests/DumpTests/README.md @@ -131,13 +131,18 @@ artifacts/dumps/cdac/ local/ dump-info.json heap/ - BasicThreads/BasicThreads.dmp + r2r/ + BasicThreads/BasicThreads.dmp + jit/ + BasicThreads/BasicThreads.dmp full/ - PInvokeStub/PInvokeStub.dmp + r2r/ + PInvokeStub/PInvokeStub.dmp net10.0/ dump-info.json - heap/ - TypeHierarchy/TypeHierarchy.dmp + full/ + r2r/ + TypeHierarchy/TypeHierarchy.dmp ``` ## Running Locally (Windows) From 1b5f7dd3422b8042132972c2bb1fe0ad690241d3 Mon Sep 17 00:00:00 2001 From: rcj1 Date: Mon, 27 Apr 2026 17:45:49 -0700 Subject: [PATCH 08/10] cleanup --- src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs | 3 --- .../cdac/tests/DumpTests/DacDbi/DacDbiCCWDumpTests.cs | 2 -- .../tests/DumpTests/DacDbi/DacDbiComWrappersDumpTests.cs | 2 -- .../cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs | 2 -- .../cdac/tests/DumpTests/DacDbi/DacDbiRCWDumpTests.cs | 2 -- .../tests/DumpTests/IXCLRDataMethodDefinitionDumpTests.cs | 1 - src/native/managed/cdac/tests/DumpTests/README.md | 2 +- .../cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs | 3 --- .../managed/cdac/tests/DumpTests/StackReferenceDumpTests.cs | 5 ++--- 9 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs index cf69e1909af65c..c17344d52b0501 100644 --- a/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs +++ b/src/native/managed/cdac/tests/DumpTests/ClrMdDumpHost.cs @@ -63,14 +63,12 @@ public int ReadFromTarget(ulong address, Span buffer) ModuleInfo? info = GetModuleForAddress(address); if (info is null || info.FileName is null) { - Console.WriteLine($"Failed to find module for {buffer.Length} at 0x{address:x8}."); return -1; } string? foundFile = FindFileOnDisk(info.FileName); if (foundFile is null) { - Console.WriteLine($"Failed to find {info.FileName}"); return -1; } @@ -84,7 +82,6 @@ public int ReadFromTarget(ulong address, Span buffer) PEMemoryBlock block = peReader.GetSectionData((int)(current - info.ImageBase)); if (block.Length == 0) { - Console.WriteLine($"Failed to read {foundFile} at RVA 0x{(current-info.ImageBase):x8}."); return -1; } diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiCCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiCCWDumpTests.cs index a08cfe17300e1c..e7bd9737845485 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiCCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiCCWDumpTests.cs @@ -17,8 +17,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class DacDbiCCWDumpTests : DumpTestBase { protected override string DebuggeeName => "CCW"; - protected override string DumpType => "full"; - private DacDbiImpl CreateDacDbi() => new DacDbiImpl(Target, legacyObj: null); private (TargetPointer Ccw, TargetPointer InterfacePointer) FindBuiltInComCcwWithInterface() diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiComWrappersDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiComWrappersDumpTests.cs index 0bcb2521ee5f92..02e1ade17bfca9 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiComWrappersDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiComWrappersDumpTests.cs @@ -16,8 +16,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class DacDbiComWrappersDumpTests : DumpTestBase { protected override string DebuggeeName => "ComWrappers"; - protected override string DumpType => "full"; - private DacDbiImpl CreateDacDbi() => new DacDbiImpl(Target, legacyObj: null); [ConditionalTheory] diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs index d7a776ff19fc5f..8b7c92ca26066f 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiLoaderDumpTests.cs @@ -15,8 +15,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class DacDbiLoaderDumpTests : DumpTestBase { protected override string DebuggeeName => "MultiModule"; - protected override string DumpType => "full"; - private DacDbiImpl CreateDacDbi() => new DacDbiImpl(Target, legacyObj: null); private IEnumerable GetAllModules() diff --git a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiRCWDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiRCWDumpTests.cs index 47f6ed89748625..90f0a7be73d2b6 100644 --- a/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiRCWDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiRCWDumpTests.cs @@ -15,8 +15,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class DacDbiRCWDumpTests : DumpTestBase { protected override string DebuggeeName => "RCW"; - protected override string DumpType => "full"; - private DacDbiImpl CreateDacDbi() => new DacDbiImpl(Target, legacyObj: null); [ConditionalTheory] diff --git a/src/native/managed/cdac/tests/DumpTests/IXCLRDataMethodDefinitionDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/IXCLRDataMethodDefinitionDumpTests.cs index 66d0126b0b7ab7..d627f24e0ffbe6 100644 --- a/src/native/managed/cdac/tests/DumpTests/IXCLRDataMethodDefinitionDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/IXCLRDataMethodDefinitionDumpTests.cs @@ -19,7 +19,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public unsafe class IXCLRDataMethodDefinitionDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - protected override string DumpType => "full"; // ========== GetName ========== diff --git a/src/native/managed/cdac/tests/DumpTests/README.md b/src/native/managed/cdac/tests/DumpTests/README.md index a8aabf0485993b..5c637320b35911 100644 --- a/src/native/managed/cdac/tests/DumpTests/README.md +++ b/src/native/managed/cdac/tests/DumpTests/README.md @@ -121,7 +121,7 @@ If `dump-info.json` is not present, OS-based skipping is silently disabled. Dumps are written to: ``` -artifacts/dumps/cdac/{version}/{dumptype}/{debuggee}/{debuggee}.dmp +artifacts/dumps/cdac/{version}/{dumptype}/{r2rmode}/{debuggee}/{debuggee}.dmp ``` For example: diff --git a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs index f90889bf14ccb2..ffea2b2e2fbcde 100644 --- a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs @@ -316,7 +316,6 @@ public void RuntimeTypeSystem_ConcreteTypesDoNotContainGenericVariables(TestConf [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_IsValueType(TestConfiguration config) { - InitializeDumpTest(config, "LocalVariables", "full"); IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; ILoader loader = Target.Contracts.Loader; @@ -352,8 +351,6 @@ public void RuntimeTypeSystem_IsValueType(TestConfiguration config) [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_GenericTypeDefinitionContainsGenericVariables(TestConfiguration config) { - // TODO: use default debuggee as soon as heap dumps are fixed - InitializeDumpTest(config, "LocalVariables", "full"); IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; ILoader loader = Target.Contracts.Loader; diff --git a/src/native/managed/cdac/tests/DumpTests/StackReferenceDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/StackReferenceDumpTests.cs index 952b361636a6f8..fe299495996aa4 100644 --- a/src/native/managed/cdac/tests/DumpTests/StackReferenceDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/StackReferenceDumpTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.Diagnostics.DataContractReader.DumpTests; public class StackReferenceDumpTests : DumpTestBase { protected override string DebuggeeName => "StackWalk"; - protected override string DumpType => "full"; // --- StackWalk debuggee: basic stack walk --- @@ -23,7 +22,7 @@ public class StackReferenceDumpTests : DumpTestBase [SkipOnVersion("net10.0", "InlinedCallFrame.Datum was added after net10.0")] public void WalkStackReferences_ReturnsWithoutThrowing(TestConfiguration config) { - InitializeDumpTest(config, "StackWalk", "full"); + InitializeDumpTest(config, "StackWalk", "heap"); IStackWalk stackWalk = Target.Contracts.StackWalk; ThreadData crashingThread = DumpTestHelpers.FindFailFastThread(Target); @@ -37,7 +36,7 @@ public void WalkStackReferences_ReturnsWithoutThrowing(TestConfiguration config) [SkipOnVersion("net10.0", "InlinedCallFrame.Datum was added after net10.0")] public void WalkStackReferences_RefsHaveValidSourceInfo(TestConfiguration config) { - InitializeDumpTest(config, "StackWalk", "full"); + InitializeDumpTest(config, "StackWalk", "heap"); IStackWalk stackWalk = Target.Contracts.StackWalk; ThreadData crashingThread = DumpTestHelpers.FindFailFastThread(Target); From b3c170b8d4c42cba3291b5421a7a49d7d2dfca8d Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Mon, 27 Apr 2026 18:48:51 -0700 Subject: [PATCH 09/10] Update RuntimeTypeSystemDumpTests.cs --- .../cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs index ffea2b2e2fbcde..f6a7e999ef5dc9 100644 --- a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs @@ -315,7 +315,8 @@ public void RuntimeTypeSystem_ConcreteTypesDoNotContainGenericVariables(TestConf [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_IsValueType(TestConfiguration config) - { + { + InitializeDumpTest(config); IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; ILoader loader = Target.Contracts.Loader; @@ -351,6 +352,7 @@ public void RuntimeTypeSystem_IsValueType(TestConfiguration config) [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_GenericTypeDefinitionContainsGenericVariables(TestConfiguration config) { + InitializeDumpTest(config); IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; ILoader loader = Target.Contracts.Loader; From 74552a462c16f0ef35d77d11abbad5901dc14e98 Mon Sep 17 00:00:00 2001 From: Rachel Jarvi Date: Mon, 27 Apr 2026 18:50:25 -0700 Subject: [PATCH 10/10] Update RuntimeTypeSystemDumpTests.cs --- .../managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs index f6a7e999ef5dc9..7abd590dff17e1 100644 --- a/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs +++ b/src/native/managed/cdac/tests/DumpTests/RuntimeTypeSystemDumpTests.cs @@ -315,7 +315,7 @@ public void RuntimeTypeSystem_ConcreteTypesDoNotContainGenericVariables(TestConf [ConditionalTheory] [MemberData(nameof(TestConfigurations))] public void RuntimeTypeSystem_IsValueType(TestConfiguration config) - { + { InitializeDumpTest(config); IRuntimeTypeSystem rts = Target.Contracts.RuntimeTypeSystem; ILoader loader = Target.Contracts.Loader;