-
Notifications
You must be signed in to change notification settings - Fork 5k
[cDAC] Move ARM64 Stackwalking to managed code #116717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR moves ARM64 stackwalking to managed code, updating the unwind logic in ARM64Context and introducing managed lookup tables for unwind codes.
- Calls to the native unwinding routine are replaced with an instance of ARM64Unwinder for improved managed integration.
- New lookup tables, UnwindCodeSizeTable and UnwindCodeInstructionCountTable, are added using modern C# 12 array initialization syntax.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ARM64Context.cs | Updated the Unwind method to use ARM64Unwinder and added a relevant using directive to support managed code logic. |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/ARM64/LookupValues.cs | Introduced new lookup tables for unwind code sizes and instruction counts using modern C# 12 collection initialization syntax. |
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
/azp run runtime-diagnostics |
Azure Pipelines successfully started running 1 pipeline(s). |
No pipelines are associated with this pull request. |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be placed at src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/ARM64/
, next to existing src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/AMD64/
and /X86/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we can avoid the redundant arch directories by adding:
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Unwinder/
which will contain ARM64Unwinder.cs
, AMD64Unwinder.cs
, X86Unwinder.cs
and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll fix this
Ports the ARM64 unwinder to managed code. The cDAC uses this managed version instead of deferring to the runtime native copy.
I'll remove the native linking in a follow-up PR.