2022-05-29 17:18:29 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
2022-08-30 02:04:35 +01:00
|
|
|
#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp"
|
|
|
|
|
#include "src/DebugServer/Gdb/TargetDescriptor.hpp"
|
|
|
|
|
|
|
|
|
|
#include "src/Targets/TargetMemory.hpp"
|
2022-05-29 17:18:29 +01:00
|
|
|
|
|
|
|
|
namespace Bloom::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.
|
|
|
|
|
*/
|
2022-08-30 02:04:35 +01:00
|
|
|
class FlashWrite: public Gdb::CommandPackets::CommandPacket
|
2022-05-29 17:18:29 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
std::uint32_t startAddress = 0;
|
|
|
|
|
Targets::TargetMemoryBuffer buffer;
|
|
|
|
|
|
2022-10-01 21:01:37 +01:00
|
|
|
explicit FlashWrite(const RawPacket& rawPacket);
|
2022-05-29 17:18:29 +01:00
|
|
|
|
|
|
|
|
void handle(
|
|
|
|
|
DebugSession& debugSession,
|
2022-12-26 21:27:19 +00:00
|
|
|
Services::TargetControllerService& targetControllerService
|
2022-05-29 17:18:29 +01:00
|
|
|
) override;
|
|
|
|
|
};
|
|
|
|
|
}
|