Commit ee090e72 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Debugger[New CDB]: Fix QHash/QSet.

Iterate bucket lists correctly.
parent 404a88f4
......@@ -707,7 +707,7 @@ static inline AbstractSymbolGroupNodePtrVector
// Return the list of buckets of a 'QHash<>' as 'QHashData::Node *' values from
// the list of addresses passed in
template<class AddressType>
SymbolGroupValueVector hashBuckets(SymbolGroup *sg, const std::string hashNodeType,
SymbolGroupValueVector hashBuckets(SymbolGroup *sg, const std::string &hashNodeType,
const AddressType *pointerArray,
int numBuckets,
AddressType ePtr,
......@@ -786,7 +786,8 @@ SymbolGroupValueVector qHashNodes(const SymbolGroupValue &v,
// Generate the list 'QHashData::Node *' by iterating over the linked list of
// nodes starting at each bucket. Using the 'QHashData::Node *' instead of
// the 'QHashNode<K,T>' is much faster. Each list has a trailing, unused
// dummy element.
// dummy element. The initial element as such is skipped due to the pointer/value
// duality (since its 'next' element is identical to it when using typecast<> later on).
SymbolGroupValueVector dummyNodeList;
dummyNodeList.reserve(count);
bool notEnough = true;
......@@ -795,11 +796,11 @@ SymbolGroupValueVector qHashNodes(const SymbolGroupValue &v,
for (SymbolGroupValue l = *it; notEnough && l ; ) {
const SymbolGroupValue next = l["next"];
if (next && next.pointerValue()) { // Stop at trailing dummy element
dummyNodeList.push_back(l);
dummyNodeList.push_back(next);
if (dummyNodeList.size() >= count) // Stop at maximum count
notEnough = false;
if (debugMap)
DebugPrint() << '#' << (dummyNodeList.size() - 1) << "l=" << l << ",next=" << next;
DebugPrint() << '#' << (dummyNodeList.size() - 1) << " l=" << l << ",next=" << next;
l = next;
} else {
break;
......
......@@ -488,7 +488,7 @@ std::vector<std::string> SymbolGroupValue::innerTypesOf(const std::string &t)
std::ostream &operator<<(std::ostream &str, const SymbolGroupValue &v)
{
if (v) {
str << '\'' << v.name() << "' 0x" << std::showbase << std::hex << v.address() <<
str << '\'' << v.name() << "' 0x" << std::hex << v.address() <<
std::dec << ' ' << v.type() << ": '" << wStringToString(v.value()) << '\'';
} else {
str << "Invalid value '" << v.error() << '\'';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment