Debugger: Drop the EngineSetupOk state

Directly proceed to EngineRunRequested.

Change-Id: I8419086f554bae298624cab3b33e852e92ea54bd
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2020-12-18 18:20:32 +01:00
parent fcbb4721ba
commit 14c3f5ba51
3 changed files with 12 additions and 26 deletions

View File

@@ -146,7 +146,6 @@ static bool debuggerActionsEnabledHelper(DebuggerState state)
case InferiorRunFailed: case InferiorRunFailed:
case DebuggerNotReady: case DebuggerNotReady:
case EngineSetupRequested: case EngineSetupRequested:
case EngineSetupOk:
case EngineSetupFailed: case EngineSetupFailed:
case EngineRunRequested: case EngineRunRequested:
case EngineRunFailed: case EngineRunFailed:
@@ -900,7 +899,6 @@ QString DebuggerEngine::stateName(int s)
switch (s) { switch (s) {
SN(DebuggerNotReady) SN(DebuggerNotReady)
SN(EngineSetupRequested) SN(EngineSetupRequested)
SN(EngineSetupOk)
SN(EngineSetupFailed) SN(EngineSetupFailed)
SN(EngineRunFailed) SN(EngineRunFailed)
SN(EngineRunRequested) SN(EngineRunRequested)
@@ -1176,13 +1174,13 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to)
return to == EngineSetupRequested; return to == EngineSetupRequested;
case EngineSetupRequested: case EngineSetupRequested:
return to == EngineSetupOk || to == EngineSetupFailed; return to == EngineRunRequested
|| to == EngineSetupFailed
|| to == EngineShutdownRequested;
case EngineSetupFailed: case EngineSetupFailed:
// In is the engine's task to go into a proper "Shutdown" // In is the engine's task to go into a proper "Shutdown"
// state before calling notifyEngineSetupFailed // state before calling notifyEngineSetupFailed
return to == DebuggerFinished; return to == DebuggerFinished;
case EngineSetupOk:
return to == EngineRunRequested || to == EngineShutdownRequested;
case EngineRunRequested: case EngineRunRequested:
return to == EngineRunFailed return to == EngineRunFailed
@@ -1251,9 +1249,7 @@ void DebuggerEngine::notifyEngineSetupOk()
// CALLGRIND_START_INSTRUMENTATION; // CALLGRIND_START_INSTRUMENTATION;
//#endif //#endif
showMessage("NOTE: ENGINE SETUP OK"); showMessage("NOTE: ENGINE SETUP OK");
d->m_progress.setProgressValue(250);
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state()); QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
setState(EngineSetupOk);
setState(EngineRunRequested); setState(EngineRunRequested);
showMessage("CALL: RUN ENGINE"); showMessage("CALL: RUN ENGINE");
d->m_progress.setProgressValue(300); d->m_progress.setProgressValue(300);
@@ -1990,9 +1986,6 @@ void DebuggerEngine::quitDebugger()
case EngineSetupRequested: case EngineSetupRequested:
notifyEngineSetupFailed(); notifyEngineSetupFailed();
break; break;
case EngineSetupOk:
notifyEngineSetupFailed();
break;
case EngineRunRequested: case EngineRunRequested:
notifyEngineRunFailed(); notifyEngineRunFailed();
break; break;

View File

@@ -62,7 +62,6 @@ enum DebuggerState
EngineSetupRequested, // Engine starts EngineSetupRequested, // Engine starts
EngineSetupFailed, EngineSetupFailed,
EngineSetupOk,
EngineRunRequested, EngineRunRequested,
EngineRunFailed, EngineRunFailed,

View File

@@ -221,21 +221,15 @@
{notify- {notify- {notify- {notify-
Engine- Engine- Engine- Engine-
SetupOk} SetupFailed} SetupOk} SetupFailed}
+ + + | +
+ `+-+-+> EngineSetupFailed EngineRunRequested <+-+' | `+-+-+> EngineSetupFailed
+ + | +
+ [calls RunControl->startFailed] | [calls RunControl->startFailed]
+ + | +
+ DebuggerFinished | DebuggerFinished
v |
EngineSetupOk ------------------------
+ / | | \
[calls RunControl->StartSuccessful]
+
+
EngineRunRequested
+
(calls *Engine->runEngine())
/ | | \ / | | \
/ | | \ / | | \
| (core) | (attach) | | | (core) | (attach) | |