Skip to content
Snippets Groups Projects
Commit ad55631c authored by hjk's avatar hjk
Browse files

Debugger: Add safety net to avoid infinite lookups


Do not lookup the same item twice without intermediate stepping.

Dumpers could announce the existence of children but when asked
for them bail out or produced similar inconsistent output.
Better not depend on it.

Task-number: QTCREATORBUG-15352
Change-Id: I38532d08bb438b12b6eb202a06ff610670b1069f
Reviewed-by: default avatarEike Ziller <eike.ziller@qt.io>
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b2e048c1
No related branches found
No related tags found
No related merge requests found
...@@ -282,6 +282,7 @@ public slots: ...@@ -282,6 +282,7 @@ public slots:
void resetLocation() void resetLocation()
{ {
m_lookupRequests.clear();
m_locationTimer.stop(); m_locationTimer.stop();
m_locationMark.reset(); m_locationMark.reset();
m_stackHandler.resetLocation(); m_stackHandler.resetLocation();
...@@ -337,6 +338,9 @@ public: ...@@ -337,6 +338,9 @@ public:
Utils::FileInProjectFinder m_fileFinder; Utils::FileInProjectFinder m_fileFinder;
QByteArray m_qtNamespace; QByteArray m_qtNamespace;
// Safety net to avoid infinite lookups.
QSet<QByteArray> m_lookupRequests; // FIXME: Integrate properly.
}; };
...@@ -2011,6 +2015,23 @@ bool DebuggerEngine::canHandleToolTip(const DebuggerToolTipContext &context) con ...@@ -2011,6 +2015,23 @@ bool DebuggerEngine::canHandleToolTip(const DebuggerToolTipContext &context) con
void DebuggerEngine::updateItem(const QByteArray &iname) void DebuggerEngine::updateItem(const QByteArray &iname)
{ {
if (d->m_lookupRequests.contains(iname)) {
showMessage(QString::fromLatin1("IGNORING REPEATED REQUEST TO EXPAND " + iname));
WatchHandler *handler = watchHandler();
WatchItem *item = handler->findItem(iname);
if (!item->hasChildren()) {
handler->notifyUpdateStarted({iname});
item->setValue(decodeData({}, "notaccessible"));
item->setHasChildren(false);
item->outdated = false;
item->update();
handler->notifyUpdateFinished();
return;
}
// We could legitimately end up here after expanding + closing + re-expaning an item.
}
d->m_lookupRequests.insert(iname);
UpdateParameters params; UpdateParameters params;
params.partialVariable = iname; params.partialVariable = iname;
doUpdateLocals(params); doUpdateLocals(params);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment