Added event listener for thread state changed events from the DebugServer, within Insight.
This covers cases where the DebugServer has unexpectedly shutdown and Insight should follow.
This commit is contained in:
@@ -45,6 +45,10 @@ void Insight::startup() {
|
||||
std::bind(&Insight::onTargetControllerThreadStateChangedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::DebugServerThreadStateChanged>(
|
||||
std::bind(&Insight::onDebugServerThreadStateChangedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
auto targetDescriptor = this->targetControllerConsole.getTargetDescriptor();
|
||||
|
||||
#ifndef BLOOM_DEBUG_BUILD
|
||||
@@ -132,3 +136,10 @@ void Insight::onTargetControllerThreadStateChangedEvent(const Events::TargetCont
|
||||
this->shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
void Insight::onDebugServerThreadStateChangedEvent(const Events::DebugServerThreadStateChanged& event) {
|
||||
if (event.getState() == ThreadState::STOPPED) {
|
||||
// Something horrible has happened with the DebugServer
|
||||
this->shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user