Preparation for support for the GDB vCont command packet

Also fixed a bug in the `StepExecution` and `ContinueExecution` constructors, where the from address wasn't being extracted properly
This commit is contained in:
Nav
2023-04-01 12:37:59 +01:00
parent 837f6d0af3
commit 56ea97369d
11 changed files with 40 additions and 22 deletions

View File

@@ -16,9 +16,9 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
StepExecution::StepExecution(const RawPacket& rawPacket)
: CommandPacket(rawPacket)
{
if (this->data.size() > 1) {
this->fromProgramCounter = static_cast<Targets::TargetProgramCounter>(
std::stoi(std::string(this->data.begin(), this->data.end()), nullptr, 16)
if (this->data.size() > 2) {
this->fromAddress = static_cast<Targets::TargetProgramCounter>(
std::stoi(std::string(this->data.begin() + 2, this->data.end()), nullptr, 16)
);
}
}
@@ -27,7 +27,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
Logger::debug("Handling StepExecution packet");
try {
targetControllerService.stepTargetExecution(this->fromProgramCounter);
targetControllerService.stepTargetExecution(this->fromAddress);
debugSession.waitingForBreak = true;
} catch (const Exception& exception) {