Handled GDB exceptions in TargetExecutionStopped event handler, to prevent them from propagating to the DebugServerComponent::run() and causing Bloom to shutdown.
This commit is contained in:
@@ -304,11 +304,30 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GdbRspDebugServer::onTargetExecutionStopped(const Events::TargetExecutionStopped&) {
|
void GdbRspDebugServer::onTargetExecutionStopped(const Events::TargetExecutionStopped&) {
|
||||||
if (this->activeDebugSession.has_value() && this->activeDebugSession->waitingForBreak) {
|
try {
|
||||||
this->activeDebugSession->connection.writePacket(
|
if (this->activeDebugSession.has_value() && this->activeDebugSession->waitingForBreak) {
|
||||||
ResponsePackets::TargetStopped(Signal::TRAP)
|
this->activeDebugSession->connection.writePacket(
|
||||||
|
ResponsePackets::TargetStopped(Signal::TRAP)
|
||||||
|
);
|
||||||
|
this->activeDebugSession->waitingForBreak = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (const ClientDisconnected&) {
|
||||||
|
Logger::info("GDB RSP client disconnected");
|
||||||
|
this->terminateActiveDebugSession();
|
||||||
|
return;
|
||||||
|
|
||||||
|
} catch (const ClientCommunicationError& exception) {
|
||||||
|
Logger::error(
|
||||||
|
"GDB RSP client communication error - " + exception.getMessage() + " - closing connection"
|
||||||
);
|
);
|
||||||
this->activeDebugSession->waitingForBreak = false;
|
this->terminateActiveDebugSession();
|
||||||
|
return;
|
||||||
|
|
||||||
|
} catch (const DebugServerInterrupted&) {
|
||||||
|
// Server was interrupted
|
||||||
|
Logger::debug("GDB RSP interrupted");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user