diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index f87947dbe32..14f6defacd5 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -256,7 +256,6 @@ public: ExitRequest = DebuggerCommand::ExitRequest, RunRequest = DebuggerCommand::RunRequest, LosesChild = DebuggerCommand::LosesChild, - RebuildBreakpointModel = DebuggerCommand::RebuildBreakpointModel, InUpdateLocals = DebuggerCommand::InUpdateLocals, NativeCommand = DebuggerCommand::NativeCommand, Silent = DebuggerCommand::Silent diff --git a/src/plugins/debugger/debuggerprotocol.h b/src/plugins/debugger/debuggerprotocol.h index 07df3eecd6a..634934ec964 100644 --- a/src/plugins/debugger/debuggerprotocol.h +++ b/src/plugins/debugger/debuggerprotocol.h @@ -84,8 +84,6 @@ public: ExitRequest = 32, // Auto-set inferior shutdown related states. LosesChild = 64, - // Trigger breakpoint model rebuild when no such commands are pending anymore. - RebuildBreakpointModel = 128, // This is a native (non-Python) command that's handled directly by the backend. NativeCommand = 256, // This is a command that needs to be wrapped into -interpreter-exec console diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 05075a3ff33..dc0af460838 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -739,15 +739,6 @@ void GdbEngine::runCommand(const DebuggerCommand &command) return; } - if (cmd.flags & RebuildBreakpointModel) { - ++m_pendingBreakpointRequests; - PENDING_DEBUG(" BREAKPOINT MODEL:" << cmd.function - << "INCREMENTS PENDING TO" << m_pendingBreakpointRequests); - } else { - PENDING_DEBUG(" OTHER (IN):" << cmd.function - << "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests); - } - if (cmd.flags & (NeedsTemporaryStop|NeedsFullStop)) { showMessage("RUNNING NEEDS-STOP COMMAND " + cmd.function); const bool wantContinue = bool(cmd.flags & NeedsTemporaryStop); @@ -769,7 +760,8 @@ void GdbEngine::runCommand(const DebuggerCommand &command) requestInterruptInferior(); return; } - showMessage("UNSAFE STATE FOR QUEUED COMMAND. EXECUTING IMMEDIATELY"); + if (state() != InferiorStopOk) + showMessage("UNSAFE STATE FOR QUEUED COMMAND. EXECUTING IMMEDIATELY"); } if (!(cmd.flags & Discardable)) @@ -1008,18 +1000,6 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response) if (cmd.callback) cmd.callback(*response); - if (flags & RebuildBreakpointModel) { - --m_pendingBreakpointRequests; - PENDING_DEBUG(" BREAKPOINT" << cmd.function); - if (m_pendingBreakpointRequests <= 0) { - PENDING_DEBUG("\n\n ... AND TRIGGERS BREAKPOINT MODEL UPDATE\n"); - attemptBreakpointSynchronization(); - } - } else { - PENDING_DEBUG(" OTHER (OUT):" << cmd.function - << "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests); - } - // Continue only if there are no commands wire anymore, so this will // be fully synchronous. // This is somewhat inefficient, as it makes the last command synchronous. @@ -2366,7 +2346,7 @@ void GdbEngine::handleBreakInsert1(const DebuggerResponse &response, Breakpoint const GdbMi mainbkpt = response.data["bkpt"]; bp.notifyBreakpointRemoveProceeding(); DebuggerCommand cmd("-break-delete " + mainbkpt["number"].data()); - cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel; + cmd.flags = NeedsTemporaryStop; runCommand(cmd); bp.notifyBreakpointRemoveOk(); return; @@ -2393,14 +2373,14 @@ void GdbEngine::handleBreakInsert1(const DebuggerResponse &response, Breakpoint const int lineNumber = bp.lineNumber(); DebuggerCommand cmd("trace \"" + GdbMi::escapeCString(fileName) + "\":" + QString::number(lineNumber), - NeedsTemporaryStop | RebuildBreakpointModel); + NeedsTemporaryStop); runCommand(cmd); } else { // Some versions of gdb like "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)" // know how to do pending breakpoints using CLI but not MI. So try // again with MI. DebuggerCommand cmd("break " + breakpointLocation2(bp.parameters()), - NeedsTemporaryStop | RebuildBreakpointModel); + NeedsTemporaryStop); cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert2(r, bp); }; runCommand(cmd); } @@ -2559,7 +2539,7 @@ void GdbEngine::insertBreakpoint(Breakpoint bp) } else if (type == BreakpointAtFork) { cmd.function = "catch fork"; cmd.callback = handleCatch; - cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel; + cmd.flags = NeedsTemporaryStop; runCommand(cmd); // Another one... cmd.function = "catch vfork"; @@ -2596,7 +2576,7 @@ void GdbEngine::insertBreakpoint(Breakpoint bp) cmd.function += breakpointLocation(bp.parameters()); cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert1(r, bp); }; } - cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel; + cmd.flags = NeedsTemporaryStop; runCommand(cmd); } @@ -2645,7 +2625,7 @@ void GdbEngine::changeBreakpoint(Breakpoint bp) bp.notifyBreakpointChangeOk(); return; } - cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel; + cmd.flags = NeedsTemporaryStop; runCommand(cmd); } @@ -2673,7 +2653,7 @@ void GdbEngine::removeBreakpoint(Breakpoint bp) // We already have a fully inserted breakpoint. bp.notifyBreakpointRemoveProceeding(); showMessage(QString("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName())); - DebuggerCommand cmd("-break-delete " + br.id.toString(), NeedsTemporaryStop | RebuildBreakpointModel); + DebuggerCommand cmd("-break-delete " + br.id.toString(), NeedsTemporaryStop); runCommand(cmd); // Pretend it succeeds without waiting for response. Feels better. @@ -4922,8 +4902,6 @@ void GdbEngine::handleCoreRoundTrip(const DebuggerResponse &response) void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms) { - m_pendingBreakpointRequests = 0; - watchHandler()->notifyUpdateStarted(params); DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index d9c0c3cc72b..fb5b95279e0 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -159,8 +159,6 @@ private: ////////// General Interface ////////// int m_oldestAcceptableToken = -1; int m_nonDiscardableCount = 0; - int m_pendingBreakpointRequests = 0; // Watch updating commands in flight - typedef void (GdbEngine::*CommandsDoneCallback)(); // This function is called after all previous responses have been received. CommandsDoneCallback m_commandsDoneCallback = nullptr;