Files
BloomPatched/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.hpp

43 lines
1.2 KiB
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#pragma once
#include <cstdint>
#include <optional>
#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp"
#include "src/DebugServer/Gdb/TargetDescriptor.hpp"
#include "src/Targets/TargetMemory.hpp"
2021-04-04 21:04:12 +01:00
namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets
2021-04-04 21:04:12 +01:00
{
/**
* 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 Gdb::CommandPackets::CommandPacket
2021-04-04 21:04:12 +01:00
{
public:
/**
* Start address of the memory operation.
2021-04-04 21:04:12 +01:00
*/
Targets::TargetMemoryAddress startAddress = 0;
2021-04-04 21:04:12 +01:00
/**
* The type of memory to read from.
*/
Targets::TargetMemoryType memoryType = Targets::TargetMemoryType::FLASH;
2021-04-04 21:04:12 +01:00
/**
* Number of bytes to read.
*/
Targets::TargetMemorySize bytes = 0;
2021-04-04 21:04:12 +01:00
2022-10-01 21:01:37 +01:00
explicit ReadMemory(const RawPacket& rawPacket, const Gdb::TargetDescriptor& gdbTargetDescriptor);
2021-04-04 21:04:12 +01:00
void handle(
DebugSession& debugSession,
TargetController::TargetControllerConsole& targetControllerConsole
) override;
2021-04-04 21:04:12 +01:00
};
}