summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-01-03 12:43:57 +0100
committerGitHub <noreply@github.com>2022-01-03 12:43:57 +0100
commit04a25818b2ccfea20b232e33493742378fb17bd7 (patch)
tree14dd5a52ad9c78ef191219add2ff70eab41f5c1e /Source/Core
parent953eb49cd8f52495b0cde80487f19c0dc279ca25 (diff)
parentd705a5fe9babd48019116b78398c06453c0e512b (diff)
Merge pull request #10330 from aldelaro5/gdb-stub-add-hostinfo
GDB Stub: add support for lldb's qHostInfo
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/GDBStub.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/GDBStub.cpp b/Source/Core/Core/PowerPC/GDBStub.cpp
index e3b214b586..2bf260d49e 100644
--- a/Source/Core/Core/PowerPC/GDBStub.cpp
+++ b/Source/Core/Core/PowerPC/GDBStub.cpp
@@ -28,6 +28,7 @@ typedef SSIZE_T ssize_t;
#include "Common/Event.h"
#include "Common/Logging/Log.h"
#include "Common/SocketContext.h"
+#include "Common/StringUtil.h"
#include "Core/Core.h"
#include "Core/HW/CPU.h"
#include "Core/HW/Memmap.h"
@@ -60,6 +61,9 @@ enum class BreakpointType
constexpr u32 NUM_BREAKPOINT_TYPES = 4;
+constexpr int MACH_O_POWERPC = 18;
+constexpr int MACH_O_POWERPC_750 = 9;
+
const s64 GDB_UPDATE_CYCLES = 100000;
static bool s_has_control = false;
@@ -308,6 +312,14 @@ static void SendReply(const char* reply)
}
}
+static void WriteHostInfo()
+{
+ return SendReply(
+ fmt::format("cputype:{};cpusubtype:{};ostype:unknown;vendor:unknown;endian:big;ptrsize:4",
+ MACH_O_POWERPC, MACH_O_POWERPC_750)
+ .c_str());
+}
+
static void HandleQuery()
{
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString());
@@ -322,6 +334,8 @@ static void HandleQuery()
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), "qHostInfo", strlen("qHostInfo")))
+ return WriteHostInfo();
else if (!strncmp((const char*)(s_cmd_bfr), "qSupported", strlen("qSupported")))
return SendReply("swbreak+;hwbreak+");