Commit 3c8602f9 authored by Aurindam Jana's avatar Aurindam Jana

QmlDebugging: Expand watch data that were previously expanded

The watch data model is cleared on every debug step. Hence,
tracking of expanded watch data is lost. Now, we keep track
of expanded watch data when stepping. However, we still lose
track of this data on a scope/stack change.

Task-number: QTCREATORBUG-8901
Change-Id: I1dc609cae1c3a36d8320864f71336b655eaa09d1
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 6a0488fd
......@@ -1647,6 +1647,15 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const
d->clearCache();
const int frameIndex = stackHandler->currentIndex();
QSet<QByteArray> expandedInames = watchHandler->expandedINames();
QHash<quint64, QByteArray> handlesToLookup;
// Store handles of all expanded watch data
foreach (const QByteArray &iname, expandedInames) {
const WatchData *wd = watchHandler->findData(iname);
if (!wd || !wd->isLocal())
continue;
handlesToLookup.insert(wd->id, iname);
}
watchHandler->removeAllData();
if (frameIndex < 0)
return;
......@@ -1685,6 +1694,11 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const
d->scope(scopeIndex);
}
d->engine->gotoLocation(stackHandler->currentFrame());
// Expand watch data that were previously expanded
QHash<quint64, QByteArray>::const_iterator itEnd = handlesToLookup.end();
for (QHash<quint64, QByteArray>::const_iterator it = handlesToLookup.begin(); it != itEnd; ++it)
expandObject(it.value(), it.key());
emit stackFrameCompleted();
}
......
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