Repository navigation
[cDAC] Stack Walking #110758
Description
In order to support SOS !analyze the cDAC must implement stack walking through the following APIs:
IXCLRDataTask::CreateStackWalk();
IXCLRDataStackWalk::Request(DACSTACKPRIV_REQUEST_FRAME_DATA, ...);
IXCLRDataStackWalk::GetContext();
IXCLRDataStackWalk::Next();For more infomation on stackwalking, see StackWalk.md
Work Items
-
Covert Frames to use an Enum intead of vptr #111875 - Use enum for frametype not v table #112166 Required to identify Frames through datadescriptors at compile time.
-
Convert dynamically linked native libs to statically linked [cDAC] Statically link in native dependencies #113627
-
Fetching initial thread context - [cDAC] Implement core stackwalking #111759
-
cDAC native interop to call unwinders - [cDAC] Implement core stackwalking #111759
-
Automate SOS tests to run against cDAC in CI
-
[cDAC] Support building and linking cross targeted cDAC unwinders on all platforms #112272
-
[cDAC] Implement support for filtering on
IXCLRDataTask::CreateStackWalk#112277 -
Create cDAC entrypoint same as DAC
CLRDataCreateInstance#112583
Lower Priority Items
- Support flags in
IXCLRDataTask.CreateStackWalk#112366 - Not used in!analyze - [cDAC] Implement
IXCLRDataStackWalk::Requestsupport forCLRDATA_REQUEST_REVISIONandCLRDATA_STACK_WALK_REQUEST_SET_FIRST_FRAME#112275 - Not used in!analyze
x64 and arm64 specific Work Items
Initial implementation will focus on x64 stack walking before expanding to all supported platforms.
- Create managed data structures for windows system
CONTEXTon x64 and arm64. [cDAC] Implement core stackwalking #111759 - Support Native Unwinders on x64 and arm64 - [cDAC] Implement core stackwalking #111759
- Design cDAC level API to expose stack walking #111734 - [cDAC] Implement core stackwalking #111759
- Implement Contract level APIs that will be used for managed stack walking through the
IXCLRDataStackWalk- [cDAC] Implement core stackwalking #111759 - Support linking native libraries to cDAC on non-Windows platforms #112416
Lower Priority Items
x86 and arm32 specific Work Items
- Create managed data structures for windows system
CONTEXTon x86 and arm32 - [cDAC] Stackwalking support all Frame types #114019
- [cDAC] ARM Stackwalking #116645
Paths Forwards
- Independent Work
- Complete Frame support
- Cross-platform building
- Filtering flags
- ARM32/x86 Support. Should wait for x86 to use funclets before adding support?
- SOS Work
- Flip to invoke cDAC directly, allow testing on platforms where the cross-DAC is not available.
- Automated testing
- Testing with customer dumps - Include all required datadescriptors ASAP to allow verification on customer dumps.
- Threat Model
Activity
[-]Contracts Required for Stack walking[/-][+][cDAC] Contract implementations needed for managed stack walking[/+]dotnet-policy-service commentedon Dec 16, 2024
Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.
jkoritzinsky commentedon Dec 18, 2024
I would recommend the following approach for the context:
T_CONTEXTshould be an opaque (to cdac) struct with a defined size in the data descriptor for the current platform. If any of the registers are used as part of stackwalking (likely the instruction pointer, stack pointer, frame pointer), there should be well-known field names for those concepts, which each runtime's data descriptor maps to the right registers.If it was desired to map all registers and offsets to manually assign them out at the cDAC boundary, the data descriptor could have all of the fields for all of the register names for each platform, and then the cdac would do an if-else chain to dynamically read the field offsets and assign them to the buffer depending on the target runtime's architecture. However, even in this case, I'd recommend having well-known names for the above-mentioned registers if there's any contract implementation or logic that uses them as it makes it easier to implement the algorithms with less platform-specific goo.
5 remaining items
IXCLRDataTask::CreateStackWalk#112277CLRDataCreateInstance#112583[cDAC] Add support to run SOS tests against the cDAC (#5350)
[-][cDAC] Contract implementations needed for managed stack walking[/-][+][cDAC] Stack Walking[/+][cDAC] Add support to run SOS tests against the cDAC (dotnet#5350)