diff --git a/thermosphere/src/gdb/context.c b/thermosphere/src/gdb/context.c index 1a95634b5..b9a526884 100644 --- a/thermosphere/src/gdb/context.c +++ b/thermosphere/src/gdb/context.c @@ -127,7 +127,6 @@ static void GDB_Disconnect(GDBContext *ctx) ctx->flags = 0; ctx->state = GDB_STATE_DISCONNECTED; - ctx->currentThreadId = 0; ctx->selectedThreadId = 0; ctx->selectedThreadIdForContinuing = 0; ctx->sentDebugEventCoreList = 0; diff --git a/thermosphere/src/gdb/context.h b/thermosphere/src/gdb/context.h index 85d417014..c91df58f0 100644 --- a/thermosphere/src/gdb/context.h +++ b/thermosphere/src/gdb/context.h @@ -73,7 +73,6 @@ typedef struct GDBContext { u32 attachedCoreList; - u32 currentThreadId; int selectedThreadId; int selectedThreadIdForContinuing; diff --git a/thermosphere/src/gdb/debug.c b/thermosphere/src/gdb/debug.c index c49902084..38e167ae4 100644 --- a/thermosphere/src/gdb/debug.c +++ b/thermosphere/src/gdb/debug.c @@ -114,7 +114,6 @@ int GDB_SendStopReply(GDBContext *ctx, DebugEventInfo *info, bool asNotification case DBGEVENT_CORE_ON: { if (ctx->catchThreadEvents) { - ctx->currentThreadId = info->coreId + 1; // FIXME? strcat(buf, "T05create:;"); } else { invalid = true; @@ -145,7 +144,6 @@ int GDB_SendStopReply(GDBContext *ctx, DebugEventInfo *info, bool asNotification case DBGEVENT_EXCEPTION: { ExceptionClass ec = info->frame->esr_el2.ec; - ctx->currentThreadId = info->coreId + 1; // FIXME? // Aside from stage 2 translation faults and other pre-handled exceptions, // the only notable exceptions we get are stop point/single step events from the debugee (basically classes 0x3x) diff --git a/thermosphere/src/gdb/thread.c b/thermosphere/src/gdb/thread.c index 20062bfe1..a0915f6da 100644 --- a/thermosphere/src/gdb/thread.c +++ b/thermosphere/src/gdb/thread.c @@ -27,7 +27,7 @@ GDB_DECLARE_HANDLER(SetThreadId) } ctx->selectedThreadId = id == 0 ? (int)currentCoreCtx->coreId + 1 : (int)id; - // TODO: change irq affinity (and remove selectedThreadId?) + GDB_MigrateRxIrq(ctx, (u32)(ctx->selectedThreadId - 1)); return GDB_ReplyOk(ctx); } else if (ctx->commandData[0] == 'c') { if(strcmp(ctx->commandData + 1, "-1") == 0) { @@ -62,12 +62,7 @@ GDB_DECLARE_HANDLER(IsThreadAlive) GDB_DECLARE_QUERY_HANDLER(CurrentThreadId) { - if (ctx->currentThreadId == 0) { - // FIXME: probably remove this variable - ctx->currentThreadId = 1 + currentCoreCtx->coreId; - } - - return GDB_SendFormattedPacket(ctx, "QC%x", ctx->currentThreadId); + return GDB_SendFormattedPacket(ctx, "QC%x", 1 + currentCoreCtx->coreId); } GDB_DECLARE_QUERY_HANDLER(fThreadInfo)