Debugger[New CDB]: Dump QHash/QMultiHash/QSet.

Introduce new Symbol group node for fake map nodes.
Iterate over QHash and extract keys, values for QSet/QHash.
This commit is contained in:
Friedemann Kleint
2010-12-16 15:49:08 +01:00
parent 3d400854f2
commit bc31a3f140
5 changed files with 262 additions and 25 deletions

View File

@@ -189,15 +189,28 @@ SymbolGroupValue SymbolGroupValue::pointerTypeCast(const char *type) const
SymbolGroupValue SymbolGroupValue::typeCastedValue(ULONG64 address, const char *type) const
{
if (address) {
SymbolGroup *sg = m_node->symbolGroup();
std::ostringstream str;
str << '(' << type << ")(" << std::showbase << std::hex << address << ')';
if (SymbolGroupNode *node = sg->addSymbol(str.str(),
additionalSymbolIname(sg),
&m_errorMessage))
return SymbolGroupValue(node, m_context);
}
if (!address)
return SymbolGroupValue();
const size_t len = strlen(type);
if (!len)
return SymbolGroupValue();
const bool nonPointer = type[len - 1] != '*';
SymbolGroup *sg = m_node->symbolGroup();
// A bit of magic: For desired pointer types, we can do
// 'Foo *' -> '(Foo *)(address)'.
// For non-pointers, we need to de-reference:
// 'Foo' -> '*(Foo *)(address)'
std::ostringstream str;
if (nonPointer)
str << '*';
str << '(' << type;
if (nonPointer)
str << " *";
str << ")(" << std::showbase << std::hex << address << ')';
if (SymbolGroupNode *node = sg->addSymbol(str.str(),
additionalSymbolIname(sg),
&m_errorMessage))
return SymbolGroupValue(node, m_context);
return SymbolGroupValue();
}