Debugger: Fix crash on ramp down

Change-Id: I76aab19d92eae10823196a4c6dc9a2c400d47e80
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-06-16 17:22:51 +02:00
parent b129cebccc
commit a55a376b1d

View File

@@ -1084,6 +1084,7 @@ void DebuggerEnginePrivate::doShutdownEngine()
{
QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return);
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << m_engine << state());
QTC_ASSERT(runTool(), return);
runTool()->startDying();
m_engine->showMessage("CALL: SHUTDOWN ENGINE");
m_engine->shutdownEngine();
@@ -1142,37 +1143,39 @@ void DebuggerEnginePrivate::setRemoteSetupState(RemoteSetupState state)
void DebuggerEngine::notifyEngineIll()
{
#ifdef WITH_BENCHMARK
CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS;
#endif
showMessage("NOTE: ENGINE ILL ******");
runTool()->startDying();
d->m_lastGoodState = d->m_state;
switch (state()) {
case InferiorRunRequested:
case InferiorRunOk:
// The engine does not look overly ill right now, so attempt to
// properly interrupt at least once. If that fails, we are on the
// shutdown path due to d->m_targetState anyways.
setState(InferiorStopRequested, true);
showMessage("ATTEMPT TO INTERRUPT INFERIOR");
interruptInferior();
break;
case InferiorStopRequested:
notifyInferiorStopFailed();
break;
case InferiorStopOk:
showMessage("FORWARDING STATE TO InferiorShutdownFailed");
setState(InferiorShutdownFailed, true);
if (isMasterEngine())
d->queueShutdownEngine();
break;
default:
if (isMasterEngine())
d->queueShutdownEngine();
break;
}
runControl()->initiateStop();
return;
//#ifdef WITH_BENCHMARK
// CALLGRIND_STOP_INSTRUMENTATION;
// CALLGRIND_DUMP_STATS;
//#endif
// showMessage("NOTE: ENGINE ILL ******");
// runTool()->startDying();
// d->m_lastGoodState = d->m_state;
// switch (state()) {
// case InferiorRunRequested:
// case InferiorRunOk:
// // The engine does not look overly ill right now, so attempt to
// // properly interrupt at least once. If that fails, we are on the
// // shutdown path due to d->m_targetState anyways.
// setState(InferiorStopRequested, true);
// showMessage("ATTEMPT TO INTERRUPT INFERIOR");
// interruptInferior();
// break;
// case InferiorStopRequested:
// notifyInferiorStopFailed();
// break;
// case InferiorStopOk:
// showMessage("FORWARDING STATE TO InferiorShutdownFailed");
// setState(InferiorShutdownFailed, true);
// if (isMasterEngine())
// d->queueShutdownEngine();
// break;
// default:
// if (isMasterEngine())
// d->queueShutdownEngine();
// break;
// }
}
void DebuggerEngine::notifyEngineSpontaneousShutdown()