Skip to content

Conversation

@max-charlamb
Copy link
Member

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

Ports the AMD64 unwinder to managed code. The cDAC uses this managed version instead of deferring to the runtime native copy.

I'm leaving the native building infra in place until the ARM64 unwinder is ported and all of the native linking can be removed.

@max-charlamb
Copy link
Member Author

/azp run runtime-diagnostics

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@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

/azp run runtime-diagnostics

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@max-charlamb max-charlamb changed the title [cDAC] CI Test Run [cDAC] Move AMD64 Unwinder to managed code Jun 13, 2025
@max-charlamb max-charlamb marked this pull request as ready for review June 13, 2025 18:43
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 transitions the AMD64 unwinding logic from a static native helper call into fully managed code using the new AMD64Unwinder class.

  • Added a using for the AMD64Unwinder namespace.
  • Replaced Unwinder.AMD64Unwind(ref this, target) with instantiation of AMD64Unwinder and its Unwind method.
Comments suppressed due to low confidence (1)

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/AMD64Context.cs:54

  • This new managed unwinder path should be covered by unit or integration tests to ensure the behavior matches the previous native implementation under various stack scenarios.
AMD64Unwinder unwinder = new(target);

public void Unwind(Target target)
{
Unwinder.AMD64Unwind(ref this, target);
AMD64Unwinder unwinder = new(target);
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

Instantiating AMD64Unwinder on each call may introduce heap allocations in hot paths. If performance is critical, consider making AMD64Unwinder a struct or caching a single instance to minimize allocations.

Copilot uses AI. Check for mistakes.
@max-charlamb
Copy link
Member Author

/azp run runtime-diagnostics

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@max-charlamb
Copy link
Member Author

/ba-g test failures unrelated to cDAC change. Both runtime-diagnostics and CLR_Tools_Tests are passing.

@max-charlamb max-charlamb merged commit 0d628da into dotnet:main Jun 17, 2025
142 of 153 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 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.

2 participants