diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index 7d8e0c7de42e954b0d110e9c2d15ee1aefc929c2..4005202570d3170ee133c1e8f1f23b2259a65f41 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -1543,11 +1543,15 @@ def testit():
     db.process = db.target.Launch(listener, None, None, None, None,
         None, None, 0, False, error)
 
+    stoppedThread = db.firstStoppedThread()
+    if stoppedThread:
+        db.process.SetSelectedThread(stoppedThread)
+
     db.report = savedReport
     ns = db.qtNamespace()
     db.reportVariables()
     db.report("@NS@%s@" % ns)
-    #db.report("DUMPER=%s" % qqDumpers)
+    #db.report("DUMPER=%s" % db.qqDumpers)
 
 if __name__ == "__main__":
     if len(sys.argv) > 2:
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 40f4fb54888d98f07f2634b0f21822b4328c80a4..7d53187d05544d0aaab9b16df0ce0af4fba5323e 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -976,9 +976,9 @@ void tst_Dumpers::dumper()
             "\n\n#if defined(_MSC_VER)" + (data.useQt ?
                 "\n#include <qt_windows.h>" :
                 "\n#include <Windows.h>") +
-            "\n#define BREAK DebugBreak();"
+            "\n#define BREAK do { DebugBreak(); } while (0)"
             "\n#else"
-            "\n#define BREAK asm(\"int $3\");"
+            "\n#define BREAK do { asm(\"int $3\"); } while (0)"
             "\n#endif"
             "\n"
             "\n\n" + data.includes +
@@ -3680,6 +3680,9 @@ void tst_Dumpers::dumper_data()
                     "    thread[i].m_id = i;\n"
                     "    thread[i].setObjectName(\"This is thread #\" + QString::number(i));\n"
                     "    thread[i].start();\n"
+                    "}\n"
+                    "for (int i = 0; i != N; ++i) {\n"
+                    "    thread[i].wait();\n"
                     "}\n")
                % CoreProfile()
                % CheckType("this", "Thread")