Debugger: Move master engine checks around

From several places in DebuggerEngine::* to one place in
DebuggerEnginePrivate.

Change-Id: Ic87110a11087e338cc9a6b66ea30ea2259861d9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2017-12-14 10:31:44 +01:00
parent b6697e7932
commit c21657184b

View File

@@ -695,7 +695,6 @@ void DebuggerEngine::notifyEngineRunFailed()
d->m_progress.reportFinished();
showStatusMessage(tr("Run failed."));
setState(EngineRunFailed);
if (isMasterEngine())
d->doShutdownEngine();
}
@@ -790,7 +789,6 @@ void DebuggerEngine::notifyInferiorStopFailed()
showMessage("NOTE: INFERIOR STOP FAILED");
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state());
setState(InferiorStopFailed);
if (isMasterEngine())
d->doShutdownEngine();
}
@@ -808,7 +806,6 @@ void DebuggerEngine::notifyInferiorShutdownFinished()
showMessage("INFERIOR FINISHED SHUT DOWN");
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state());
setState(InferiorShutdownFinished);
if (isMasterEngine())
d->doShutdownEngine();
}
@@ -837,8 +834,10 @@ void DebuggerEngine::shutdownSlaveEngine()
void DebuggerEnginePrivate::doShutdownEngine()
{
// Slaves do not proceed by themselves.
if (!isMasterEngine())
return;
m_engine->setState(EngineShutdownRequested);
QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return);
QTC_ASSERT(m_runTool, return);
m_runTool->startDying();
m_engine->showMessage("CALL: SHUTDOWN ENGINE");
@@ -877,11 +876,9 @@ void DebuggerEngine::notifyEngineIll()
case InferiorStopOk:
showMessage("FORWARDING STATE TO InferiorShutdownFinished");
setState(InferiorShutdownFinished, true);
if (isMasterEngine())
d->doShutdownEngine();
break;
default:
if (isMasterEngine())
d->doShutdownEngine();
break;
}
@@ -908,7 +905,6 @@ void DebuggerEngine::notifyInferiorExited()
showMessage("NOTE: INFERIOR EXITED");
d->resetLocation();
setState(InferiorShutdownFinished);
if (isMasterEngine())
d->doShutdownEngine();
}