Renamed DebugServers directory to DebugServer

This commit is contained in:
Nav
2022-03-31 16:13:44 +01:00
parent ac9fad3726
commit a131833379
58 changed files with 63 additions and 63 deletions

View File

@@ -0,0 +1,34 @@
#include "StepExecution.hpp"
#include "src/DebugServer/GdbRsp/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/Logger/Logger.hpp"
#include "src/Exceptions/Exception.hpp"
namespace Bloom::DebugServer::Gdb::CommandPackets
{
using ResponsePackets::ErrorResponsePacket;
using Exceptions::Exception;
void StepExecution::init() {
if (this->data.size() > 1) {
this->fromProgramCounter = static_cast<std::uint32_t>(
std::stoi(std::string(this->data.begin(), this->data.end()), nullptr, 16)
);
}
}
void StepExecution::handle(DebugSession& debugSession, TargetControllerConsole& targetControllerConsole) {
Logger::debug("Handling StepExecution packet");
try {
targetControllerConsole.stepTargetExecution(this->fromProgramCounter);
debugSession.waitingForBreak = true;
} catch (const Exception& exception) {
Logger::error("Failed to step execution on target - " + exception.getMessage());
debugSession.connection.writePacket(ErrorResponsePacket());
}
}
}