diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index eba4e69e2194a14673c1f6fcda04c2ce5f1b4c59..c1ca49f8eb26c900c9c2884e9097afa2b4c1e059 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -715,7 +715,7 @@ void GdbEngine::interruptInferior() QTC_ASSERT(state() == InferiorStopRequested, qDebug() << "INTERRUPT INFERIOR: " << state(); return); - if (0 && debuggerCore()->boolSetting(TargetAsync)) { + if (usesExecInterrupt()) { postCommand("-exec-interrupt"); } else { showStatusMessage(tr("Stop requested..."), 5000); @@ -1715,6 +1715,11 @@ void GdbEngine::handleShowVersion(const GdbResponse &response) if (m_gdbVersion > 70300) m_hasBreakpointNotifications = true; + + if (usesExecInterrupt()) + postCommand("set target-async on", ConsoleCommand); + else + postCommand("set target-async off", ConsoleCommand); } } @@ -4707,11 +4712,7 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &settingsIdHint) postCommand("set trust-readonly-sections on", ConsoleCommand); postCommand("set auto-solib-add on", ConsoleCommand); postCommand("set remotecache on", ConsoleCommand); - - if (0 && debuggerCore()->boolSetting(TargetAsync)) { - postCommand("set target-async on", ConsoleCommand); - postCommand("set non-stop on", ConsoleCommand); - } + //postCommand("set non-stop on", ConsoleCommand); // Work around https://bugreports.qt-project.org/browse/QTCREATORBUG-2004 postCommand("maintenance set internal-warning quit no", ConsoleCommand); @@ -5130,6 +5131,17 @@ bool GdbEngine::isHiddenBreakpoint(const BreakpointResponseId &id) const return isQFatalBreakpoint(id) || isQmlStepBreakpoint(id); } +bool GdbEngine::usesExecInterrupt() const +{ + if (m_gdbVersion < 70000) + return false; + + // debuggerCore()->boolSetting(TargetAsync) + DebuggerStartMode mode = startParameters().startMode; + return mode == AttachToRemoteServer + || mode == AttachToRemoteProcess; +} + void GdbEngine::scheduleTestResponse(int testCase, const QByteArray &response) { if (!m_testCases.contains(testCase) && startParameters().testCase != testCase) diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index f8b8fc3df594378333a83df0b0b3c9a4017b05d6..08d4e0b17a585cf8df5964f314ce29abe4ffa8aa 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -732,6 +732,8 @@ private: ////////// View & Data Stuff ////////// BreakpointResponseId m_qFatalBreakpointResponseId; bool m_actingOnExpectedStop; + bool usesExecInterrupt() const; + QHash<int, QByteArray> m_scheduledTestResponses; QSet<int> m_testCases; };