From 03ddc0b16ccb8fd819e5f6aadf683c3c5764d618 Mon Sep 17 00:00:00 2001 From: Anton Kovalev Date: Tue, 30 May 2023 19:44:00 +0200 Subject: [PATCH] Debugger: Added single step debugging --- pcsx2/DebugTools/GDBServer.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pcsx2/DebugTools/GDBServer.h b/pcsx2/DebugTools/GDBServer.h index fa4aa60dcfe11c..175280af921319 100644 --- a/pcsx2/DebugTools/GDBServer.h +++ b/pcsx2/DebugTools/GDBServer.h @@ -69,6 +69,28 @@ class GDBServer final : public DebugServerInterface bool processReadMemoryPacket(const std::string_view& data); bool processWriteMemoryPacket(const std::string_view& data, bool binary); +private: + u32 getRegisterSize(int id); + bool readRegister(int threadId, int id, u32& value); + bool writeRegister(int threadId, int id, u32 value); + +private: + bool writePacketBegin(); + bool writePacketEnd(); + bool writePacketData(const char* data, std::size_t size); + + bool writeBaseResponse(std::string_view data); + bool writeThreadId(int threadId, int processId = 1); + bool writeRegisterValue(int threadId, int registerNumber); + bool writeAllRegisterValues(int threadId); + +private: + bool processXferPacket(std::string_view data); + bool processQueryPacket(std::string_view data); + bool processGeneralQueryPacket(std::string_view data); + bool processMultiletterPacket(std::string_view data); + bool processThreadPacket(std::string_view data); + private: int m_stateThreadCounter = -1; std::vector> m_stateThreads;