Massive refactor to accommodate RISC-V targets
- Refactored entire codebase (excluding the Insight component) to accommodate multiple target architectures (no longer specific to AVR) - Deleted 'generate SVD' GDB monitor command - I will eventually move this functionality to the Bloom website - Added unit size property to address spaces - Many other changes which I couldn't be bothered to describe here
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
|
||||
|
||||
#include "src/Services/StringService.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
@@ -18,21 +19,31 @@ namespace DebugServer::Gdb::CommandPackets
|
||||
{
|
||||
if (this->data.size() > 2) {
|
||||
this->fromAddress = static_cast<Targets::TargetMemoryAddress>(
|
||||
std::stoi(std::string(this->data.begin() + 2, this->data.end()), nullptr, 16)
|
||||
Services::StringService::toUint32(std::string{this->data.begin() + 2, this->data.end()}, 16)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void StepExecution::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
|
||||
void StepExecution::handle(
|
||||
DebugSession& debugSession,
|
||||
const TargetDescriptor& gdbTargetDescriptor,
|
||||
const Targets::TargetDescriptor&,
|
||||
TargetControllerService& targetControllerService
|
||||
) {
|
||||
Logger::info("Handling StepExecution packet");
|
||||
|
||||
try {
|
||||
targetControllerService.stepTargetExecution(this->fromAddress);
|
||||
const auto atomicSession = targetControllerService.makeAtomicSession();
|
||||
if (this->fromAddress.has_value()) {
|
||||
targetControllerService.setProgramCounter(*(this->fromAddress));
|
||||
}
|
||||
|
||||
targetControllerService.stepTargetExecution();
|
||||
debugSession.waitingForBreak = true;
|
||||
|
||||
} catch (const Exception& exception) {
|
||||
Logger::error("Failed to step execution on target - " + exception.getMessage());
|
||||
debugSession.connection.writePacket(ErrorResponsePacket());
|
||||
debugSession.connection.writePacket(ErrorResponsePacket{});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user