diff options
author | hjk <hjk@qt.io> | 2017-12-14 10:31:44 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-12-14 13:38:16 +0000 |
commit | c21657184ba9aa08493101f97c651f548fa65d77 (patch) | |
tree | c137b4c4db284df07fc3c3d47cac1794d60ad3a0 /src | |
parent | b6697e7932f3f328bc5d995d3f3c67d5bb093491 (diff) | |
download | qt-creator-c21657184ba9aa08493101f97c651f548fa65d77.tar.gz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/debugger/debuggerengine.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 7ef96a88f2..0a40d0fd1c 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -695,8 +695,7 @@ void DebuggerEngine::notifyEngineRunFailed() d->m_progress.reportFinished(); showStatusMessage(tr("Run failed.")); setState(EngineRunFailed); - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); } void DebuggerEngine::notifyEngineRunAndInferiorRunOk() @@ -790,8 +789,7 @@ void DebuggerEngine::notifyInferiorStopFailed() showMessage("NOTE: INFERIOR STOP FAILED"); QTC_ASSERT(state() == InferiorStopRequested, qDebug() << this << state()); setState(InferiorStopFailed); - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); } void DebuggerEnginePrivate::doShutdownInferior() @@ -808,8 +806,7 @@ void DebuggerEngine::notifyInferiorShutdownFinished() showMessage("INFERIOR FINISHED SHUT DOWN"); QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << this << state()); setState(InferiorShutdownFinished); - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); } void DebuggerEngine::notifyInferiorIll() @@ -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,12 +876,10 @@ void DebuggerEngine::notifyEngineIll() case InferiorStopOk: showMessage("FORWARDING STATE TO InferiorShutdownFinished"); setState(InferiorShutdownFinished, true); - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); break; default: - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); break; } } @@ -908,8 +905,7 @@ void DebuggerEngine::notifyInferiorExited() showMessage("NOTE: INFERIOR EXITED"); d->resetLocation(); setState(InferiorShutdownFinished); - if (isMasterEngine()) - d->doShutdownEngine(); + d->doShutdownEngine(); } void DebuggerEngine::notifyDebuggerProcessFinished(int exitCode, |