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:
@@ -15,9 +15,9 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
ContinueExecution::ContinueExecution(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)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
Logger::debug("Handling ContinueExecution packet");
|
||||
|
||||
try {
|
||||
targetControllerService.continueTargetExecution(this->fromProgramCounter);
|
||||
targetControllerService.continueTargetExecution(this->fromAddress, std::nullopt);
|
||||
debugSession.waitingForBreak = true;
|
||||
|
||||
} catch (const Exception& exception) {
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
*
|
||||
* Although the packet *can* contain this address, it is not required, hence the std::optional type.
|
||||
*/
|
||||
std::optional<Targets::TargetProgramCounter> fromProgramCounter;
|
||||
std::optional<Targets::TargetMemoryAddress> fromAddress;
|
||||
|
||||
explicit ContinueExecution(const RawPacket& rawPacket);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
/**
|
||||
* The address from which to begin the step.
|
||||
*/
|
||||
std::optional<Targets::TargetProgramCounter> fromProgramCounter;
|
||||
std::optional<Targets::TargetMemoryAddress> fromAddress;
|
||||
|
||||
explicit StepExecution(const RawPacket& rawPacket);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user