mirror of https://github.com/acidanthera/audk.git
After the ASSERT adjust the PC so you skip the faulting instruction. Lets you walk out of the exception handler and keeprunning code. This way you can walk out of the call stack.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10010 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
026e30c4bb
commit
d629c28396
|
@ -225,6 +225,7 @@ DefaultExceptionHandler (
|
|||
{
|
||||
UINT32 DfsrStatus;
|
||||
BOOLEAN DfsrWrite;
|
||||
UINT32 PcAdjust = 0;
|
||||
|
||||
DEBUG ((EFI_D_ERROR, "\n%a Exception PC at 0x%08x CPSR 0x%08x ", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR));
|
||||
DEBUG_CODE_BEGIN ();
|
||||
|
@ -260,6 +261,19 @@ DefaultExceptionHandler (
|
|||
ItBlock = 0;
|
||||
DisassembleInstruction (&DisAsm, (SystemContext.SystemContextArm->CPSR & BIT5) == BIT5, TRUE, &ItBlock, Buffer, sizeof (Buffer));
|
||||
DEBUG ((EFI_D_ERROR, "\n%a", Buffer));
|
||||
|
||||
switch (ExceptionType) {
|
||||
case EXCEPT_ARM_UNDEFINED_INSTRUCTION:
|
||||
case EXCEPT_ARM_SOFTWARE_INTERRUPT:
|
||||
case EXCEPT_ARM_PREFETCH_ABORT:
|
||||
case EXCEPT_ARM_DATA_ABORT:
|
||||
// advance PC past the faulting instruction
|
||||
PcAdjust = (UINTN)DisAsm - SystemContext.SystemContextArm->PC;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
DEBUG_CODE_END ();
|
||||
|
@ -281,6 +295,9 @@ DefaultExceptionHandler (
|
|||
|
||||
DEBUG ((EFI_D_ERROR, "\n"));
|
||||
ASSERT (FALSE);
|
||||
|
||||
// If some one is stepping past the exception handler adjust the PC to point to the next instruction
|
||||
SystemContext.SystemContextArm->PC += PcAdjust;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue