From ba9b99713f22243b29bdeb6bdd461e03c0882301 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 28 Jan 2020 01:18:17 +0000 Subject: [PATCH] thermosphere: GDB_TrySignalDebugEvent, do nothing if not attached --- thermosphere/src/gdb/debug.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/thermosphere/src/gdb/debug.c b/thermosphere/src/gdb/debug.c index 55aafd0a8..10d55f0f7 100644 --- a/thermosphere/src/gdb/debug.c +++ b/thermosphere/src/gdb/debug.c @@ -206,6 +206,15 @@ int GDB_TrySignalDebugEvent(GDBContext *ctx, DebugEventInfo *info) // Acquire the gdb lock/disable rx irq. We most likely block here. GDB_AcquireContext(ctx); + // Is the context not attached? + if (!GDB_IsAttached(ctx)) { + // Not attached, mark the event as handled, unpause + debugManagerMarkAndGetCoreDebugEvent(info->coreId); + debugManagerUnpauseCores(BIT(info->coreId), 0); + GDB_ReleaseContext(ctx); + return -1; + } + // Are we still paused & has the packet not been handled & are we allowed to send on our own? if (ctx->sendOwnDebugEventAllowed && !info->handled && debugManagerIsCorePaused(info->coreId)) {