diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index e194fbdf462e48ffe1907612ad2f93f86a0eaec9..cb9aef370badda74ec2f003891400c4f14e55e90 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -37,6 +37,7 @@ #include <texteditor/basetextmark.h> #include <utils/qtcassert.h> +#include <QtCore/QByteArray> #include <QtCore/QDebug> #include <QtCore/QTextStream> #include <QtCore/QFileInfo> @@ -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<QVariant> list; diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 77ed135d177ea5fee26cc35e891188ba152a3049..4f800a77ff4657a8d231d2f87d03421065934fa3 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<BreakpointData *> insertedBreakpoints() const; diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index f1693dcee0116aec33d6e250f2a961950fa4772e..2799a53d825ab3041ccd0966834a5e6d881f39a4 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);