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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,14 @@ namespace Bloom
|
||||
*/
|
||||
void onTargetControllerThreadStateChangedEvent(const Events::TargetControllerThreadStateChanged& event);
|
||||
|
||||
/**
|
||||
* If the something horrible was to happen and the DebugServer dies unexpectedly, Insight will shutdown
|
||||
* in response.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
void onDebugServerThreadStateChangedEvent(const Events::DebugServerThreadStateChanged& event);
|
||||
|
||||
/**
|
||||
* Dispatches any events currently in the queue.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user