QmlCppDebugger: adjusted state changes when one engine fails

reviewed-by: hjk
This commit is contained in:
Christiaan Janssen
2011-02-02 10:42:32 +01:00
parent face88a3d2
commit 2c5d94c3c9
2 changed files with 24 additions and 8 deletions

View File

@@ -990,7 +990,7 @@ void DebuggerEngine::notifyInferiorIll()
void DebuggerEngine::shutdownSlaveEngine() void DebuggerEngine::shutdownSlaveEngine()
{ {
QTC_ASSERT(state() == InferiorShutdownOk, /**/); QTC_ASSERT(isAllowedTransition(state(),EngineShutdownRequested), /**/);
setState(EngineShutdownRequested); setState(EngineShutdownRequested);
shutdownEngine(); shutdownEngine();
} }

View File

@@ -126,9 +126,9 @@ void QmlCppEnginePrivate::qmlStackChanged()
QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp) QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
: DebuggerEngine(sp), d(new QmlCppEnginePrivate(this, sp)) : DebuggerEngine(sp), d(new QmlCppEnginePrivate(this, sp))
{ {
//setStateDebugging(true); // setStateDebugging(true);
//m_cppEngine->setStateDebugging(true); // d->m_cppEngine->setStateDebugging(true);
//m_qmlEngine->setStateDebugging(true); // d->m_qmlEngine->setStateDebugging(true);
} }
QmlCppEngine::~QmlCppEngine() QmlCppEngine::~QmlCppEngine()
@@ -482,6 +482,9 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
case InferiorSetupFailed: case InferiorSetupFailed:
if (otherEngine->state() == InferiorRunOk)
otherEngine->quitDebugger();
else
notifyInferiorSetupFailed(); notifyInferiorSetupFailed();
break; break;
@@ -497,6 +500,9 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
case EngineRunFailed: case EngineRunFailed:
if (otherEngine->state() == InferiorRunOk)
otherEngine->quitDebugger();
else
notifyEngineRunFailed(); notifyEngineRunFailed();
break; break;
@@ -510,9 +516,11 @@ void QmlCppEngine::slaveEngineStateChanged
case InferiorRunOk: case InferiorRunOk:
if (state() == EngineRunRequested) { if (state() == EngineRunRequested) {
if (otherEngine->state() == InferiorRunOk) if (otherEngine->state() == InferiorRunOk
|| otherEngine->state() == InferiorStopOk)
notifyEngineRunAndInferiorRunOk(); notifyEngineRunAndInferiorRunOk();
else if (otherEngine->state() == InferiorRunOk) else if (otherEngine->state() == InferiorRunOk
|| otherEngine->state() == InferiorStopOk)
notifyEngineRunAndInferiorStopOk(); notifyEngineRunAndInferiorStopOk();
else else
EDEBUG("... WAITING FOR OTHER INFERIOR RUN"); EDEBUG("... WAITING FOR OTHER INFERIOR RUN");
@@ -553,6 +561,8 @@ void QmlCppEngine::slaveEngineStateChanged
} else if (state() == InferiorStopRequested) { } else if (state() == InferiorStopRequested) {
EDEBUG("... AN INFERIOR STOPPED EXPECTEDLY"); EDEBUG("... AN INFERIOR STOPPED EXPECTEDLY");
notifyInferiorStopOk(); notifyInferiorStopOk();
} else if (state() == EngineRunRequested) {
EDEBUG("... AN INFERIOR FAILED STARTUP, OTHER STOPPED EXPECTEDLY");
} else { } else {
EDEBUG("... AN INFERIOR STOPPED SPONTANEOUSLY"); EDEBUG("... AN INFERIOR STOPPED SPONTANEOUSLY");
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
@@ -581,6 +591,12 @@ void QmlCppEngine::slaveEngineStateChanged
otherEngine->quitDebugger(); otherEngine->quitDebugger();
} else if (otherEngine->state() == InferiorStopOk) { } else if (otherEngine->state() == InferiorStopOk) {
otherEngine->quitDebugger(); otherEngine->quitDebugger();
} else if (otherEngine->state() == EngineRunFailed) {
EDEBUG("... INFERIOR STOPPED, OTHER ENGINE FAILED");
notifyEngineRunFailed();
} else if (otherEngine->state() == InferiorSetupFailed) {
EDEBUG("... INFERIOR STOPPED, OTHER INFERIOR FAILED");
notifyInferiorSetupFailed();
} }
break; break;