thermosphere: add structural changes needed for range step

This commit is contained in:
TuxSH
2020-01-28 01:13:21 +00:00
parent cba5c08bbc
commit 52c3397b19
4 changed files with 29 additions and 4 deletions

View File

@@ -62,8 +62,17 @@ void singleStepSetNextState(ExceptionStackFrame *frame, SingleStepState state)
void handleSingleStep(ExceptionStackFrame *frame, ExceptionSyndromeRegister esr)
{
// Disable single-step ASAP
singleStepSetNextState(NULL, SingleStepState_Inactive);
uintptr_t addr = frame->elr_el2;
// Stepping range support;
if (addr >= currentCoreCtx->steppingRangeStartAddr && addr < currentCoreCtx->steppingRangeEndAddr) {
// Reactivate single-step
singleStepSetNextState(frame, SingleStepState_ActiveNotPending);
} else {
// Disable single-step
singleStepSetNextState(frame, SingleStepState_Inactive);
// TODO report exception to gdb
}
DEBUG("Single-step exeception ELR = 0x%016llx, ISV = %u, EX = %u\n", frame->elr_el2, (esr.iss >> 24) & 1, (esr.iss >> 6) & 1);
}