OSDN Git Service

Debugger: Avoid "Could not connect ... QML debugger" warning for mixed debugging
authorKai Koehne <kai.koehne@nokia.com>
Thu, 13 Oct 2011 13:32:42 +0000 (15:32 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Thu, 13 Oct 2011 15:22:44 +0000 (17:22 +0200)
There's a race condition between the QML Engine trying to connect after the app printed
"Waiting on debugger port ...", and any possible Cpp breakpoints stopping the app.
Therefore, don't annoy the user with "Could not connec to QML Debugger" warnings
while the Cpp debugger is stepping.

Change-Id: I77f6f98e835e45363c5d47e10b39df249f65a1a3
Task-number: QTCREATORBUG-6249
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
src/plugins/debugger/qml/qmlengine.cpp

index 46ccd86..9d2c4cb 100644 (file)
@@ -210,6 +210,14 @@ void QmlEngine::beginConnection()
 
 void QmlEngine::connectionStartupFailed()
 {
+    if (isSlaveEngine()) {
+        if (masterEngine()->state() != InferiorRunOk) {
+            // we're right now debugging C++, just try longer ...
+            beginConnection();
+            return;
+        }
+    }
+
     Core::ICore * const core = Core::ICore::instance();
     QMessageBox *infoBox = new QMessageBox(core->mainWindow());
     infoBox->setIcon(QMessageBox::Critical);