Merge pull request #10299 from aldelaro5/gdb-stub-add-query-packets

GDB Stub: add support for various query packets
This commit is contained in:
JMC47 2021-12-29 19:37:28 -05:00 committed by GitHub
commit 01f180217b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 5 deletions

View File

@ -307,12 +307,20 @@ static void SendReply(const char* reply)
static void HandleQuery()
{
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString() + 1);
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString());
if (!strcmp((const char*)(s_cmd_bfr + 1), "TStatus"))
{
return SendReply("T0");
}
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("");
}