From d2b615061e008c4d13a6ce0f11efd8ec337f41c6 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 3 Sep 2022 17:33:07 +0300 Subject: Impl breakpoints (pretty much draft) Breakpoints work somehow, but overstep 1 instruction. Needs to be fixed. --- gdbremote_parser.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gdbremote_parser.hpp') diff --git a/gdbremote_parser.hpp b/gdbremote_parser.hpp index e060daa..370e8cc 100644 --- a/gdbremote_parser.hpp +++ b/gdbremote_parser.hpp @@ -94,6 +94,24 @@ struct PacketDataWriteMemory: public PacketData { virtual ~PacketDataWriteMemory() {} }; +enum class BreakpointType: uint32_t { + kMin = 0, + kSoftwareBreakpoint = 0, + kHardwareBreakpoint = 1, + kWriteWatchpoint = 2, + kReadWatchpoint = 3, + kAccessWatchpoint = 4, + kUnsupported // Keep it last and unassigned +}; + +struct PacketDataBreakpoint: public PacketData { + PacketDataBreakpoint(BreakpointType a_type, uint32_t a_offset, uint32_t a_length) + : type(a_type), offset(a_offset), length(a_length) {} + BreakpointType type{}; + uint32_t offset{}, length{}; + virtual ~PacketDataBreakpoint() {} +}; + struct Packet { const PacketType type{}; const std::unique_ptr data{nullptr}; -- cgit v1.2.3