1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-22 02:12:06 +00:00

thermosphere: gdb: fix IsThreadAlive

This commit is contained in:
TuxSH 2020-02-02 19:17:30 +00:00
parent 67daf5a73e
commit 3556c12960

View file

@ -53,12 +53,12 @@ GDB_DECLARE_HANDLER(IsThreadAlive)
{ {
unsigned long threadId; unsigned long threadId;
if (GDB_ParseHexIntegerList(&threadId, ctx->commandData, 1, 0) == NULL) { if (GDB_ParseHexIntegerList(&threadId, ctx->commandData, 1, 0) == NULL || threadId < 1) {
return GDB_ReplyErrno(ctx, EILSEQ); return GDB_ReplyErrno(ctx, EILSEQ);
} }
u32 coreMask = ctx->attachedCoreList; u32 coreMask = ctx->attachedCoreList;
return (coreMask & BIT(threadId)) != 0 ? GDB_ReplyOk(ctx) : GDB_ReplyErrno(ctx, ESRCH); return (coreMask & BIT(threadId - 1)) != 0 ? GDB_ReplyOk(ctx) : GDB_ReplyErrno(ctx, ESRCH);
} }
GDB_DECLARE_QUERY_HANDLER(CurrentThreadId) GDB_DECLARE_QUERY_HANDLER(CurrentThreadId)