[cDAC] Implement thread-related DacDbi APIs#126975
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/ebc56d23-ae7d-4d2c-b83d-d86d74c51e29 Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/ebc56d23-ae7d-4d2c-b83d-d86d74c51e29 Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Implements additional thread-related DacDbi APIs in the cDAC-based DacDbiImpl, extending the Thread contract/data descriptors and adding dump-based coverage to ensure the new APIs return values consistent with contract-provided thread state/handles.
Changes:
- Implement
GetThreadObject,HasUnhandledException,GetCurrentCustomDebuggerNotification, and updateGetCurrentExceptioninDacDbiImplusing the Thread contract. - Extend Thread contract data (
ThreadData) and contract implementation (Thread_1) to surface exposed thread object handle, unhandled-exception state, and custom debugger notification handle. - Update CoreCLR cDAC descriptors (
threads.h,datadescriptor.inc) and docs, plus add/adjust dump + mock-based tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs | Extends mock Thread layout with additional fields used by updated Thread contract/API behavior. |
| src/native/managed/cdac/tests/DumpTests/DacDbi/DacDbiThreadDumpTests.cs | Adds dump-based integration tests for the newly implemented DacDbi thread APIs and adjusts the current-exception test. |
| src/native/managed/cdac/tests/ClrDataExceptionStateTests.cs | Updates mocked ThreadData construction to include newly added record fields. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Implements the thread-related DacDbi APIs via cDAC contracts (with DEBUG cross-validation against legacy DAC where available). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/Thread.cs | Adds reading of new Thread data descriptor fields (exposed object, LTO-unhandled flag, custom notification). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs | Extends v1 Thread contract to compute detached state + unhandled-exception semantics and populate the expanded ThreadData. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/CorDbHResults.cs | Adds CORDBG_E_BAD_THREAD_STATE constant used by GetThreadObject. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IThread.cs | Expands ThreadState/ThreadData and removes GetThrowableObject from the abstraction contract. |
| src/coreclr/vm/threads.h | Adds cDAC field offsets for last-thrown-unhandled flag and current custom notification handle. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Adds Thread data descriptor fields and fixes naming/typing for handle-based fields. |
| docs/design/datacontracts/Thread.md | Updates Thread contract documentation to reflect the expanded ThreadData and required data descriptors. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
…least one has an exception Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/b90daa71-7183-49bc-93df-385c2013d983 Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
🤖 Copilot Code Review — PR #126975Note This review was generated by Copilot. Holistic AssessmentMotivation: The PR renames the cDAC data type Approach: The rename itself is clean and mechanical. However, the method used to read the handle fields on Summary: ❌ Needs Changes. The switch to Detailed Findings❌ Wrong indirection level —
|
219666b to
6625777
Compare
GetThreadObject,HasUnhandledException,GetCurrentCustomDebuggerNotification, andGetCurrentException