Files
BloomPatched/src/TargetController/Commands/ReadTargetMemory.hpp

51 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
2022-04-30 01:45:49 +01:00
#include <cstdint>
#include <set>
#include "Command.hpp"
#include "src/TargetController/Responses/TargetMemoryRead.hpp"
2022-04-28 21:08:55 +01:00
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::TargetController::Commands
{
class ReadTargetMemory: public Command
{
public:
using SuccessResponseType = Responses::TargetMemoryRead;
static constexpr CommandType type = CommandType::READ_TARGET_MEMORY;
static inline const std::string name = "ReadTargetMemory";
Targets::TargetMemoryType memoryType;
Targets::TargetMemoryAddress startAddress;
Targets::TargetMemorySize bytes;
std::set<Targets::TargetMemoryAddressRange> excludedAddressRanges;
2022-04-30 01:45:49 +01:00
ReadTargetMemory(
Targets::TargetMemoryType memoryType,
Targets::TargetMemoryAddress startAddress,
Targets::TargetMemorySize bytes,
const std::set<Targets::TargetMemoryAddressRange>& excludedAddressRanges
)
: memoryType(memoryType)
, startAddress(startAddress)
, bytes(bytes)
, excludedAddressRanges(excludedAddressRanges)
{};
[[nodiscard]] CommandType getType() const override {
return ReadTargetMemory::type;
}
[[nodiscard]] bool requiresStoppedTargetState() const override {
return true;
}
2022-06-05 16:13:43 +01:00
[[nodiscard]] bool requiresDebugMode() const override {
return this->memoryType == Targets::TargetMemoryType::RAM;
}
};
}