diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index e194fbdf462..cb9aef370ba 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -416,6 +417,12 @@ BreakpointData *BreakHandler::findWatchPointByAddress(const QByteArray &a) const return 0; } +bool BreakHandler::watchPointAt(quint64 address) const +{ + const QByteArray addressBA = QByteArray("0x") + QByteArray::number(address, 16); + return findWatchPointByAddress(addressBA); +} + void BreakHandler::saveBreakpoints() { QList list; diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 77ed135d177..4f800a77ff4 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -71,6 +71,7 @@ public: BreakpointData *findSimilarBreakpoint(const BreakpointData &needle) const; BreakpointData *findBreakpointByNumber(int bpNumber) const; BreakpointData *findWatchPointByAddress(const QByteArray &a) const; + bool watchPointAt(quint64 address) const; void updateMarkers(); QList insertedBreakpoints() const; diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index f1693dcee01..2799a53d825 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -331,9 +331,14 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) const QString watchPointFormat = tr("Break on Changing Contents of 0x%1"); actSetWatchPointAtVariableAddress = new QAction(watchPointFormat.arg(address, 0, 16), &menu); - if (createPointerActions) + actSetWatchPointAtVariableAddress->setCheckable(true); + actSetWatchPointAtVariableAddress->setChecked(m_manager->breakHandler()->watchPointAt(address)); + if (createPointerActions) { actSetWatchPointAtPointerValue = new QAction(watchPointFormat.arg(pointerValue, 0, 16), &menu); + actSetWatchPointAtPointerValue->setCheckable(true); + actSetWatchPointAtPointerValue->setChecked(m_manager->breakHandler()->watchPointAt(pointerValue)); + } } else { actSetWatchPointAtVariableAddress = new QAction(tr("Break on Changing Contents"), &menu);