Commit c2165718 authored by hjk's avatar hjk

Debugger: Move master engine checks around

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

Change-Id: Ic87110a11087e338cc9a6b66ea30ea2259861d9e
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent b6697e79
...@@ -695,7 +695,6 @@ void DebuggerEngine::notifyEngineRunFailed() ...@@ -695,7 +695,6 @@ void DebuggerEngine::notifyEngineRunFailed()
d->m_progress.reportFinished(); d->m_progress.reportFinished();
showStatusMessage(tr("Run failed.")); showStatusMessage(tr("Run failed."));
setState(EngineRunFailed); setState(EngineRunFailed);
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
} }
...@@ -790,7 +789,6 @@ void DebuggerEngine::notifyInferiorStopFailed() ...@@ -790,7 +789,6 @@ void DebuggerEngine::notifyInferiorStopFailed()
showMessage("NOTE: INFERIOR STOP FAILED"); showMessage("NOTE: INFERIOR STOP FAILED");
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state());
setState(InferiorStopFailed); setState(InferiorStopFailed);
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
} }
...@@ -808,7 +806,6 @@ void DebuggerEngine::notifyInferiorShutdownFinished() ...@@ -808,7 +806,6 @@ void DebuggerEngine::notifyInferiorShutdownFinished()
showMessage("INFERIOR FINISHED SHUT DOWN"); showMessage("INFERIOR FINISHED SHUT DOWN");
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state());
setState(InferiorShutdownFinished); setState(InferiorShutdownFinished);
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
} }
...@@ -837,8 +834,10 @@ void DebuggerEngine::shutdownSlaveEngine() ...@@ -837,8 +834,10 @@ void DebuggerEngine::shutdownSlaveEngine()
void DebuggerEnginePrivate::doShutdownEngine() void DebuggerEnginePrivate::doShutdownEngine()
{ {
// Slaves do not proceed by themselves.
if (!isMasterEngine())
return;
m_engine->setState(EngineShutdownRequested); m_engine->setState(EngineShutdownRequested);
QTC_ASSERT(isMasterEngine(), qDebug() << m_engine; return);
QTC_ASSERT(m_runTool, return); QTC_ASSERT(m_runTool, return);
m_runTool->startDying(); m_runTool->startDying();
m_engine->showMessage("CALL: SHUTDOWN ENGINE"); m_engine->showMessage("CALL: SHUTDOWN ENGINE");
...@@ -877,11 +876,9 @@ void DebuggerEngine::notifyEngineIll() ...@@ -877,11 +876,9 @@ void DebuggerEngine::notifyEngineIll()
case InferiorStopOk: case InferiorStopOk:
showMessage("FORWARDING STATE TO InferiorShutdownFinished"); showMessage("FORWARDING STATE TO InferiorShutdownFinished");
setState(InferiorShutdownFinished, true); setState(InferiorShutdownFinished, true);
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
break; break;
default: default:
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
break; break;
} }
...@@ -908,7 +905,6 @@ void DebuggerEngine::notifyInferiorExited() ...@@ -908,7 +905,6 @@ void DebuggerEngine::notifyInferiorExited()
showMessage("NOTE: INFERIOR EXITED"); showMessage("NOTE: INFERIOR EXITED");
d->resetLocation(); d->resetLocation();
setState(InferiorShutdownFinished); setState(InferiorShutdownFinished);
if (isMasterEngine())
d->doShutdownEngine(); d->doShutdownEngine();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment