Debugger: Allow re-evaluation of certain expressions without stepping

There are cases like changing an Evaluated Expression that make
re-evaluation necessary.

Change-Id: I51fe46b67399a59aebbdeb9c3e778795b1c52cf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-05-17 15:01:46 +02:00
parent b5d6441562
commit e9e47ab452
3 changed files with 11 additions and 1 deletions

View File

@@ -2043,6 +2043,15 @@ void DebuggerEngine::updateItem(const QByteArray &iname)
doUpdateLocals(params);
}
void DebuggerEngine::updateWatchData(const QByteArray &iname)
{
// This is used in cases where re-evaluation is ok for the same iname
// e.g. when changing the expression in a watcher.
UpdateParameters params;
params.partialVariable = iname;
doUpdateLocals(params);
}
void DebuggerEngine::expandItem(const QByteArray &iname)
{
updateItem(iname);

View File

@@ -197,6 +197,7 @@ public:
virtual bool canHandleToolTip(const DebuggerToolTipContext &) const;
virtual void expandItem(const QByteArray &iname); // Called when item in tree gets expanded.
virtual void updateItem(const QByteArray &iname); // Called for fresh watch items.
void updateWatchData(const QByteArray &iname); // FIXME: Merge with above.
virtual void selectWatchData(const QByteArray &iname);
virtual void startDebugger(DebuggerRunControl *runControl);

View File

@@ -1445,7 +1445,7 @@ void WatchHandler::watchExpression(const QString &exp0, const QString &name)
item->setValue(QString(QLatin1Char(' ')));
item->update();
} else {
m_model->m_engine->updateItem(item->iname);
m_model->m_engine->updateWatchData(item->iname);
}
updateWatchersWindow();
}