forked from qt-creator/qt-creator
Debugger: Simplify removal of outdated L&E items
This removes the need of bookkeeping on the engine side. It's basically a kind of mark-and-sweep: On update begin mark items that are expected to change as outdated, while data arrives, undo that marking, and update end remove all remaining marked items. Change-Id: I739b84869033d511d5c9a80605c079e87ef4f6a7 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -572,17 +572,10 @@ void PdbEngine::refreshLocals(const GdbMi &vars)
|
||||
WatchHandler *handler = watchHandler();
|
||||
handler->resetValueCache();
|
||||
|
||||
QSet<QByteArray> toDelete;
|
||||
foreach (WatchItem *item, handler->model()->itemsAtLevel<WatchItem *>(2))
|
||||
toDelete.insert(item->iname);
|
||||
foreach (const GdbMi &child, vars.children())
|
||||
handler->insertItem(new WatchItem(child));
|
||||
|
||||
foreach (const GdbMi &child, vars.children()) {
|
||||
WatchItem *item = new WatchItem(child);
|
||||
handler->insertItem(item);
|
||||
toDelete.remove(item->iname);
|
||||
}
|
||||
|
||||
handler->purgeOutdatedItems(toDelete);
|
||||
handler->notifyUpdateFinished();
|
||||
|
||||
DebuggerToolTipManager::updateEngine(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user