forked from qt-creator/qt-creator
debugger: simplify combined state handling
This commit is contained in:
@@ -1074,11 +1074,10 @@ void DebuggerEngine::notifyInferiorExited()
|
||||
showMessage(_("NOTE: INFERIOR EXITED"));
|
||||
d->resetLocation();
|
||||
setState(InferiorExitOk);
|
||||
if (isMasterEngine()) {
|
||||
setState(InferiorShutdownOk);
|
||||
if (isMasterEngine())
|
||||
d->queueShutdownEngine();
|
||||
}
|
||||
}
|
||||
|
||||
void DebuggerEngine::slaveEngineStateChanged(DebuggerEngine *slaveEngine,
|
||||
DebuggerState state)
|
||||
@@ -1125,18 +1124,6 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
|
||||
masterEngine()->slaveEngineStateChanged(this, state);
|
||||
}
|
||||
|
||||
void DebuggerEngine::setSilentState(DebuggerState state)
|
||||
{
|
||||
qDebug() << "SILENT STATUS CHANGE: " << this
|
||||
<< " FROM " << stateName(d->m_state) << " TO " << stateName(state)
|
||||
<< isMasterEngine();
|
||||
|
||||
DebuggerState oldState = d->m_state;
|
||||
d->m_state = state;
|
||||
if (!isAllowedTransition(oldState, state))
|
||||
qDebug() << "*** SILENT UNEXPECTED STATE TRANSITION " << this;
|
||||
}
|
||||
|
||||
void DebuggerEngine::updateViews()
|
||||
{
|
||||
// The slave engines are not entitled to change the view. Their wishes
|
||||
|
||||
@@ -356,7 +356,6 @@ private:
|
||||
friend class Internal::DebuggerPluginPrivate;
|
||||
|
||||
virtual void setState(DebuggerState state, bool forced = false);
|
||||
virtual void setSilentState(DebuggerState state);
|
||||
virtual void slaveEngineStateChanged(DebuggerEngine *engine,
|
||||
DebuggerState state);
|
||||
|
||||
|
||||
@@ -389,9 +389,8 @@ void QmlCppEngine::setState(DebuggerState newState, bool forced)
|
||||
void QmlCppEngine::slaveEngineStateChanged
|
||||
(DebuggerEngine *slaveEngine, const DebuggerState newState)
|
||||
{
|
||||
const bool isCpp = slaveEngine == d->m_cppEngine;
|
||||
//const bool isQml = slaveEngine == d->m_qmlEngine;
|
||||
DebuggerEngine *otherEngine = isCpp ? d->m_qmlEngine : d->m_cppEngine;
|
||||
DebuggerEngine *otherEngine = slaveEngine == d->m_cppEngine
|
||||
? d->m_qmlEngine : d->m_cppEngine;
|
||||
|
||||
qDebug() << "GOT SLAVE STATE: " << slaveEngine << newState;
|
||||
qDebug() << " OTHER ENGINE: " << otherEngine << otherEngine->state();
|
||||
@@ -498,14 +497,6 @@ void QmlCppEngine::slaveEngineStateChanged
|
||||
|
||||
|
||||
case InferiorExitOk:
|
||||
slaveEngine->setSilentState(InferiorShutdownOk);
|
||||
if (otherEngine->state() == InferiorShutdownOk) {
|
||||
notifyInferiorExited();
|
||||
} else {
|
||||
if (state() == InferiorRunOk)
|
||||
notifyInferiorSpontaneousStop();
|
||||
otherEngine->notifyInferiorExited();
|
||||
}
|
||||
break;
|
||||
|
||||
case InferiorShutdownRequested:
|
||||
@@ -516,12 +507,16 @@ void QmlCppEngine::slaveEngineStateChanged
|
||||
break;
|
||||
|
||||
case InferiorShutdownOk:
|
||||
if (otherEngine->state() == InferiorShutdownOk)
|
||||
if (otherEngine->state() == InferiorShutdownOk) {
|
||||
if (state() == InferiorRunOk)
|
||||
notifyInferiorExited();
|
||||
else
|
||||
notifyInferiorShutdownOk();
|
||||
else if (otherEngine->state() == InferiorRunOk)
|
||||
} else if (otherEngine->state() == InferiorRunOk) {
|
||||
otherEngine->quitDebugger();
|
||||
else if (otherEngine->state() == InferiorStopOk)
|
||||
} else if (otherEngine->state() == InferiorStopOk) {
|
||||
otherEngine->quitDebugger();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user