Debugger: Avoid looking up references too often

Multiple copies of lookup requests may accumulate when stepping
too quickly, outsmarting the 'all updates done' logic, keeping
Locals&Expressions in the grey 'update ongoing' state.

Change-Id: Icec24ce1af8d273c3439ee91800ed1f4381ee19a
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
(cherry picked from commit c1de315d6c)
This commit is contained in:
hjk
2016-04-13 15:13:54 +02:00
parent 25603f9dc8
commit 12788ffb2d

View File

@@ -125,7 +125,7 @@ struct LookupData
QByteArray exp;
};
typedef QMultiHash<int, LookupData> LookupItems; // id -> (iname, exp)
typedef QHash<int, LookupData> LookupItems; // id -> (iname, exp)
class QmlEnginePrivate : QmlDebugClient
{
@@ -1375,8 +1375,14 @@ void QmlEnginePrivate::lookup(const LookupItems &items)
if (items.isEmpty())
return;
QList<int> handles = items.keys();
currentlyLookingUp += items;
QList<int> handles;
for (auto it = items.begin(); it != items.end(); ++it) {
const int handle = it.key();
if (!currentlyLookingUp.contains(handle)) {
currentlyLookingUp.insert(handle, it.value());
handles.append(handle);
}
}
DebuggerCommand cmd(LOOKUP);
cmd.arg(HANDLES, handles);