diff --git a/src/scripts/prettyprinters/qt.py b/src/scripts/prettyprinters/qt.py index fbaa73f87..8b89fda28 100644 --- a/src/scripts/prettyprinters/qt.py +++ b/src/scripts/prettyprinters/qt.py @@ -118,7 +118,6 @@ def __init__(self, nodetype, d): self.externalStorage = isLarge or isStatic #see QList::Node::t() - def __iter__(self): return self diff --git a/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.cpp b/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.cpp index c1379d1f3..cc7bbcf81 100644 --- a/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.cpp +++ b/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.cpp @@ -765,7 +765,7 @@ void GDBDebugger::addVariablesWatched(const QList &variableLi } } -void GDBDebugger::parseChildVariable(const QString &evaluateName, const gdbmi::Variable *parentVariable) +void GDBDebugger::parseChildVariable(const QString &evaluateName, gdbmi::Variable *parentVariable) { d->runningCommand++; DebugManager::instance()->commandAndResponse(QString { "-var-list-children --all-values %1" }.arg(evaluateName), [=](const QVariant &r) { @@ -781,10 +781,22 @@ void GDBDebugger::parseChildVariable(const QString &evaluateName, const gdbmi::V parseChildVariable(childMap.value("name").toString(), parentVariable); } else { auto var = gdbmi::Variable::parseMap(childMap); + if (var->dynamic) + parseChildVariable(var->name, var); + var->name = childMap.value("exp").toString(); var->hasMore = (var->dynamic && var->hasMore) || var->numChild; - if(var->hasMore) + if (var->hasMore) var->childRefrence = ++d->reference; + else if (var->value == "{...}") // var has no children and it`s value is {...}. ignore it + var->value = ""; + + if (!parentVariable->hasMore) { + parentVariable->childRefrence = ++d->reference; + parentVariable->hasMore = true; + if (parentVariable->value.isEmpty()) + parentVariable->value = "{...}"; + } d->variableListByReference.insert(parentVariable->childRefrence, var); } } diff --git a/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.h b/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.h index 1b1a580d8..779a951d0 100644 --- a/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.h +++ b/src/tools/debugadapter/debugger/gdbmi/gdbdebugger.h @@ -122,7 +122,7 @@ public slots: void sendLibraryUnloadedNotify(const gdbmi::Library &library, bool print); void parseDisassembleData(const gdbmi::Record &record); void addVariablesWatched(const QList &variableList, int reference); - void parseChildVariable(const QString &evaluateName , const gdbmi::Variable *parentVariable); + void parseChildVariable(const QString &evaluateName , gdbmi::Variable *parentVariable); void evaluateValue(gdbmi::Variable *variable); void resetVariables(); void checkVariablesLocker(); diff --git a/src/tools/debugadapter/debugger/gdbmi/gdbmi.cpp b/src/tools/debugadapter/debugger/gdbmi/gdbmi.cpp index d9c2b2806..efe0d6424 100644 --- a/src/tools/debugadapter/debugger/gdbmi/gdbmi.cpp +++ b/src/tools/debugadapter/debugger/gdbmi/gdbmi.cpp @@ -191,7 +191,7 @@ gdbmi::Variable *gdbmi::Variable::parseMap(const QVariantMap &data) v->value = data.value("value").toString(); v->type = data.value("type").toString(); v->threadId = data.value("thread-id").toString(); - v->hasMore = data.value("has_more", true).toBool(); + v->hasMore = data.value("has_more", false).toBool(); v->dynamic = data.value("dynamic", false).toBool(); v->displayhint = data.value("displayhint").toString(); return v;