Commit 2c5d94c3 authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlCppDebugger: adjusted state changes when one engine fails

reviewed-by: hjk
parent face88a3
......@@ -990,7 +990,7 @@ void DebuggerEngine::notifyInferiorIll()
void DebuggerEngine::shutdownSlaveEngine()
{
QTC_ASSERT(state() == InferiorShutdownOk, /**/);
QTC_ASSERT(isAllowedTransition(state(),EngineShutdownRequested), /**/);
setState(EngineShutdownRequested);
shutdownEngine();
}
......
......@@ -126,9 +126,9 @@ void QmlCppEnginePrivate::qmlStackChanged()
QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
: DebuggerEngine(sp), d(new QmlCppEnginePrivate(this, sp))
{
//setStateDebugging(true);
//m_cppEngine->setStateDebugging(true);
//m_qmlEngine->setStateDebugging(true);
// setStateDebugging(true);
// d->m_cppEngine->setStateDebugging(true);
// d->m_qmlEngine->setStateDebugging(true);
}
QmlCppEngine::~QmlCppEngine()
......@@ -482,7 +482,10 @@ void QmlCppEngine::slaveEngineStateChanged
break;
case InferiorSetupFailed:
notifyInferiorSetupFailed();
if (otherEngine->state() == InferiorRunOk)
otherEngine->quitDebugger();
else
notifyInferiorSetupFailed();
break;
case InferiorSetupOk:
......@@ -497,7 +500,10 @@ void QmlCppEngine::slaveEngineStateChanged
break;
case EngineRunFailed:
notifyEngineRunFailed();
if (otherEngine->state() == InferiorRunOk)
otherEngine->quitDebugger();
else
notifyEngineRunFailed();
break;
......@@ -510,9 +516,11 @@ void QmlCppEngine::slaveEngineStateChanged
case InferiorRunOk:
if (state() == EngineRunRequested) {
if (otherEngine->state() == InferiorRunOk)
if (otherEngine->state() == InferiorRunOk
|| otherEngine->state() == InferiorStopOk)
notifyEngineRunAndInferiorRunOk();
else if (otherEngine->state() == InferiorRunOk)
else if (otherEngine->state() == InferiorRunOk
|| otherEngine->state() == InferiorStopOk)
notifyEngineRunAndInferiorStopOk();
else
EDEBUG("... WAITING FOR OTHER INFERIOR RUN");
......@@ -553,6 +561,8 @@ void QmlCppEngine::slaveEngineStateChanged
} else if (state() == InferiorStopRequested) {
EDEBUG("... AN INFERIOR STOPPED EXPECTEDLY");
notifyInferiorStopOk();
} else if (state() == EngineRunRequested) {
EDEBUG("... AN INFERIOR FAILED STARTUP, OTHER STOPPED EXPECTEDLY");
} else {
EDEBUG("... AN INFERIOR STOPPED SPONTANEOUSLY");
notifyInferiorSpontaneousStop();
......@@ -581,6 +591,12 @@ void QmlCppEngine::slaveEngineStateChanged
otherEngine->quitDebugger();
} else if (otherEngine->state() == InferiorStopOk) {
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;
......
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