OSDN Git Service

debugger: handle forced shutdown in "running" state gracefully
authorhjk <qtc-committer@nokia.com>
Mon, 11 Oct 2010 12:39:16 +0000 (14:39 +0200)
committerhjk <qtc-committer@nokia.com>
Mon, 11 Oct 2010 14:22:23 +0000 (16:22 +0200)
Reviewed-by: Friedemann Kleint
Task-number: QTCREATORBUG-2681

src/plugins/debugger/debuggerengine.cpp

index 49227cb..ff1c1c6 100644 (file)
@@ -1414,15 +1414,23 @@ void DebuggerEngine::notifyEngineIll()
     switch (state()) {
         case InferiorRunRequested:
         case InferiorRunOk:
+            // The engine does not look overly ill right now, so attempt to
+            // properly interrupt at least once. If that fails, we are on the
+            // shutdown path due to d->m_targetState anyways.
+            setState(InferiorStopRequested, true);
+            showMessage(_("ATTEMPT TO INTERRUPT INFERIOR"));
+            interruptInferior();
+            break;
         case InferiorStopRequested:
         case InferiorStopOk:
-            qDebug() << "FORWARDING STATE TO " << InferiorShutdownFailed;
+            showMessage(_("FORWARDING STATE TO InferiorShutdownFailed"));
             setState(InferiorShutdownFailed, true);
+            d->queueShutdownEngine();
             break;
         default:
+            d->queueShutdownEngine();
             break;
     }
-    d->queueShutdownEngine();
 }
 
 void DebuggerEngine::notifyEngineSpontaneousShutdown()