Handle watching/tooltips of C++ editor tokens consistently.

For editor tooltips and the editor context menu
'Watch expression', always try to find a local variable first
and use its expression.

Change the tooltip manager/widgets not to rely on the debugger
model enum and obscure expression, filter by complete iname
instead. Remove obsolete enumeration.

Change gdb's handling of tooltips such that local variables
are displayed immediately without creating additional tooltip
items.

Change-Id: I9b55823428029ba50d84d3a8cab55eb58942e72b
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2012-08-31 11:34:27 +02:00
committed by hjk
parent a37eca63b6
commit 6886e485de
11 changed files with 148 additions and 97 deletions

View File

@@ -1143,7 +1143,12 @@ public slots:
exp = fixCppExpression(exp);
if (exp.isEmpty())
return;
currentEngine()->watchHandler()->watchExpression(exp);
const QString name = exp;
// Prefer to watch an existing local variable by its expression (address) if it can be found.
WatchHandler *watchHandler = currentEngine()->watchHandler();
if (const WatchData *localVariable = watchHandler->findCppLocalVariable(exp))
exp = QLatin1String(localVariable->exp);
watchHandler->watchExpression(exp, name);
}
void handleExecExit()