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+");