2021-06-22 23:52:31 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
|
|
#include "CommandPacket.hpp"
|
|
|
|
|
#include "src/Targets/TargetRegister.hpp"
|
|
|
|
|
|
2022-03-31 16:05:39 +01:00
|
|
|
namespace Bloom::DebugServer::Gdb::CommandPackets
|
2021-06-22 23:52:31 +01:00
|
|
|
{
|
|
|
|
|
/**
|
2021-08-07 17:07:04 +01:00
|
|
|
* The WriteRegisters class implements the structure for "P" packets. Upon receiving this packet,
|
2021-06-22 23:52:31 +01:00
|
|
|
* server is expected to update a register value to the target.
|
|
|
|
|
*/
|
2021-08-07 17:07:04 +01:00
|
|
|
class WriteRegister: public CommandPacket
|
2021-06-22 23:52:31 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
int registerNumber = 0;
|
|
|
|
|
std::vector<unsigned char> registerValue;
|
|
|
|
|
|
2021-08-07 17:07:04 +01:00
|
|
|
explicit WriteRegister(const std::vector<unsigned char>& rawPacket): CommandPacket(rawPacket) {
|
2021-06-22 23:52:31 +01:00
|
|
|
init();
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-24 19:17:41 +00:00
|
|
|
void handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) override;
|
2021-10-06 21:12:31 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void init();
|
2021-06-22 23:52:31 +01:00
|
|
|
};
|
|
|
|
|
}
|