Commit e40c28cc authored by Robert Loehning's avatar Robert Loehning
Browse files

Debbuger: Checking menu action if watchpoint is set

parent 46651880
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment