From b6cbdf5a0ddf6239e7007034a8c0a701207b4860 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 26 Oct 2024 16:19:05 +0100 Subject: [PATCH] Changed AVR-GDB command packet class to a bare interface class --- src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp | 4 +++- src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp | 9 ++++++--- ...ndPacket.hpp => AvrGdbCommandPacketInterface.hpp} | 12 ++---------- .../Gdb/AvrGdb/CommandPackets/EepromFill.cpp | 4 ++-- .../Gdb/AvrGdb/CommandPackets/EepromFill.hpp | 7 ++++--- .../Gdb/AvrGdb/CommandPackets/FlashDone.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashDone.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/FlashErase.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashErase.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/FlashWrite.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/FlashWrite.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/ReadMemory.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadMemory.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/ReadRegister.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadRegister.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadRegisters.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp | 7 +++++-- .../CommandPackets/VContSupportedActionsQuery.cpp | 2 +- .../CommandPackets/VContSupportedActionsQuery.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/WriteMemory.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/WriteMemory.hpp | 7 +++++-- .../Gdb/AvrGdb/CommandPackets/WriteRegister.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/WriteRegister.hpp | 7 +++++-- 27 files changed, 83 insertions(+), 52 deletions(-) rename src/DebugServer/Gdb/AvrGdb/CommandPackets/{CommandPacket.hpp => AvrGdbCommandPacketInterface.hpp} (68%) diff --git a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp index 0db5bf9c..f17f365d 100644 --- a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp +++ b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp @@ -45,7 +45,9 @@ namespace DebugServer::Gdb::AvrGdb return "AVR GDB Remote Serial Protocol Debug Server"; } - std::unique_ptr AvrGdbRsp::rawPacketToCommandPacket(const RawPacket& rawPacket) { + std::unique_ptr AvrGdbRsp::rawPacketToCommandPacket( + const RawPacket& rawPacket + ) { using Gdb::CommandPackets::Monitor; using CommandPackets::ReadRegister; diff --git a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp index eaead451..01d2b252 100644 --- a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp +++ b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp @@ -5,11 +5,12 @@ #include "src/DebugServer/Gdb/GdbRspDebugServer.hpp" #include "AvrGdbTargetDescriptor.hpp" -#include "CommandPackets/CommandPacket.hpp" +#include "CommandPackets/AvrGdbCommandPacketInterface.hpp" namespace DebugServer::Gdb::AvrGdb { - class AvrGdbRsp: public GdbRspDebugServer + class AvrGdbRsp + : public GdbRspDebugServer { public: AvrGdbRsp( @@ -22,7 +23,9 @@ namespace DebugServer::Gdb::AvrGdb std::string getName() const override; protected: - std::unique_ptr rawPacketToCommandPacket(const RawPacket& rawPacket) override; + std::unique_ptr rawPacketToCommandPacket( + const RawPacket& rawPacket + ) override; std::set>> getSupportedFeatures() override; void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) override; }; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/CommandPacket.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/AvrGdbCommandPacketInterface.hpp similarity index 68% rename from src/DebugServer/Gdb/AvrGdb/CommandPackets/CommandPacket.hpp rename to src/DebugServer/Gdb/AvrGdb/CommandPackets/AvrGdbCommandPacketInterface.hpp index 189dc733..2b4bd4ca 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/CommandPacket.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/AvrGdbCommandPacketInterface.hpp @@ -8,18 +8,10 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets { - class CommandPacket: public Gdb::CommandPackets::CommandPacket + class AvrGdbCommandPacketInterface { public: - explicit CommandPacket(const RawPacket& rawPacket) - : Gdb::CommandPackets::CommandPacket(rawPacket) - {} - - explicit CommandPacket(const Gdb::CommandPackets::CommandPacket& commandPacket) - : Gdb::CommandPackets::CommandPacket(commandPacket) - {} - - virtual ~CommandPacket() = default; + virtual ~AvrGdbCommandPacketInterface() = default; /** * Should handle the command for the current active debug session. diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp index b6b2c6c2..23cb6c8b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp @@ -24,8 +24,8 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::InvalidCommandOption; EepromFill::EepromFill(Gdb::CommandPackets::Monitor&& monitorPacket) - : CommandPacket(monitorPacket) - , rawFillValue(monitorPacket.commandArguments.size() >= 3 ? monitorPacket.commandArguments[2] : std::string{}) + : Gdb::CommandPackets::Monitor(std::move(monitorPacket)) + , rawFillValue(this->commandArguments.size() >= 3 ? this->commandArguments[2] : std::string{}) {} void EepromFill::handle( diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.hpp index 8aed0253..07011211 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.hpp @@ -3,8 +3,7 @@ #include #include -#include "CommandPacket.hpp" - +#include "AvrGdbCommandPacketInterface.hpp" #include "src/DebugServer/Gdb/CommandPackets/Monitor.hpp" namespace DebugServer::Gdb::AvrGdb::CommandPackets @@ -14,7 +13,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * * This command fills the target's EEPROM with the given value. */ - class EepromFill: public CommandPackets::CommandPacket + class EepromFill + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::Monitor { public: std::string rawFillValue; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp index bc78d8f1..476e475f 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.cpp @@ -16,7 +16,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using namespace Exceptions; FlashDone::FlashDone(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) {} void FlashDone::handle( diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp index 222c5b03..a5ae997f 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashDone.hpp @@ -3,14 +3,17 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" namespace DebugServer::Gdb::AvrGdb::CommandPackets { /** * The FlashDone class implements the structure for the "vFlashDone" packet. */ - class FlashDone: public CommandPackets::CommandPacket + class FlashDone + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: explicit FlashDone(const RawPacket& rawPacket); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp index 1d071a48..5415bf43 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.cpp @@ -17,7 +17,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using namespace Exceptions; FlashErase::FlashErase(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp index 27b7108b..9a067df5 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashErase.hpp @@ -3,7 +3,8 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" namespace DebugServer::Gdb::AvrGdb::CommandPackets { @@ -11,7 +12,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The FlashErase class implements the structure for the "vFlashErase" packet. Upon receiving this packet, the * server is expected to erase a particular region of the target's flash memory. */ - class FlashErase: public CommandPackets::CommandPacket + class FlashErase + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: std::uint32_t startAddress = 0; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp index 3f2a1d88..34ae97d1 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.cpp @@ -17,7 +17,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using namespace Exceptions; FlashWrite::FlashWrite(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp index 9ae1db78..89fb5930 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/FlashWrite.hpp @@ -3,7 +3,8 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/Targets/TargetMemory.hpp" @@ -13,7 +14,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The FlashWrite class implements the structure for the "vFlashWrite" packet. Upon receiving this packet, the * server is expected to write to a particular region of the target's flash memory. */ - class FlashWrite: public CommandPackets::CommandPacket + class FlashWrite + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: Targets::TargetMemoryAddress startAddress; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp index ee0e2b2f..bb90967d 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp @@ -150,7 +150,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets const AvrGdbTargetDescriptor& gdbTargetDescriptor, ReadMemory::PacketData&& packetData ) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) , addressSpaceDescriptor(gdbTargetDescriptor.addressSpaceDescriptorFromGdbAddress(packetData.gdbStartAddress)) , startAddress(gdbTargetDescriptor.translateGdbAddress(packetData.gdbStartAddress)) , bytes(packetData.bytes) diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp index 2291c49f..fceb87ce 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp @@ -3,7 +3,8 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/Targets/TargetAddressSpaceDescriptor.hpp" #include "src/Targets/TargetMemory.hpp" @@ -14,7 +15,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The ReadMemory class implements a structure for "m" packets. Upon receiving these packets, the server is * expected to read memory from the target and send it the client. */ - class ReadMemory: public CommandPackets::CommandPacket + class ReadMemory + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: const Targets::TargetAddressSpaceDescriptor& addressSpaceDescriptor; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp index bb213b16..cb32791b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.cpp @@ -14,7 +14,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::Exception; ReadMemoryMap::ReadMemoryMap(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp index ea4349d8..591d1391 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemoryMap.hpp @@ -2,7 +2,8 @@ #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" namespace DebugServer::Gdb::AvrGdb::CommandPackets { @@ -10,7 +11,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The ReadMemoryMap class implements a structure for the "qXfer:memory-map:read::..." packet. Upon receiving this * packet, the server is expected to respond with the target's memory map. */ - class ReadMemoryMap: public CommandPackets::CommandPacket + class ReadMemoryMap + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: /** diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.cpp index 9a40ff56..4c5b0aaa 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.cpp @@ -21,7 +21,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::Exception; ReadRegister::ReadRegister(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.hpp index d335ae8b..ee00f711 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegister.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/DebugServer/Gdb/RegisterDescriptor.hpp" @@ -10,7 +11,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The ReadRegister class implements a structure for the "p" command packet. In response to this packet, the server * is expected to send register values for the requested register. */ - class ReadRegister: public CommandPackets::CommandPacket + class ReadRegister + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: GdbRegisterId registerId; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp index fc48f272..5c972b0a 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp @@ -23,7 +23,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::Exception; ReadRegisters::ReadRegisters(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) {} void ReadRegisters::handle( diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.hpp index 7e1e4650..a6327a8b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.hpp @@ -2,7 +2,8 @@ #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/DebugServer/Gdb/RegisterDescriptor.hpp" @@ -12,7 +13,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The ReadRegisters class implements a structure for the "g" command packet. In response to this packet, the * server is expected to send register values for all registers. */ - class ReadRegisters: public CommandPackets::CommandPacket + class ReadRegisters + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: explicit ReadRegisters(const RawPacket& rawPacket); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp index 284858b0..917779bf 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp @@ -18,7 +18,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using ::Exceptions::Exception; VContRangeStep::VContRangeStep(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp index 5fa3d4f4..c3726287 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp @@ -2,7 +2,8 @@ #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/Targets/TargetMemory.hpp" @@ -13,7 +14,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * step through a particular address range, and only report back to GDB when execution leaves that range, or when an * external breakpoint has been reached. */ - class VContRangeStep: public CommandPackets::CommandPacket + class VContRangeStep + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: Targets::TargetMemoryAddress startAddress; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.cpp index 07b1b9d7..48f2f8dd 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.cpp @@ -9,7 +9,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Services::TargetControllerService; VContSupportedActionsQuery::VContSupportedActionsQuery(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) {} void VContSupportedActionsQuery::handle( diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.hpp index 6f6b69b3..7ff6b58c 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContSupportedActionsQuery.hpp @@ -3,7 +3,8 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" namespace DebugServer::Gdb::AvrGdb::CommandPackets { @@ -13,7 +14,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * * Responses to this command packet should take the form of a ResponsePackets::SupportedFeaturesResponse. */ - class VContSupportedActionsQuery: public CommandPackets::CommandPacket + class VContSupportedActionsQuery + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: explicit VContSupportedActionsQuery(const RawPacket& rawPacket); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp index c9c595f6..169275c8 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp @@ -119,7 +119,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets const AvrGdbTargetDescriptor& gdbTargetDescriptor, PacketData&& packetData ) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) , addressSpaceDescriptor(gdbTargetDescriptor.addressSpaceDescriptorFromGdbAddress(packetData.gdbStartAddress)) , startAddress(gdbTargetDescriptor.translateGdbAddress(packetData.gdbStartAddress)) , bytes(packetData.bytes) diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp index 4f004f8f..43abe8bf 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp @@ -3,7 +3,8 @@ #include #include -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/Targets/TargetAddressSpaceDescriptor.hpp" #include "src/Targets/TargetMemory.hpp" @@ -14,7 +15,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets * The WriteMemory class implements the structure for "M" packets. Upon receiving this packet, the server is * expected to write data to the target's memory, at the specified start address. */ - class WriteMemory: public CommandPackets::CommandPacket + class WriteMemory + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: const Targets::TargetAddressSpaceDescriptor& addressSpaceDescriptor; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp index b7100d47..dfc1c054 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp @@ -18,7 +18,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets using Exceptions::Exception; WriteRegister::WriteRegister(const RawPacket& rawPacket) - : CommandPacket(rawPacket) + : Gdb::CommandPackets::CommandPacket(rawPacket) { using Services::StringService; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.hpp index 4db48e32..8aa70530 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.hpp @@ -1,6 +1,7 @@ #pragma once -#include "CommandPacket.hpp" +#include "AvrGdbCommandPacketInterface.hpp" +#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp" #include "src/DebugServer/Gdb/RegisterDescriptor.hpp" @@ -11,7 +12,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets /** * The WriteRegister class implements the structure for "P" packets. */ - class WriteRegister: public CommandPackets::CommandPacket + class WriteRegister + : public CommandPackets::AvrGdbCommandPacketInterface + , private Gdb::CommandPackets::CommandPacket { public: GdbRegisterId registerId;