aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2016-08-26 08:37:03 +0200
committerDavid Schulz <david.schulz@qt.io>2016-09-15 07:27:46 +0000
commit015e12a72a3e8f7c27009870e486c00f237cb361 (patch)
tree5461f54f551a82ce99fae6b1cf5ea0d576265bb0
parent6b112c1b04d3fbed65492a2a05e2c34f71c6bc8d (diff)
Cdb: Fix Qt4 QMap dumper
The expanding depth of variables is limited in cdb. Instead of expanding the linked list inside qmap add a new symbol for each child node. Task-number: QTCREATORBUG-16212 Change-Id: I89a288c92d9168a54afcf2cdb8c8b8a6dd98a3b4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/libs/qtcreatorcdbext/containers.cpp4
-rw-r--r--src/libs/qtcreatorcdbext/symbolgroupvalue.cpp23
-rw-r--r--src/libs/qtcreatorcdbext/symbolgroupvalue.h2
3 files changed, 22 insertions, 7 deletions
diff --git a/src/libs/qtcreatorcdbext/containers.cpp b/src/libs/qtcreatorcdbext/containers.cpp
index 7dec387111..bab12104f2 100644
--- a/src/libs/qtcreatorcdbext/containers.cpp
+++ b/src/libs/qtcreatorcdbext/containers.cpp
@@ -960,9 +960,11 @@ static inline SymbolGroupValueVector qMap4Nodes(const SymbolGroupValue &v, Vecto
SymbolGroupValueVector rc;
rc.reserve(count);
SymbolGroupValue n = e["forward"][unsigned(0)];
+ const std::string &type = SymbolGroupValue::stripClassPrefixes(n.type());
for (VectorIndexType i = 0; i < count && n && n.pointerValue() != ePtr; ++i) {
rc.push_back(n);
- n = n["forward"][unsigned(0)];
+ ULONG64 address = n.addressOfAncestor("forward");
+ n = n.addSymbol(address, type);
}
return rc;
}
diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
index 5d7147f373..46b9a3ff91 100644
--- a/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
+++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.cpp
@@ -139,12 +139,7 @@ SymbolGroupValue SymbolGroupValue::addSymbolForAncestor(const std::string &ances
const SymbolAncestorInfo info = infoOfAncestor(ancestorName);
if (info.isValid()) {
const ULONG64 base = isPointerType(type()) ? pointerValue() : address();
- const std::string &pointerToType =
- pointedToSymbolName(base + info.offset, stripClassPrefixes(info.type));
- if (SymbolGroupNode *ancestorNode =
- node()->symbolGroup()->addSymbol(module(), pointerToType, "", "", &std::string())) {
- return SymbolGroupValue(ancestorNode, m_context);
- }
+ return addSymbol(base + info.offset, stripClassPrefixes(info.type));
}
if (isValid() && SymbolGroupValue::verbose) { // Do not report subsequent errors
DebugPrint dp;
@@ -221,6 +216,22 @@ SymbolAncestorInfo SymbolGroupValue::infoOfAncestor(const std::string &name) con
return info;
}
+SymbolGroupValue SymbolGroupValue::addSymbol(const ULONG64 address, const std::string &type) const
+{
+ const std::string &pointerToType = pointedToSymbolName(address, type);
+ if (SymbolGroupNode *ancestorNode =
+ node()->symbolGroup()->addSymbol(module(), pointerToType, "", "", &std::string())) {
+ return SymbolGroupValue(ancestorNode, m_context);
+ }
+ if (isValid() && SymbolGroupValue::verbose) { // Do not report subsequent errors
+ DebugPrint dp;
+ dp << this->name() << "::addSymbol(\"" << address << "\", \"" << address << "\") failed. ";
+ formatNodeError(m_node, dp);
+ }
+ return SymbolGroupValue(m_errorMessage);
+
+}
+
unsigned SymbolGroupValue::childCount() const
{
if (ensureExpanded())
diff --git a/src/libs/qtcreatorcdbext/symbolgroupvalue.h b/src/libs/qtcreatorcdbext/symbolgroupvalue.h
index d14ee0e3dd..73f00bce08 100644
--- a/src/libs/qtcreatorcdbext/symbolgroupvalue.h
+++ b/src/libs/qtcreatorcdbext/symbolgroupvalue.h
@@ -96,6 +96,8 @@ public:
std::string typeOfAncestor(const std::string &childName) const;
SymbolAncestorInfo infoOfAncestor(const std::string &name) const;
+ SymbolGroupValue addSymbol(const ULONG64 address, const std::string &type) const;
+
SymbolGroupNode *node() const { return m_node; }
SymbolGroupValueContext context() const { return m_context; }