Debugger: State machine cosmetics

Remove one unused notification, rename notifyInferiorUnrunnable.

Change-Id: I585d3a8606585fbdd8ad48e5eeecf629542bd93c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-02-26 15:21:43 +01:00
parent 958c0cebb9
commit a21afdd2a0
6 changed files with 5 additions and 17 deletions

View File

@@ -812,7 +812,7 @@ void CdbEngine::runEngine()
} }
if (startParameters().startMode == AttachCore) { if (startParameters().startMode == AttachCore) {
QTC_ASSERT(!m_coreStopReason.isNull(), return; ); QTC_ASSERT(!m_coreStopReason.isNull(), return; );
notifyInferiorUnrunnable(); notifyEngineRunOkAndInferiorUnrunnable();
processStop(*m_coreStopReason, false); processStop(*m_coreStopReason, false);
} else { } else {
doContinueInferior(); doContinueInferior();

View File

@@ -825,7 +825,7 @@ void DebuggerEnginePrivate::doRunEngine()
m_engine->runEngine(); m_engine->runEngine();
} }
void DebuggerEngine::notifyInferiorUnrunnable() void DebuggerEngine::notifyEngineRunOkAndInferiorUnrunnable()
{ {
showMessage(_("NOTE: INFERIOR UNRUNNABLE")); showMessage(_("NOTE: INFERIOR UNRUNNABLE"));
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
@@ -904,16 +904,6 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
} }
} }
void DebuggerEngine::notifyEngineRunOkAndInferiorRunRequested()
{
showMessage(_("NOTE: ENGINE RUN OK AND INFERIOR RUN REQUESTED"));
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state());
showStatusMessage(tr("Running."));
setState(InferiorRunRequested);
}
void DebuggerEngine::notifyEngineRunAndInferiorRunOk() void DebuggerEngine::notifyEngineRunAndInferiorRunOk()
{ {
showMessage(_("NOTE: ENGINE RUN AND INFERIOR RUN OK")); showMessage(_("NOTE: ENGINE RUN AND INFERIOR RUN OK"));

View File

@@ -293,10 +293,9 @@ protected:
virtual void notifyInferiorSetupOk(); virtual void notifyInferiorSetupOk();
virtual void notifyInferiorSetupFailed(); virtual void notifyInferiorSetupFailed();
virtual void notifyEngineRunOkAndInferiorRunRequested();
virtual void notifyEngineRunAndInferiorRunOk(); virtual void notifyEngineRunAndInferiorRunOk();
virtual void notifyEngineRunAndInferiorStopOk(); virtual void notifyEngineRunAndInferiorStopOk();
virtual void notifyInferiorUnrunnable(); // Called by CoreAdapter. virtual void notifyEngineRunOkAndInferiorUnrunnable(); // Called by CoreAdapter.
// Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead. // Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead.
//virtual void notifyInferiorSpontaneousRun(); //virtual void notifyInferiorSpontaneousRun();

View File

@@ -243,7 +243,7 @@ void GdbCoreEngine::runEngine()
void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response) void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
{ {
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
notifyInferiorUnrunnable(); notifyEngineRunOkAndInferiorUnrunnable();
if (response.resultClass == ResultDone) { if (response.resultClass == ResultDone) {
showMessage(tr("Attached to core."), StatusBar); showMessage(tr("Attached to core."), StatusBar);
// Due to the auto-solib-add off setting, we don't have any // Due to the auto-solib-add off setting, we don't have any

View File

@@ -93,7 +93,6 @@ void GdbPlainEngine::handleExecRun(const DebuggerResponse &response)
{ {
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
if (response.resultClass == ResultRunning) { if (response.resultClass == ResultRunning) {
//notifyEngineRunOkAndInferiorRunRequested();
notifyEngineRunAndInferiorRunOk(); // For gdb < 7.0 notifyEngineRunAndInferiorRunOk(); // For gdb < 7.0
//showStatusMessage(tr("Running...")); //showStatusMessage(tr("Running..."));
showMessage(_("INFERIOR STARTED")); showMessage(_("INFERIOR STARTED"));

View File

@@ -535,7 +535,7 @@ void QmlCppEngine::slaveEngineStateChanged
} }
case InferiorUnrunnable: { case InferiorUnrunnable: {
qmlEngine()->quitDebugger(); qmlEngine()->quitDebugger();
notifyInferiorUnrunnable(); notifyEngineRunOkAndInferiorUnrunnable();
break; break;
} }
case InferiorRunRequested: { case InferiorRunRequested: {