Skip to content

[cDAC] Implement DacDbi API GetUserState - #130208

Merged
rcj1 merged 2 commits into
mainfrom
copilot/implement-dacdbi-getuserstate
Jul 7, 2026
Merged

rcj1 merged 2 commits into
mainfrom
copilot/implement-dacdbi-getuserstate

Conversation

@rcj1

@rcj1 rcj1 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Implement this API with the use of GC-safety APIs on ExecutionManager (as a relatively thin wrapper) and GCInfo contracts.

Copilot AI review requested due to automatic review settings July 5, 2026 00:00
@rcj1 rcj1 changed the title Implement cDAC dacdbi GetUserState [cDAC] Implement DacDbi API GetUserState Jul 5, 2026
@rcj1 rcj1 self-assigned this Jul 5, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.GetUserState by combining existing partial user state with a new “GC-unsafe point” bit derived from the thread IP.
  • Add IsGcSafe support 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 GetUserState against 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
rcj1 marked this pull request as ready for review July 5, 2026 01:21
Copilot AI review requested due to automatic review settings July 7, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 15/15 changed files
  • Comments generated: 3

@rcj1
rcj1 merged commit ac421d0 into main Jul 7, 2026
78 of 79 checks passed
@rcj1
rcj1 deleted the copilot/implement-dacdbi-getuserstate branch July 7, 2026 22:05
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 8, 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]>
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants