Refactored GDB server base class, making it a template class, allowing for much more flexibility for derived target-specific implementations

This commit is contained in:
Nav
2024-10-25 22:22:25 +01:00
parent 72d0c28d08
commit 8be311cbc0
40 changed files with 675 additions and 780 deletions

View File

@@ -3,8 +3,7 @@
#include <cstdint>
#include <optional>
#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp"
#include "src/DebugServer/Gdb/TargetDescriptor.hpp"
#include "CommandPacket.hpp"
#include "src/Targets/TargetMemory.hpp"
@@ -14,17 +13,17 @@ 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 Gdb::CommandPackets::CommandPacket
class FlashWrite: public CommandPackets::CommandPacket
{
public:
std::uint32_t startAddress = 0;
Targets::TargetMemoryAddress startAddress;
Targets::TargetMemoryBuffer buffer;
explicit FlashWrite(const RawPacket& rawPacket);
void handle(
Gdb::DebugSession& debugSession,
const Gdb::TargetDescriptor& gdbTargetDescriptor,
DebugSession& debugSession,
const AvrGdbTargetDescriptor& gdbTargetDescriptor,
const Targets::TargetDescriptor& targetDescriptor,
Services::TargetControllerService& targetControllerService
) override;