OSDN Git Service

Notify disconnect to debug server when inferiorshutdownrequested
authorAurindam Jana <aurindam.jana@nokia.com>
Wed, 17 Aug 2011 11:42:41 +0000 (13:42 +0200)
committerAurindam Jana <aurindam.jana@nokia.com>
Wed, 17 Aug 2011 12:48:14 +0000 (14:48 +0200)
Change-Id: I15bb1342f647362cb00e4b0d0453b663a2d3f637
Reviewed-on: http://codereview.qt.nokia.com/3095
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
src/plugins/debugger/qml/qmldebuggerclient.h
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlv8debuggerclient.cpp
src/plugins/debugger/qml/qmlv8debuggerclient.h
src/plugins/debugger/qml/qscriptdebuggerclient.cpp
src/plugins/debugger/qml/qscriptdebuggerclient.h

index 984869c..93c0529 100644 (file)
@@ -59,6 +59,7 @@ public:
 
     virtual void continueInferior() = 0;
     virtual void interruptInferior() = 0;
+    virtual void shutdownInferior() = 0;
 
     virtual void activateFrame(int index) = 0;
 
index 06f4d53..9ff9517 100644 (file)
@@ -375,10 +375,13 @@ void QmlEngine::handleRemoteSetupFailed(const QString &message)
 
 void QmlEngine::shutdownInferior()
 {
+    d->m_adapter.activeDebuggerClient()->shutdownInferior();
+
     if (isSlaveEngine()) {
         resetLocation();
     }
     stopApplicationLauncher();
+
     notifyInferiorShutdownOk();
 }
 
@@ -417,7 +420,7 @@ void QmlEngine::interruptInferior()
 {
     logMessage(LogSend, "INTERRUPT");
     d->m_adapter.activeDebuggerClient()->interruptInferior();
-
+    notifyInferiorStopOk();
 }
 
 void QmlEngine::executeStep()
@@ -724,8 +727,6 @@ void QmlEngine::inferiorSpontaneousStop()
 {
     if (state() == InferiorRunOk)
         notifyInferiorSpontaneousStop();
-    else
-        notifyInferiorStopOk();
 }
 
 void QmlEngine::disconnected()
index 0e1d9a4..9c99a4f 100644 (file)
@@ -192,6 +192,18 @@ void QmlV8DebuggerClient::interruptInferior()
 
 }
 
+void QmlV8DebuggerClient::shutdownInferior()
+{
+    QByteArray request;
+
+    JsonInputStream(request) << '{' << INITIALPARAMS ;
+    JsonInputStream(request) << ',' << "command" << ':' << "disconnect";
+
+    JsonInputStream(request) << '}';
+
+    sendMessage(packMessage(request));
+}
+
 void QmlV8DebuggerClient::activateFrame(int index)
 {
     setLocals(index);
index f446bb6..decb635 100644 (file)
@@ -59,6 +59,7 @@ public:
 
     void continueInferior();
     void interruptInferior();
+    void shutdownInferior();
 
     void activateFrame(int index);
 
index bbeed2c..6246e2c 100644 (file)
@@ -192,6 +192,11 @@ void QScriptDebuggerClient::interruptInferior()
     sendMessage(reply);
 }
 
+void QScriptDebuggerClient::shutdownInferior()
+{
+
+}
+
 void QScriptDebuggerClient::activateFrame(int index)
 {
     QByteArray reply;
index 9cc5c40..9ebb93d 100644 (file)
@@ -58,6 +58,7 @@ public:
 
     void continueInferior();
     void interruptInferior();
+    void shutdownInferior();
 
     void activateFrame(int index);