thermosphere: gdb: remove currentThreadId; migrate rx irq

This commit is contained in:
TuxSH 2020-01-31 00:36:15 +00:00
parent 02e2a1efa2
commit f0b9162d5e
4 changed files with 2 additions and 11 deletions

View file

@ -127,7 +127,6 @@ static void GDB_Disconnect(GDBContext *ctx)
ctx->flags = 0; ctx->flags = 0;
ctx->state = GDB_STATE_DISCONNECTED; ctx->state = GDB_STATE_DISCONNECTED;
ctx->currentThreadId = 0;
ctx->selectedThreadId = 0; ctx->selectedThreadId = 0;
ctx->selectedThreadIdForContinuing = 0; ctx->selectedThreadIdForContinuing = 0;
ctx->sentDebugEventCoreList = 0; ctx->sentDebugEventCoreList = 0;

View file

@ -73,7 +73,6 @@ typedef struct GDBContext {
u32 attachedCoreList; u32 attachedCoreList;
u32 currentThreadId;
int selectedThreadId; int selectedThreadId;
int selectedThreadIdForContinuing; int selectedThreadIdForContinuing;

View file

@ -114,7 +114,6 @@ int GDB_SendStopReply(GDBContext *ctx, DebugEventInfo *info, bool asNotification
case DBGEVENT_CORE_ON: { case DBGEVENT_CORE_ON: {
if (ctx->catchThreadEvents) { if (ctx->catchThreadEvents) {
ctx->currentThreadId = info->coreId + 1; // FIXME?
strcat(buf, "T05create:;"); strcat(buf, "T05create:;");
} else { } else {
invalid = true; invalid = true;
@ -145,7 +144,6 @@ int GDB_SendStopReply(GDBContext *ctx, DebugEventInfo *info, bool asNotification
case DBGEVENT_EXCEPTION: { case DBGEVENT_EXCEPTION: {
ExceptionClass ec = info->frame->esr_el2.ec; ExceptionClass ec = info->frame->esr_el2.ec;
ctx->currentThreadId = info->coreId + 1; // FIXME?
// Aside from stage 2 translation faults and other pre-handled exceptions, // 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) // the only notable exceptions we get are stop point/single step events from the debugee (basically classes 0x3x)

View file

@ -27,7 +27,7 @@ GDB_DECLARE_HANDLER(SetThreadId)
} }
ctx->selectedThreadId = id == 0 ? (int)currentCoreCtx->coreId + 1 : (int)id; 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); return GDB_ReplyOk(ctx);
} else if (ctx->commandData[0] == 'c') { } else if (ctx->commandData[0] == 'c') {
if(strcmp(ctx->commandData + 1, "-1") == 0) { if(strcmp(ctx->commandData + 1, "-1") == 0) {
@ -62,12 +62,7 @@ GDB_DECLARE_HANDLER(IsThreadAlive)
GDB_DECLARE_QUERY_HANDLER(CurrentThreadId) GDB_DECLARE_QUERY_HANDLER(CurrentThreadId)
{ {
if (ctx->currentThreadId == 0) { return GDB_SendFormattedPacket(ctx, "QC%x", 1 + currentCoreCtx->coreId);
// FIXME: probably remove this variable
ctx->currentThreadId = 1 + currentCoreCtx->coreId;
}
return GDB_SendFormattedPacket(ctx, "QC%x", ctx->currentThreadId);
} }
GDB_DECLARE_QUERY_HANDLER(fThreadInfo) GDB_DECLARE_QUERY_HANDLER(fThreadInfo)