From af3a387b5f9e3a254b4bcd47460797828dc25640 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 13 Oct 2009 14:54:23 +0200
Subject: [PATCH] do not attempt to load dumpers until the inferior is fully
 initialized

specifically, this will skip the initial stop at _start when using the
terminal and remote adapters.
---
 src/plugins/debugger/gdb/gdbengine.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index f4d2576e85d..16028e0a33c 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -1048,13 +1048,16 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
         return;
     }
 
+    bool initHelpers = true;
     if (state() == InferiorRunning) {
         // Stop triggered by a breakpoint or otherwise not directly
         // initiated by the user.
         setState(InferiorStopping);
     } else {
-        QTC_ASSERT(state() == InferiorStopping || state() == InferiorStarting,
-                   qDebug() << state());
+        if (state() == InferiorStarting)
+            initHelpers = false;
+        else
+            QTC_ASSERT(state() == InferiorStopping, qDebug() << state());
     }
     setState(InferiorStopped);
 
@@ -1116,9 +1119,10 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
     }
 
     if (isStoppedReason(reason) || reason.isEmpty()) {
+        if (initHelpers && m_debuggingHelperState != DebuggingHelperUninitialized)
+            initHelpers = false;
         // Don't load helpers on stops triggered by signals unless it's
         // an intentional trap.
-        bool initHelpers = m_debuggingHelperState == DebuggingHelperUninitialized;
         if (initHelpers && reason == "signal-received"
                 && data.findChild("signal-name").data() != "SIGTRAP")
             initHelpers = false;
-- 
GitLab