2022-05-14 22:43:08 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
#include "src/DebugServer/Gdb/CommandPackets/CommandPacket.hpp"
|
2024-07-23 21:14:22 +01:00
|
|
|
#include "src/DebugServer/Gdb/AvrGdb/TargetDescriptor.hpp"
|
|
|
|
|
|
|
|
|
|
#include "src/Targets/TargetAddressSpaceDescriptor.hpp"
|
|
|
|
|
#include "src/Targets/TargetMemorySegmentDescriptor.hpp"
|
2022-05-14 22:43:08 +01:00
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace DebugServer::Gdb::AvrGdb::CommandPackets
|
2022-05-14 22:43:08 +01:00
|
|
|
{
|
|
|
|
|
/**
|
2022-05-15 12:05:46 +01:00
|
|
|
* The ReadMemoryMap class implements a structure for the "qXfer:memory-map:read::..." packet. Upon receiving this
|
2022-05-14 22:43:08 +01:00
|
|
|
* packet, the server is expected to respond with the target's memory map.
|
|
|
|
|
*/
|
|
|
|
|
class ReadMemoryMap: public Gdb::CommandPackets::CommandPacket
|
|
|
|
|
{
|
|
|
|
|
public:
|
2024-07-23 21:14:22 +01:00
|
|
|
const Targets::TargetAddressSpaceDescriptor& eepromAddressSpaceDescriptor;
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& programMemorySegmentDescriptor;
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& eepromMemorySegmentDescriptor;
|
|
|
|
|
|
2022-05-14 22:43:08 +01:00
|
|
|
/**
|
|
|
|
|
* The offset of the memory map, from which to read.
|
|
|
|
|
*/
|
|
|
|
|
std::uint32_t offset = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The length of the memory map to read.
|
|
|
|
|
*/
|
|
|
|
|
std::uint32_t length = 0;
|
|
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
explicit ReadMemoryMap(const RawPacket& rawPacket, const TargetDescriptor& gdbTargetDescriptor);
|
2022-05-14 22:43:08 +01:00
|
|
|
|
|
|
|
|
void handle(
|
2023-09-10 22:27:10 +01:00
|
|
|
Gdb::DebugSession& debugSession,
|
2024-07-23 21:14:22 +01:00
|
|
|
const Gdb::TargetDescriptor& gdbTargetDescriptor,
|
|
|
|
|
const Targets::TargetDescriptor& targetDescriptor,
|
2022-12-26 21:27:19 +00:00
|
|
|
Services::TargetControllerService& targetControllerService
|
2022-05-14 22:43:08 +01:00
|
|
|
) override;
|
|
|
|
|
};
|
|
|
|
|
}
|