diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index f23da12034d88fc49d811ae5b4c33e9cb1e65aa9..5193aae62143ab0225de13944bb03e3403632727 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -1513,8 +1513,20 @@ void DebuggerEngine::selectWatchData(const QString &) { } -void DebuggerEngine::watchPoint(const QPoint &) -{ +void DebuggerEngine::watchPoint(const QPoint &pnt) +{ + DebuggerCommand cmd("watchPoint", NeedsFullStop); + cmd.arg("x", pnt.x()); + cmd.arg("y", pnt.y()); + cmd.callback = [this](const DebuggerResponse &response) { + qulonglong addr = response.data["selected"].toAddress(); + if (addr == 0) + showStatusMessage(tr("Could not find a widget.")); + // Add the watcher entry nevertheless, as that's the place where + // the user expects visual feedback. + watchHandler()->watchExpression(response.data["expr"].data(), QString(), true); + }; + runCommand(cmd); } void DebuggerEngine::runCommand(const DebuggerCommand &) diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index bf1c9749137b608a7029635b9916b7b30dce1cf9..b1665989bee6373b274388c5e19d02d84f0d420f 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -220,7 +220,7 @@ public: virtual void startDebugger(DebuggerRunControl *runControl); virtual void prepareForRestart() {} - virtual void watchPoint(const QPoint &); + virtual void watchPoint(const QPoint &pnt); virtual void runCommand(const DebuggerCommand &cmd); virtual void openMemoryView(const MemoryViewSetupData &data); virtual void fetchMemory(MemoryAgent *, quint64 addr, quint64 length); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 4c68489a586f2cb7de1ed35b1896fb2e08ccfe97..9a0c752495701abf10729a3ce37a5fe40000eaf4 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3615,29 +3615,6 @@ void GdbEngine::assignValueInDebugger(WatchItem *item, runCommand(cmd); } -void GdbEngine::watchPoint(const QPoint &pnt) -{ - DebuggerCommand cmd("watchPoint", NeedsFullStop); - cmd.arg("x", pnt.x()); - cmd.arg("y", pnt.y()); - cmd.callback = CB(handleWatchPoint); - runCommand(cmd); -} - -void GdbEngine::handleWatchPoint(const DebuggerResponse &response) -{ - if (response.resultClass == ResultDone) { - GdbMi res; - res.fromString(response.consoleStreamOutput); - qulonglong addr = res["selected"].toAddress(); - if (addr == 0) - showStatusMessage(tr("Could not find a widget.")); - // Add the watcher entry nevertheless, as that's the place where - // the user expects visual feedback. - watchHandler()->watchExpression(res["expr"].data(), QString(), true); - } -} - class MemoryAgentCookie { public: diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index e03d3ab4e6cc70916e4c70ea436303ce134acc83..b60b3df2c098e9669d8476ff03b0e2f4127e5208 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -355,9 +355,6 @@ protected: void changeMemory(MemoryAgent *agent, quint64 addr, const QByteArray &data) override; void handleFetchMemory(const DebuggerResponse &response, MemoryAgentCookie ac); - void watchPoint(const QPoint &) override; - void handleWatchPoint(const DebuggerResponse &response); - void showToolTip(); void handleVarAssign(const DebuggerResponse &response); diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index d531c7fd4b8fe10f3f891f2657eff7fbbcdf151f..651a4396ae8acc974ed41f9973809d2a4e96ac02 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -148,22 +148,6 @@ void LldbEngine::debugLastCommand() runCommand(m_lastDebuggableCommand); } -void LldbEngine::watchPoint(const QPoint &pnt) -{ - DebuggerCommand cmd("watchPoint", NeedsFullStop); - cmd.arg("x", pnt.x()); - cmd.arg("y", pnt.y()); - cmd.callback = [this](const DebuggerResponse &response) { - qulonglong addr = response.data["selected"].toAddress(); - if (addr == 0) - showStatusMessage(tr("Could not find a widget.")); - // Add the watcher entry nevertheless, as that's the place where - // the user expects visual feedback. - watchHandler()->watchExpression(response.data["expr"].data(), QString(), true); - }; - runCommand(cmd); -} - void LldbEngine::shutdownInferior() { QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state()); diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index 9fd9d8217e71b485e9c5761742b22b2f08a10338..eb653b48a5bb035f515739b32184c72d036e1099 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -144,9 +144,6 @@ private: void runCommand(const DebuggerCommand &cmd) override; void debugLastCommand() override; - void watchPoint(const QPoint &) override; - void handleWatchPoint(const DebuggerResponse &response); - private: DebuggerCommand m_lastDebuggableCommand;