summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-11-21 16:58:39 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2014-12-01 10:03:43 +0100
commit47f9622e727c0bdac1b9ed447338ac99af04dea4 (patch)
treefc92aba57c539c13a9a6541f2b4ae92bade2a0e3
parent245ea90817014422bcce964d1b7aa8deeb7a981d (diff)
downloadqt-creator-47f9622e727c0bdac1b9ed447338ac99af04dea4.tar.gz
Fix QML watch expressions for v8
Fix syncing of watch expressions with Qt Quick 2. For v8/v4 we're utilizing the 'evaluate' command, which we have to re-send on every change to get updates. We therefore now call synchronizeWatchers() whenever the stack changes. Task-number: QTCREATORBUG-13473 Change-Id: I7356e9518a719839c5cbb6e518be18e665078e85 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp2
-rw-r--r--src/plugins/debugger/qml/qmlv8debuggerclient.cpp14
2 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index bbadd161a9..7efd0ace73 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -1176,6 +1176,8 @@ void QmlEngine::updateCurrentContext()
context = grandParentData->name;
}
+ synchronizeWatchers();
+
QmlJS::ConsoleManagerInterface *consoleManager = qmlConsoleManager();
if (consoleManager)
consoleManager->setContext(tr("Context:") + QLatin1Char(' ') + context);
diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
index 8b0c93cb8e..1de81dbdbf 100644
--- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
+++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
@@ -135,7 +135,6 @@ public:
QList<int> debuggerCommands;
//Cache
- QStringList watchedExpressions;
QList<int> currentFrameScopes;
QHash<int, int> stackIndexLookup;
@@ -722,9 +721,7 @@ QmlV8ObjectData extractData(const QVariant &data, const QVariant &refsVal)
void QmlV8DebuggerClientPrivate::clearCache()
{
- watchedExpressions.clear();
currentFrameScopes.clear();
- evaluatingExpression.clear();
updateLocalsAndWatchers.clear();
}
@@ -958,15 +955,12 @@ void QmlV8DebuggerClient::synchronizeWatchers(const QStringList &watchers)
{
SDEBUG(watchers);
foreach (const QString &exp, watchers) {
- if (!d->watchedExpressions.contains(exp)) {
- StackHandler *stackHandler = d->engine->stackHandler();
- if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
- d->evaluate(exp, false, false, stackHandler->currentIndex());
- d->evaluatingExpression.insert(d->sequence, exp);
- }
+ StackHandler *stackHandler = d->engine->stackHandler();
+ if (stackHandler->isContentsValid() && stackHandler->currentFrame().isUsable()) {
+ d->evaluate(exp, false, false, stackHandler->currentIndex());
+ d->evaluatingExpression.insert(d->sequence, exp);
}
}
- d->watchedExpressions = watchers;
}
void QmlV8DebuggerClient::expandObject(const QByteArray &iname, quint64 objectId)