Skip to content

Fix issues are stackwalking, and viewing Exception stack walks in the debugger #115405

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

Merged
merged 2 commits into from
May 8, 2025

Conversation

davidwrighton
Copy link
Member

These issues are fallout from #114582 and #115253

Copy link
Contributor

@Copilot 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 addresses issues in stackwalking and debugging of exception stack traces by refining how context registers are updated and managed. Key changes include:

  • Modifying ExceptionObject::GetStackTrace in object.h to conditionally pass either NULL or GetThread() based on DACCESS_COMPILE.
  • Restricting the declaration of m_ContextPointers in frames.h to appropriate build configurations.
  • Updating the macros in excep.cpp so that in FEATURE_EH_FUNCLETS mode, the register locations are set using addresses of m_Context fields, and in the alternative mode, registers are copied from the transition block.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/object.h Adjusts GetStackTrace call parameters depending on DACCESS_COMPILE.
src/coreclr/vm/frames.h Conditionally declares m_ContextPointers to match differences between platforms and build flags.
src/coreclr/vm/excep.cpp Updates register location macros to correctly set register pointers for exception handling.
Comments suppressed due to low confidence (2)

src/coreclr/vm/frames.h:1043

  • [nitpick] Verify that the conditional declaration of m_ContextPointers is sufficient for all build configurations. In particular, ensure that on TARGET_X86 builds without FEATURE_EH_FUNCLETS, the absence of m_ContextPointers does not lead to missing context updates.
#if !defined(TARGET_X86) || defined(FEATURE_EH_FUNCLETS)

src/coreclr/vm/excep.cpp:11344

  • [nitpick] Confirm that updating register locations using the address of m_Context fields (&m_Context.regname) correctly meets the intended semantics for FEATURE_EH_FUNCLETS and does not introduce unintended pointer issues compared to the previous usage.
#define CALLEE_SAVED_REGISTER(regname) pRD->Set##regname##Location(&m_Context.regname);

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@filipnavara filipnavara left a comment

Choose a reason for hiding this comment

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

Thanks!

@davidwrighton davidwrighton requested a review from thaystg May 8, 2025 20:39
@davidwrighton davidwrighton merged commit 23c9717 into dotnet:main May 8, 2025
96 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 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