summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-06-16 15:01:46 +0200
committerhjk <hjk@theqtcompany.com>2015-06-17 06:26:24 +0000
commitad6451bbe430ae1776744bd50d8c74cc00b470f4 (patch)
treede9df2a4e79b61e15e67e8fc1cdcd0d848482532
parent13daaaac675b3db91103536d24490056bbcd6741 (diff)
downloadqt-creator-ad6451bbe430ae1776744bd50d8c74cc00b470f4.tar.gz
Debugger: Remove the InferiorExited state
There are now several possible orders of events between sending a 'kill' and receiving something that indicated a properly shut down inferior. Coordinating the InferiorExited state during engine ramp down is not worthwhile as that state had only a forced transition to InferiorShutdownOk anyway. For the user (and user code), only the fact that ramp down is finished is interesting. Change-Id: Ic22131d5a1066dc62bd069f532c28b773f231088 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--src/plugins/debugger/debuggerconstants.h2
-rw-r--r--src/plugins/debugger/debuggerengine.cpp13
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp8
-rw-r--r--src/plugins/debugger/qml/qmlcppengine.cpp6
5 files changed, 9 insertions, 22 deletions
diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h
index f0f69da3bd..cae3641433 100644
--- a/src/plugins/debugger/debuggerconstants.h
+++ b/src/plugins/debugger/debuggerconstants.h
@@ -102,8 +102,6 @@ enum DebuggerState
InferiorStopOk, // Debuggee stopped
InferiorStopFailed, // Debuggee not stopped, will kill debugger
- InferiorExitOk,
-
InferiorShutdownRequested,
InferiorShutdownFailed,
InferiorShutdownOk,
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 9b75b834ac..f3fd3bfa84 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -382,7 +382,6 @@ const char *DebuggerEngine::stateName(int s)
SN(InferiorStopRequested)
SN(InferiorStopOk)
SN(InferiorStopFailed)
- SN(InferiorExitOk)
SN(InferiorShutdownRequested)
SN(InferiorShutdownOk)
SN(InferiorShutdownFailed)
@@ -720,20 +719,17 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to)
return to == InferiorStopOk;
case InferiorRunOk:
return to == InferiorStopRequested
- || to == InferiorStopOk // A spontaneous stop.
- || to == InferiorExitOk;
+ || to == InferiorStopOk // A spontaneous stop.
+ || to == InferiorShutdownOk; // A spontaneous exit.
case InferiorStopRequested:
return to == InferiorStopOk || to == InferiorStopFailed;
case InferiorStopOk:
return to == InferiorRunRequested || to == InferiorShutdownRequested
- || to == InferiorStopOk || to == InferiorExitOk;
+ || to == InferiorStopOk || to == InferiorShutdownOk;
case InferiorStopFailed:
return to == EngineShutdownRequested;
- case InferiorExitOk:
- return to == InferiorShutdownOk;
-
case InferiorUnrunnable:
return to == InferiorShutdownRequested;
case InferiorShutdownRequested:
@@ -1201,7 +1197,6 @@ void DebuggerEngine::notifyInferiorExited()
#endif
showMessage(_("NOTE: INFERIOR EXITED"));
d->resetLocation();
- setState(InferiorExitOk);
setState(InferiorShutdownOk);
if (isMasterEngine())
d->queueShutdownEngine();
@@ -1364,7 +1359,6 @@ bool DebuggerEngine::debuggerActionsEnabled(DebuggerState state)
case EngineRunFailed:
case InferiorSetupFailed:
case InferiorStopFailed:
- case InferiorExitOk:
case InferiorShutdownRequested:
case InferiorShutdownOk:
case InferiorShutdownFailed:
@@ -1428,7 +1422,6 @@ void DebuggerEngine::quitDebugger()
break;
case EngineRunFailed:
case DebuggerFinished:
- case InferiorExitOk:
case InferiorShutdownOk:
break;
case InferiorSetupRequested:
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index df1271e963..8346359cfc 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -275,7 +275,7 @@
{notifyInferior- + + +
Exited} + + +
+ + + +
- InferiorExitOk + + +
+ + + + +
+ + + +
InferiorShutdownOk InferiorShutdownFailed +
* * +
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 702ecdc7e7..a2380d3bc6 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -135,7 +135,6 @@ static bool stateAcceptsGdbCommands(DebuggerState state)
case InferiorStopFailed:
case InferiorSetupOk:
case EngineRunFailed:
- case InferiorExitOk:
case InferiorRunFailed:
case EngineShutdownOk:
case EngineShutdownFailed:
@@ -1876,11 +1875,14 @@ void GdbEngine::shutdownInferior()
void GdbEngine::handleInferiorShutdown(const DebuggerResponse &response)
{
- CHECK_STATE(InferiorShutdownRequested);
if (response.resultClass == ResultDone) {
- notifyInferiorShutdownOk();
+ // We'll get async thread-group-exited responses to which we react.
+ // Nothing to do here.
+ // notifyInferiorShutdownOk();
return;
}
+ // "kill" got stuck, or similar.
+ CHECK_STATE(InferiorShutdownRequested);
QByteArray ba = response.data["msg"].data();
if (ba.contains(": No such file or directory.")) {
// This happens when someone removed the binary behind our back.
diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp
index baef8df87c..69d905acf4 100644
--- a/src/plugins/debugger/qml/qmlcppengine.cpp
+++ b/src/plugins/debugger/qml/qmlcppengine.cpp
@@ -649,12 +649,6 @@ void QmlCppEngine::slaveEngineStateChanged
notifyInferiorStopFailed();
break;
}
- case InferiorExitOk: {
- // InferiorExitOk will be called through notifyInferiorExited
- // when InferiorShutDownOk is reached
- qmlEngine()->quitDebugger();
- break;
- }
case InferiorShutdownRequested: {
if (state() == InferiorStopOk) {
setState(InferiorShutdownRequested);