Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10299 from aldelaro5/gdb-stub-add-query-packets
GDB Stub: add support for various query packets
  • Loading branch information
JMC47 committed Dec 30, 2021
2 parents 1c8a7f1 + b369d82 commit 01f1802
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Source/Core/Core/PowerPC/GDBStub.cpp
Expand Up @@ -307,12 +307,20 @@ static void SendReply(const char* reply)

static void HandleQuery()
{
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString() + 1);

if (!strcmp((const char*)(s_cmd_bfr + 1), "TStatus"))
{
return SendReply("T0");
}
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString());

if (!strncmp((const char*)(s_cmd_bfr), "qAttached", strlen("qAttached")))
return SendReply("1");
if (!strcmp((const char*)(s_cmd_bfr), "qC"))
return SendReply("QC1");
if (!strcmp((const char*)(s_cmd_bfr), "qfThreadInfo"))
return SendReply("m1");
else if (!strcmp((const char*)(s_cmd_bfr), "qsThreadInfo"))
return SendReply("l");
else if (!strncmp((const char*)(s_cmd_bfr), "qThreadExtraInfo", strlen("qThreadExtraInfo")))
return SendReply("00");
else if (!strncmp((const char*)(s_cmd_bfr), "qSupported", strlen("qSupported")))
return SendReply("swbreak+;hwbreak+");

SendReply("");
}
Expand Down

0 comments on commit 01f1802

Please sign in to comment.