mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #10330 from aldelaro5/gdb-stub-add-hostinfo
GDB Stub: add support for lldb's qHostInfo
This commit is contained in:
@ -28,6 +28,7 @@ typedef SSIZE_T ssize_t;
|
|||||||
#include "Common/Event.h"
|
#include "Common/Event.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/SocketContext.h"
|
#include "Common/SocketContext.h"
|
||||||
|
#include "Common/StringUtil.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/HW/CPU.h"
|
#include "Core/HW/CPU.h"
|
||||||
#include "Core/HW/Memmap.h"
|
#include "Core/HW/Memmap.h"
|
||||||
@ -60,6 +61,9 @@ enum class BreakpointType
|
|||||||
|
|
||||||
constexpr u32 NUM_BREAKPOINT_TYPES = 4;
|
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;
|
const s64 GDB_UPDATE_CYCLES = 100000;
|
||||||
|
|
||||||
static bool s_has_control = false;
|
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()
|
static void HandleQuery()
|
||||||
{
|
{
|
||||||
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString());
|
DEBUG_LOG_FMT(GDB_STUB, "gdb: query '{}'", CommandBufferAsString());
|
||||||
@ -322,6 +334,8 @@ static void HandleQuery()
|
|||||||
return SendReply("l");
|
return SendReply("l");
|
||||||
else if (!strncmp((const char*)(s_cmd_bfr), "qThreadExtraInfo", strlen("qThreadExtraInfo")))
|
else if (!strncmp((const char*)(s_cmd_bfr), "qThreadExtraInfo", strlen("qThreadExtraInfo")))
|
||||||
return SendReply("00");
|
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")))
|
else if (!strncmp((const char*)(s_cmd_bfr), "qSupported", strlen("qSupported")))
|
||||||
return SendReply("swbreak+;hwbreak+");
|
return SendReply("swbreak+;hwbreak+");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user