summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authoraldelaro5 <aldelaro5@gmail.com>2021-12-27 08:08:55 -0500
committeraldelaro5 <aldelaro5@gmail.com>2021-12-28 23:34:33 -0500
commitb369d822b110ec9e65381ff35e4479f25bdbc66e (patch)
treef40ed328daf196b5f5b36978865c9f906938c9c5 /Source/Core
parenta29d7625ddb67f29f6dc46858b2b1488b72fd42b (diff)
GDB Stub: add support for various query packets
These tends to get requested from either pure GDB or Ghidra. They reduce the verbosity of the communications. The QSupported packet is also important to implemnent for future proofing too.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/GDBStub.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Core/Core/PowerPC/GDBStub.cpp b/Source/Core/Core/PowerPC/GDBStub.cpp
index 45896ec4ab..9e80cebbf0 100644
--- a/Source/Core/Core/PowerPC/GDBStub.cpp
+++ b/Source/Core/Core/PowerPC/GDBStub.cpp
@@ -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("");
}