Skip to content

Conversation

@max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Jun 16, 2025

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.

Copilot AI review requested due to automatic review settings June 16, 2025 22:11
Copy link
Contributor

Copilot AI left a 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.

@dotnet-policy-service
Copy link
Contributor

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

@max-charlamb
Copy link
Member Author

max-charlamb commented Jun 17, 2025

/azp run runtime-diagnostics

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@am11 am11 left a comment

Choose a reason for hiding this comment

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

One nit, otherwise LGTM! 👍

cc @filipnavara managed stack unwinding! 💡

@max-charlamb max-charlamb merged commit 05105f1 into dotnet:main Jun 20, 2025
42 of 44 checks passed
@max-charlamb max-charlamb deleted the managed-arm64 branch June 20, 2025 20:04
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2025
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.

3 participants