Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

ARM64: Add more cfi data #8336

Merged

Conversation

RalfKornmannEnvision
Copy link
Contributor

@RalfKornmannEnvision RalfKornmannEnvision commented Sep 16, 2020

While the assembler helpers follow the ARM64 ABI and build a correct chain of frame information the debugger still have trouble to show a correct call stack when it include one of these assembler functions. The callstack either stops with with the last of these functions or shows it like it was called recursive It although makes stepping really slow. 

This fix adds additional cfi data based on the same prolog/epilog macros from CoreCLR. With this additional information the debugger can now show a correct callstack.

The modified macros caused some adjustments.

While the assembler helpers follow the ARM64 ABI and build a correct chain of frame information the debugger still have trouble to show a correct call stack when it include one of these assembler functions. The callstack either stops with with the last of these functions or shows it like it was called recursive It although makes stepping really slow. 

This fix adds additional cfi data for each frame that the assembler code adds on the stack. With this additional information the debugger can now show a correct callstack.
@RalfKornmannEnvision RalfKornmannEnvision marked this pull request as draft September 16, 2020 16:39
@RalfKornmannEnvision RalfKornmannEnvision marked this pull request as ready for review September 16, 2020 18:34
@RalfKornmannEnvision
Copy link
Contributor Author

The prolog/epilog macros are now all equal between CoreRT and CoreCLR. This should help merging both projects closer together if needed.

@@ -216,7 +238,7 @@

// x2 = GetThread()
#ifdef FEATURE_EMULATED_TLS
GETTHREAD_ETLS_2
bl RhpGetThreadETLS2
Copy link
Member

Choose a reason for hiding this comment

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

These exception handling methods are not performance critical at all. It would be fine to always call RhpGetThread directly from here, for both FEATURE_EMULATED_TLS and !FEATURE_EMULATED_TLS, without going through the multiple levels of macros and wrappers.

Note that callee saved registers are saved by ALLOC_THROW_FRAME. You can stash the arguments in one of them around the call.

Copy link
Member

Choose a reason for hiding this comment

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

This can be separate change. The multiple levels of macros are not that bad yet.

@jkotas jkotas merged commit bf551a0 into dotnet:master Sep 17, 2020
@jkotas
Copy link
Member

jkotas commented Sep 17, 2020

Thanks!

@RalfKornmannEnvision RalfKornmannEnvision deleted the ARM64-CFI-info-for-debugging branch September 17, 2020 05:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants