2021-08-07 17:07:04 +01:00
|
|
|
#include "ReadRegisters.hpp"
|
2021-10-02 17:39:27 +01:00
|
|
|
|
2021-04-04 21:04:12 +01:00
|
|
|
#include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp"
|
|
|
|
|
|
2022-02-05 15:32:08 +00:00
|
|
|
namespace Bloom::DebugServers::Gdb::CommandPackets
|
|
|
|
|
{
|
|
|
|
|
void ReadRegisters::dispatchToHandler(Gdb::GdbRspDebugServer& gdbRspDebugServer) {
|
|
|
|
|
gdbRspDebugServer.handleGdbPacket(*this);
|
|
|
|
|
}
|
2021-10-06 21:12:31 +01:00
|
|
|
|
2022-02-05 15:32:08 +00:00
|
|
|
void ReadRegisters::init() {
|
|
|
|
|
if (this->data.size() >= 2 && this->data.front() == 'p') {
|
|
|
|
|
// This command packet is requesting a specific register
|
|
|
|
|
this->registerNumber = static_cast<size_t>(
|
|
|
|
|
std::stoi(std::string(this->data.begin() + 1, this->data.end()))
|
|
|
|
|
);
|
|
|
|
|
}
|
2021-04-04 21:04:12 +01:00
|
|
|
}
|
|
|
|
|
}
|