aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/watchhandler.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2012-10-29 12:59:53 +0100
committerhjk <[email protected]>2012-10-29 13:29:56 +0100
commit0ae5695649a2dbbcea18b7f491746daaff834568 (patch)
tree0e390b1bd2e4d31656a3bfe13f6175efe32d624b /src/plugins/debugger/watchhandler.cpp
parent1f9e226e77a02d222ae920b4a87cc7e240a1ce82 (diff)
Try to watch local variable in watchwindow-DND, too.
Fix codepath overlooked in 6886e485de59bc1fe1fe84ca6c1fb1263b18420b by introducing a WatchHandler::watchVariable(). Task-number: QTCREATORBUG-8120 Change-Id: Ibab2619754e0006f3c81810a6bfdf758261c169e Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r--src/plugins/debugger/watchhandler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index ebeb8629b68..86a47c9b869 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -1586,6 +1586,18 @@ void WatchHandler::watchExpression(const QString &exp, const QString &name)
updateWatchersWindow();
}
+// Watch something obtained from the editor.
+// Prefer to watch an existing local variable by its expression
+// (address) if it can be found. Default to watchExpression().
+void WatchHandler::watchVariable(const QString &exp)
+{
+ if (const WatchData *localVariable = findCppLocalVariable(exp)) {
+ watchExpression(QLatin1String(localVariable->exp), exp);
+ } else {
+ watchExpression(exp);
+ }
+}
+
static void swapEndian(char *d, int nchar)
{
QTC_ASSERT(nchar % 4 == 0, return);