Corrected bug in GDB InterruptExecution command handler, where a failure to interrupt target execution wasn't clearing the DebugSession::waitingForBreak flag
This commit is contained in:
@@ -21,11 +21,20 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
||||
try {
|
||||
targetControllerConsole.stopTargetExecution();
|
||||
debugSession.connection.writePacket(TargetStopped(Signal::INTERRUPTED));
|
||||
debugSession.waitingForBreak = false;
|
||||
|
||||
} catch (const Exception& exception) {
|
||||
Logger::error("Failed to interrupt execution - " + exception.getMessage());
|
||||
debugSession.connection.writePacket(ErrorResponsePacket());
|
||||
}
|
||||
|
||||
/*
|
||||
* Whenever we respond to an interrupt signal, GDB always assumes that target execution has stopped. Even if we
|
||||
* respond with an error packet.
|
||||
*
|
||||
* Because of this, we always set the DebugSession::waitingForBreak flag to false, even if we failed to
|
||||
* interrupt target execution. This way, we won't end up sending an unexpected stop reply packet to GDB, when
|
||||
* the target does eventually stop (for some other reason).
|
||||
*/
|
||||
debugSession.waitingForBreak = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user