Uh oh!
There was an error while loading. Please reload this page.
[cDAC] implement EnumerateInternalFrames and GetCountOfInternalFrames - #128241
Conversation
… in cDAC via new Thread_1.GetFrames Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
The PR's title and description say it deletes a single unused field (nativeCodeJITInfoToken) from DebuggerIPCE_JITFuncData, but the actual diff is a much larger reshape: the legacy DebuggerIPCE_* IPC structs (FuncData, JITFuncData, STRData) are renamed to Debugger_* and moved/restructured, the DAC Debugger_STRData now stores ctx/rd as CORDB_ADDRESS pointers into dbi-allocated buffers, Frame::GetStubFrameType() is added so GetInternalFrameType can replace its old transition/interception heuristics, and the cDAC gains real implementations of GetCountOfInternalFrames/EnumerateInternalFrames plus a new IStackWalk.GetFrames/IsExceptionHandlingHelperInlinedCallFrame/GetDebuggerEvalData surface (with tests and contract docs). The PR description significantly understates the scope of changes.
Changes:
- Rename and restructure the dbi/DAC stack frame IPC structs and switch
Debugger_STRData::ctx/rdto caller-allocated buffers referenced byCORDB_ADDRESS. - Add
Frame::GetStubFrameType()polymorphic dispatch and rewriteDacDbiInterfaceImpl::GetInternalFrameTypeon top of it. - Add cDAC
IStackWalk.GetFrames/IsExceptionHandlingHelperInlinedCallFrame/GetDebuggerEvalDataand use them to implementGetCountOfInternalFrames/EnumerateInternalFrames, with new mock infrastructure and tests.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/debug/inc/dbgipcevents.h | Removes legacy DebuggerIPCE_FuncData/JITFuncData/STRData definitions (now defined in dacdbistructures.h). |
| src/coreclr/debug/inc/dacdbistructures.h | Adds renamed Debugger_FuncData/Debugger_JITFuncData/Debugger_STRData with ctx/rd as CORDB_ADDRESS. |
| src/coreclr/debug/inc/dacdbistructures.inl | Updates NativeCodeFunctionData ctor to take Debugger_JITFuncData*. |
| src/coreclr/debug/inc/dacdbiinterface.h | Renames the IPC struct in interface signatures and comments. |
| src/coreclr/inc/dacdbi.idl | Renames DebuggerIPCE_STRData to Debugger_STRData in IDL. |
| src/coreclr/debug/daccess/dacdbiimpl.h | Updates dacdbi impl signatures to renamed types. |
| src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp | Updates rename, switches to caller-allocated ctx/rd, rewrites GetInternalFrameType via GetStubFrameType(); leaves a duplicate pJITFuncData->enCVersion assignment. |
| src/coreclr/vm/frames.h / frames.cpp | Adds Frame::StubFrameType enum, virtual GetStubFrameType_Impl per subclass, and dispatch. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Exposes DebuggerEval::m_methodToken/m_pAssembly to the cDAC data descriptor. |
| src/coreclr/debug/ee/debugger.h / debugger.cpp | Adds m_pAssembly to DebuggerEval and initializes it. |
| src/coreclr/debug/di/rsthread.cpp / rsstackwalk.cpp / rspriv.h | Updates dbi-side rename and allocates DT_CONTEXT/DebuggerREGDISPLAY for the new Debugger_STRData protocol. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IStackWalk.cs | Adds InternalFrameType, StackFrameData, DebuggerEvalData, and three new IStackWalk methods. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/StackWalk_1.cs | Implements GetFrames, IsExceptionHandlingHelperInlinedCallFrame, GetDebuggerEvalData. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/FrameHandling/FrameIterator.cs | Adds GetInternalFrameType/IsExceptionHandlingHelperInlinedCallFrame; the latter omits the FrameHasActiveCall check. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs | Adds using System.Collections.Generic; (looks unused locally — only the using is shown changed). |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/Frames/DebuggerEval.cs | Reads new MethodToken/AssemblyPtr fields. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs | Defines managed mirrors of the new Debugger_* structs and the EnumerateInternalFrames callback signature. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Provides cDAC implementations of GetCountOfInternalFrames/EnumerateInternalFrames with DEBUG-only DAC cross-validation. |
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Frame.cs | New mock Frame layouts and MockFrameBuilder helper. |
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.Thread.cs | Adds a public Frame accessor on MockThread. |
| src/native/managed/cdac/tests/StackWalkTests.cs | New tests for GetFrames, EH-helper ICF detection, and GetDebuggerEvalData. |
| docs/design/datacontracts/StackWalk.md | Documents the new APIs and EH-helper marker constant. |
Copilot's findings
- Files reviewed: 26/26 changed files
- Comments generated: 2
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
noahfalk
left a comment
There was a problem hiding this comment.
Looked good to me modulo a few comments inline
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rcj1
commented
May 19, 2026
/ba-g #128372 |
New StackWalk cDAC APIs: