Uh oh!
There was an error while loading. Please reload this page.
[cDAC] Implement CheckContext for cDAC - #128503
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR wires up DacDbiImpl.CheckContext in the managed cDAC implementation by parsing the incoming platform context buffer and (when control flags are present) validating the stack pointer against the thread’s cached stack bounds. On the native DAC side, it removes the UNSUPPORTED_DbgSkipStackCheck opt-out and related globals.
Changes:
- Implement
DacDbiImpl.CheckContextin managed code with stack-pointer range validation gated on context control flags. - Extend the platform context abstractions to expose
ContextControlFlagsfor architecture-specific masking. - Add targeted unit tests for
CheckContextand remove skip-stack-check knob/logic from the native DAC implementation.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/DacDbiImplTests.cs | Adds unit tests covering CheckContext behavior for control-flag vs no-control-flag scenarios across target-arch strings. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements managed CheckContext logic (reads context bytes, conditionally validates SP range, returns HRESULTs). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/IPlatformContext.cs | Adds ContextControlFlags to the public platform context interface. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/IPlatformAgnosticContext.cs | Adds ContextControlFlags to the public platform-agnostic context interface. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ContextHolder.cs | Plumbs ContextControlFlags through the ContextHolder<T> wrapper. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/AMD64Context.cs | Provides architecture-specific ContextControlFlags value for AMD64 contexts. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ARMContext.cs | Provides architecture-specific ContextControlFlags value for ARM contexts. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ARM64Context.cs | Provides architecture-specific ContextControlFlags value for ARM64 contexts. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/LoongArch64Context.cs | Provides architecture-specific ContextControlFlags value for LoongArch64 contexts. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/RISCV64Context.cs | Provides architecture-specific ContextControlFlags value for RISC-V64 contexts. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/X86Context.cs | Provides architecture-specific ContextControlFlags value for x86 contexts (public type). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/CorDbHResults.cs | Adds CORDBG_E_NON_MATCHING_CONTEXT constant for managed HRESULT parity. |
| src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp | Removes UNSUPPORTED_DbgSkipStackCheck-based bypass and dead globals; always enforces stack-range check when control flags are present. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Implements
CheckContextin the managed cDAC. Removes theUNSUPPORTED_DbgSkipStackCheckconfig bypass from the native DAC.Changes
ContextControlFlagsproperty to the platform context interface hierarchyDbgSkipStackCheckconfig knob, dead globals, and skip logic from native DACTests