From 116d0703f47ff5f0e2f7ee32775aaf51424e2b73 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Fri, 31 Jan 2020 23:54:42 +0000 Subject: [PATCH] thermosphere: actually report the debug events --- thermosphere/src/exceptions.c | 7 ++++++- thermosphere/src/gdb/context.c | 2 -- thermosphere/src/single_step.c | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/thermosphere/src/exceptions.c b/thermosphere/src/exceptions.c index 2e26729d8..f5e1ff628 100644 --- a/thermosphere/src/exceptions.c +++ b/thermosphere/src/exceptions.c @@ -169,7 +169,12 @@ void handleLowerElSyncException(ExceptionStackFrame *frame) case Exception_SoftwareStepLowerEl: handleSingleStep(frame, esr); break; - + case Exception_BreakpointLowerEl: + case Exception_WatchpointLowerEl: + case Exception_SoftwareBreakpointA64: + case Exception_SoftwareBreakpointA32: + debugManagerReportEvent(DBGEVENT_EXCEPTION); + break; default: DEBUG("Lower EL sync exception, EC = 0x%02llx IL=%llu ISS=0x%06llx\n", (u64)esr.ec, esr.il, esr.iss); dumpStackFrame(frame, false); diff --git a/thermosphere/src/gdb/context.c b/thermosphere/src/gdb/context.c index 5c7868c16..555f63f9f 100644 --- a/thermosphere/src/gdb/context.c +++ b/thermosphere/src/gdb/context.c @@ -88,8 +88,6 @@ static int GDB_ProcessPacket(GDBContext *ctx, size_t len) { int ret; - u32 oldFlags = ctx->flags; - ENSURE(ctx->state != GDB_STATE_DISCONNECTED); // Handle the packet... diff --git a/thermosphere/src/single_step.c b/thermosphere/src/single_step.c index 582cf24fe..204e47555 100644 --- a/thermosphere/src/single_step.c +++ b/thermosphere/src/single_step.c @@ -17,7 +17,7 @@ #include "single_step.h" #include "core_ctx.h" #include "sysreg.h" -#include "debug_log.h" +#include "debug_manager.h" SingleStepState singleStepGetNextState(ExceptionStackFrame *frame) { @@ -71,7 +71,7 @@ void handleSingleStep(ExceptionStackFrame *frame, ExceptionSyndromeRegister esr) } else { // Disable single-step singleStepSetNextState(frame, SingleStepState_Inactive); - // TODO report exception to gdb + debugManagerReportEvent(DBGEVENT_EXCEPTION); } DEBUG("Single-step exeception ELR = 0x%016llx, ISV = %u, EX = %u\n", frame->elr_el2, (esr.iss >> 24) & 1, (esr.iss >> 6) & 1);