Fixed bug with GDB interrupts not being serviced properly

This commit is contained in:
Nav
2023-05-07 19:44:19 +01:00
parent c502b02c58
commit 8a6f1e8659
4 changed files with 61 additions and 0 deletions

View File

@@ -18,6 +18,11 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
void InterruptExecution::handle(DebugSession& debugSession, TargetControllerService& targetControllerService) {
Logger::debug("Handling InterruptExecution packet");
if (targetControllerService.getTargetState() == Targets::TargetState::STOPPED) {
debugSession.pendingInterrupt = true;
return;
}
try {
targetControllerService.stopTargetExecution();
debugSession.connection.writePacket(TargetStopped(Signal::INTERRUPTED));