AArch64 CommonCExceptionHandler() and EFI_SYSTEM_CONTEXT

Andrew Fish

So I’m messing about in a DefaultExceptionHandler() (like [1]) that is called from CommonCExceptionHandler() [2]. What I notice is the faulting address is special cased. So the stack walking code has to dump the fault address and then walk the stack to get a stack trace of the fault. That kind of makes sense, but then when I connect with a debugger the stack trace I get is missing the faulting frame from the debugger.

My question is there something architectural that makes the debugger not work from this location? Does the exception code need to do some magic on the stack so a stack walk back would include the faulting are frame? I’m not 100% sure about AArch64. I seem to remember we messed with the X64 stack so the frame from the exception handler looked valid and included the faulting code.

[1] https://github.com/tianocore/edk2/blob/master/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c#L186
[2] https://github.com/tianocore/edk2/blob/master/ArmPkg/Library/ArmExceptionLib/ArmExceptionLib.c#L296


Andrew Fish

Join devel@edk2.groups.io to automatically receive all group messages.