Tidied AVR GDB memory access command packet classes

This commit is contained in:
Nav
2022-04-03 20:35:53 +01:00
parent 80d7c9588f
commit 17c301b57a
7 changed files with 55 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
#include <cstdint>
#include <optional>
#include "AbstractMemoryAccessPacket.hpp"
#include "MemoryAccessCommandPacket.hpp"
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
{
@@ -11,15 +11,22 @@ namespace Bloom::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 AbstractMemoryAccessPacket
class WriteMemory: public MemoryAccessCommandPacket
{
public:
/**
* Like with the ReadMemory command packet, the start address carries additional bits that indicate
* the memory type.
* Start address of the memory operation.
*/
std::uint32_t startAddress = 0;
/**
* The type of memory to read from.
*/
Targets::TargetMemoryType memoryType = Targets::TargetMemoryType::FLASH;
/**
* Data to write.
*/
Targets::TargetMemoryBuffer buffer;
explicit WriteMemory(const std::vector<unsigned char>& rawPacket);