Commit f245ee6f authored by hjk's avatar hjk
Browse files

debugger: finish combined shutdown properly

parent 7bae5dd5
...@@ -978,8 +978,7 @@ void DebuggerEngine::notifyEngineShutdownOk() ...@@ -978,8 +978,7 @@ void DebuggerEngine::notifyEngineShutdownOk()
showMessage(_("NOTE: ENGINE SHUTDOWN OK")); showMessage(_("NOTE: ENGINE SHUTDOWN OK"));
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state());
setState(EngineShutdownOk); setState(EngineShutdownOk);
if (isMasterEngine()) d->queueFinishDebugger();
d->queueFinishDebugger();
} }
void DebuggerEngine::notifyEngineShutdownFailed() void DebuggerEngine::notifyEngineShutdownFailed()
...@@ -987,13 +986,11 @@ void DebuggerEngine::notifyEngineShutdownFailed() ...@@ -987,13 +986,11 @@ void DebuggerEngine::notifyEngineShutdownFailed()
showMessage(_("NOTE: ENGINE SHUTDOWN FAILED")); showMessage(_("NOTE: ENGINE SHUTDOWN FAILED"));
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << this << state());
setState(EngineShutdownFailed); setState(EngineShutdownFailed);
if (isMasterEngine()) d->queueFinishDebugger();
d->queueFinishDebugger();
} }
void DebuggerEnginePrivate::doFinishDebugger() void DebuggerEnginePrivate::doFinishDebugger()
{ {
QTC_ASSERT(isMasterEngine(), return);
m_engine->showMessage(_("NOTE: FINISH DEBUGGER")); m_engine->showMessage(_("NOTE: FINISH DEBUGGER"));
QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state()); QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state());
resetLocation(); resetLocation();
...@@ -1043,17 +1040,6 @@ void DebuggerEngine::notifyInferiorExited() ...@@ -1043,17 +1040,6 @@ void DebuggerEngine::notifyInferiorExited()
qDebug() << "\nSPONTANEUOUS EXIT: " << this << d->m_state; qDebug() << "\nSPONTANEUOUS EXIT: " << this << d->m_state;
showMessage(_("NOTE: INFERIOR EXITED")); showMessage(_("NOTE: INFERIOR EXITED"));
d->resetLocation(); d->resetLocation();
/*
// This can be issued in almost any state. We assume, though,
// that at this point of time the inferior is not running anymore,
// even if stop notification were not issued or got lost.
if (state() == InferiorRunOk) {
setState(InferiorStopRequested);
setState(InferiorStopOk);
}
setState(InferiorShutdownRequested);
setState(InferiorShutdownOk);
*/
setState(InferiorExitOk); setState(InferiorExitOk);
if (isMasterEngine()) { if (isMasterEngine()) {
setState(InferiorShutdownOk); setState(InferiorShutdownOk);
......
...@@ -557,14 +557,18 @@ void QmlCppEngine::slaveEngineStateChanged ...@@ -557,14 +557,18 @@ void QmlCppEngine::slaveEngineStateChanged
case EngineShutdownOk: case EngineShutdownOk:
if (otherEngine->state() == EngineShutdownOk) if (otherEngine->state() == EngineShutdownOk)
notifyEngineShutdownOk(); ; // Wait for DebuggerFinished.
else else
qDebug() << "... WAITING FOR OTHER ENGINE SHUTDOWN..."; qDebug() << "... WAITING FOR OTHER ENGINE SHUTDOWN...";
break; break;
case DebuggerFinished: case DebuggerFinished:
break; if (otherEngine->state() == DebuggerFinished)
notifyEngineShutdownOk();
else
qDebug() << "... WAITING FOR OTHER DEBUGGER TO FINISH...";
break;
} }
} }
......
Supports Markdown
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