diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp index 167e3c0c..062e8dfd 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp @@ -13,7 +13,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::Exception; - void ReadMemory::init() { + ReadMemory::ReadMemory(const std::vector& rawPacket) + : AbstractMemoryAccessPacket(rawPacket) + { if (this->data.size() < 4) { throw Exception("Invalid packet length"); } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp index 4e0ab717..3968c7a8 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp @@ -15,11 +15,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets { public: /** - * The startAddress sent from the GDB client may include additional bits used to indicate the memory type. - * These bits have to be removed from the address before it can be used as a start address. This is not done - * here, as it's target specific. - * - * For an example of where GDB does this, see the AvrGdbRsp class. + * The startAddress sent from the GDB client will include additional bits used to indicate the memory type. + * These bits have to be removed from the address before it can be used as a start address. */ std::uint32_t startAddress = 0; @@ -28,13 +25,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets */ std::uint32_t bytes = 0; - explicit ReadMemory(const std::vector& rawPacket): AbstractMemoryAccessPacket(rawPacket) { - init(); - }; + explicit ReadMemory(const std::vector& rawPacket); void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override; - - protected: - void init(); }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp index d77261be..b8224a2b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp @@ -13,7 +13,9 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets using namespace Bloom::Exceptions; - void WriteMemory::init() { + WriteMemory::WriteMemory(const std::vector& rawPacket) + : AbstractMemoryAccessPacket(rawPacket) + { if (this->data.size() < 4) { throw Exception("Invalid packet length"); } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp index b1944269..9ffa4b2a 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp @@ -22,13 +22,8 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets Targets::TargetMemoryBuffer buffer; - explicit WriteMemory(const std::vector& rawPacket): AbstractMemoryAccessPacket(rawPacket) { - init(); - }; + explicit WriteMemory(const std::vector& rawPacket); void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override; - - private: - void init(); }; }