Repository navigation
[cDAC] Implement DacDbi API GetUserState - #130208
Merged
Merged
Conversation
Co-authored-by: rcj1 <[email protected]>
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
Implements the cDAC DacDbi GetUserState API by composing existing thread/stack-walk contracts with a new GC-safepoint query, and adds cross-validation coverage in dump tests.
Changes:
- Implement
DacDbiImpl.GetUserStateby combining existing partial user state with a new “GC-unsafe point” bit derived from the thread IP. - Add
IsGcSafesupport to the ExecutionManager + GCInfo contract layers (including x86 and the general GCInfo decoder), and document the new APIs. - Add a dump test that cross-validates
GetUserStateagainst the contracts’ computed GC-safepoint status.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs | Adds dump-based cross-validation test for GetUserState vs contract-derived GC-safepoint state. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs | Adds CorDebugUserState.USER_UNSAFE_POINT flag used by GetUserState. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements GetUserState using contracts + stack context IP GC-safety check. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/X86/GCInfo.cs | Adds x86 IsGcSafe implementation and lazy decode of no-GC regions. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/IGCInfoDecoder.cs | Extends internal decoder interface with IsGcSafe. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfoX86_1.cs | Wires IsGcSafe through the x86 IGCInfo implementation. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfoDecoder.cs | Implements IsGcSafe for the general GCInfo decoder path. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GCInfo/GCInfo_1.cs | Wires IsGcSafe through the generic IGCInfo implementation. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.cs | Adds IExecutionManager.IsGcSafe using CodeBlock resolution + GCInfo decode. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_1.cs | Exposes IsGcSafe via contract version 1 wrapper. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_2.cs | Exposes IsGcSafe via contract version 2 wrapper. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IGCInfo.cs | Adds new public IGCInfo.IsGcSafe API. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IExecutionManager.cs | Adds new public IExecutionManager.IsGcSafe API. |
| docs/design/datacontracts/GCInfo.md | Documents IGCInfo.IsGcSafe. |
| docs/design/datacontracts/ExecutionManager.md | Documents IExecutionManager.IsGcSafe. |
Copilot's findings
- Files reviewed: 15/15 changed files
- Comments generated: 4
rcj1
marked this pull request as ready for review
July 5, 2026 01:21
max-charlamb
approved these changes
Jul 6, 2026
tommcdon
approved these changes
Jul 7, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
Implement this API with the use of GC-safety APIs on ExecutionManager (as a relatively thin wrapper) and GCInfo contracts. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement this API with the use of GC-safety APIs on ExecutionManager (as a relatively thin wrapper) and GCInfo contracts.