OSDN Git Service

QmlCpp Debugging: Only set C++ breakpoints after QML is connected (CDB)
authorKai Koehne <kai.koehne@nokia.com>
Wed, 24 Aug 2011 08:07:12 +0000 (10:07 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Wed, 24 Aug 2011 09:18:01 +0000 (11:18 +0200)
Apply the change we did in 7c31bd6604 also for CDB. The mixed engine
directly calls attemptBreakpointSynchronization as soon as the QML engine
is connected.

Change-Id: I764f785bb5f0575a9a624e29632d21caf5dde39c
Reviewed-on: http://codereview.qt.nokia.com/3468
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
src/plugins/debugger/cdb/cdbengine.cpp

index 2eefdb7..6d6eec3 100644 (file)
@@ -827,12 +827,15 @@ void CdbEngine::setupInferior()
 {
     if (debug)
         qDebug("setupInferior");
-    attemptBreakpointSynchronization();
-
-    if (startParameters().breakOnMain) {
-        const BreakpointParameters bp(BreakpointAtMain);
-        postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings,
-                                            BreakpointModelId(-1), true), 0);
+    if (!isSlaveEngine()) {
+        // QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
+        // (attemptBreakpointSynchronization() will be directly called then)
+        attemptBreakpointSynchronization();
+        if (startParameters().breakOnMain) {
+            const BreakpointParameters bp(BreakpointAtMain);
+            postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings,
+                                                BreakpointModelId(-1), true), 0);
+        }
     }
     postCommand("sxn 0x4000001f", 0); // Do not break on WowX86 exceptions.
     postCommand(".asm source_line", 0); // Source line in assembly