debugger: remove EngineRunOk state again

This commit is contained in:
hjk
2011-01-14 18:47:44 +01:00
parent cdee3dc6cd
commit bdfe2ed53b
6 changed files with 22 additions and 34 deletions

View File

@@ -118,7 +118,6 @@ enum DebuggerState
EngineRunRequested, EngineRunRequested,
EngineRunFailed, EngineRunFailed,
EngineRunOk,
InferiorUnrunnable, // Used in the core dump adapter InferiorUnrunnable, // Used in the core dump adapter

View File

@@ -331,7 +331,6 @@ const char *DebuggerEngine::stateName(int s)
SN(EngineSetupOk) SN(EngineSetupOk)
SN(EngineSetupFailed) SN(EngineSetupFailed)
SN(EngineRunFailed) SN(EngineRunFailed)
SN(EngineRunOk)
SN(InferiorSetupRequested) SN(InferiorSetupRequested)
SN(InferiorSetupFailed) SN(InferiorSetupFailed)
SN(InferiorSetupOk) SN(InferiorSetupOk)
@@ -704,12 +703,12 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to)
return to == EngineRunRequested; return to == EngineRunRequested;
case EngineRunRequested: case EngineRunRequested:
return to == EngineRunOk || EngineRunFailed; return to == EngineRunFailed
|| to == InferiorRunOk
|| to == InferiorStopOk
|| to == InferiorUnrunnable;
case EngineRunFailed: case EngineRunFailed:
return to == EngineShutdownRequested; return to == EngineShutdownRequested;
case EngineRunOk:
return InferiorRunOk || to == InferiorStopOk
|| to == InferiorUnrunnable;
case InferiorRunRequested: case InferiorRunRequested:
return to == InferiorRunOk || to == InferiorRunFailed; return to == InferiorRunOk || to == InferiorRunFailed;
@@ -864,8 +863,6 @@ void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
setState(EngineRunOk);
if (isMasterEngine())
setState(InferiorRunOk); setState(InferiorRunOk);
} }
@@ -875,8 +872,6 @@ void DebuggerEngine::notifyEngineRunAndInferiorStopOk()
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
setState(EngineRunOk);
if (isMasterEngine())
setState(InferiorStopOk); setState(InferiorStopOk);
} }
@@ -1193,7 +1188,6 @@ bool DebuggerEngine::debuggerActionsEnabled(DebuggerState state)
case EngineSetupFailed: case EngineSetupFailed:
case EngineRunRequested: case EngineRunRequested:
case EngineRunFailed: case EngineRunFailed:
case EngineRunOk:
case InferiorSetupFailed: case InferiorSetupFailed:
case InferiorStopFailed: case InferiorStopFailed:
case InferiorStopSpontaneous: case InferiorStopSpontaneous:

View File

@@ -199,8 +199,6 @@
// Inferior- Inferior- Inferior- EngineRun- + // Inferior- Inferior- Inferior- EngineRun- +
// Unrunnable} StopOk} RunOk} Failed} + // Unrunnable} StopOk} RunOk} Failed} +
// + + + + + // + + + + +
// EngineRunOk EngineRunOk EngineRunOk + +
// + + + + +
// InferiorUnrunnable + InferiorRunOk + + // InferiorUnrunnable + InferiorRunOk + +
// + + + // + + +
// InferiorStopOk EngineRunFailed + // InferiorStopOk EngineRunFailed +

View File

@@ -144,7 +144,6 @@ static bool stateAcceptsGdbCommands(DebuggerState state)
case InferiorStopSpontaneous: case InferiorStopSpontaneous:
case InferiorSetupOk: case InferiorSetupOk:
case EngineRunFailed: case EngineRunFailed:
case EngineRunOk:
case InferiorExitOk: case InferiorExitOk:
case InferiorRunFailed: case InferiorRunFailed:
case EngineShutdownOk: case EngineShutdownOk:

View File

@@ -440,18 +440,6 @@ void QmlCppEngine::slaveEngineStateChanged
notifyEngineRunFailed(); notifyEngineRunFailed();
break; break;
case EngineRunOk:
if (otherEngine->state() == EngineRunOk) {
// This is conditionalized on isMasterEngine() in the
// base class, so do it here manually.
slaveEngine->setSilentState(InferiorRunOk);
otherEngine->setSilentState(InferiorRunOk);
notifyEngineRunAndInferiorRunOk();
} else {
qDebug() << "... WAITING FOR OTHER ENGINE RUN...";
}
break;
case InferiorRunRequested: case InferiorRunRequested:
break; break;
@@ -461,11 +449,21 @@ void QmlCppEngine::slaveEngineStateChanged
break; break;
case InferiorRunOk: case InferiorRunOk:
qDebug() << "PLANNED INFERIOR RUN"; if (state() == EngineRunRequested) {
if (otherEngine->state() == InferiorRunOk) if (otherEngine->state() == InferiorRunOk)
notifyInferiorRunOk(); notifyEngineRunAndInferiorRunOk();
else if (otherEngine->state() == InferiorRunOk)
notifyEngineRunAndInferiorStopOk();
else else
qDebug() << "... WAITING FOR OTHER INFERIOR RUN";
} else {
if (otherEngine->state() == InferiorRunOk) {
qDebug() << "PLANNED INFERIOR RUN";
notifyInferiorRunOk();
} else {
qDebug() << " **** INFERIOR RUN NOT OK ****"; qDebug() << " **** INFERIOR RUN NOT OK ****";
}
}
break; break;

View File

@@ -676,7 +676,7 @@ void QmlEngine::messageReceived(const QByteArray &message)
if (command == "STOPPED") { if (command == "STOPPED") {
qDebug() << command << this << state(); qDebug() << command << this << state();
if (state() == InferiorRunOk || state() == EngineRunOk) if (state() == InferiorRunOk)
notifyInferiorSpontaneousStop(); notifyInferiorSpontaneousStop();
QString logString = QString(command); QString logString = QString(command);