CdbExt: Add dumper support for new std container

std::multiset
std::unordered_set
std::unordered_multiset
std::unordered_map
std::unordered_multimap

Change-Id: I72ac9a96d64d85ca6c914acdbf626fba731c587a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2016-08-18 09:05:14 +02:00
parent 062edcaa94
commit 0ef5463ed7
3 changed files with 44 additions and 6 deletions

View File

@@ -187,8 +187,13 @@ int containerSize(KnownType kt, const SymbolGroupValue &v)
return msvcStdVectorSize(v); return msvcStdVectorSize(v);
case KT_StdDeque: // MSVC2012 has many base classes, MSVC2010 1, MSVC2008 none case KT_StdDeque: // MSVC2012 has many base classes, MSVC2010 1, MSVC2008 none
case KT_StdSet: case KT_StdSet:
case KT_StdMultiSet:
case KT_StdMap: case KT_StdMap:
case KT_StdUnorderedSet:
case KT_StdUnorderedMultiSet:
case KT_StdMultiMap: case KT_StdMultiMap:
case KT_StdUnorderedMap:
case KT_StdUnorderedMultiMap:
case KT_StdValArray: case KT_StdValArray:
case KT_StdList: { case KT_StdList: {
const int size = v.readIntegerFromAncestor("_Mysize"); const int size = v.readIntegerFromAncestor("_Mysize");
@@ -626,7 +631,7 @@ static inline SymbolGroupValueVector
return rc; return rc;
} }
// std::set<>: Children directly contained in list // std::(multi)set<>: Children directly contained in list
static inline AbstractSymbolGroupNodePtrVector static inline AbstractSymbolGroupNodePtrVector
stdSetChildList(const SymbolGroupValue &set, unsigned count) stdSetChildList(const SymbolGroupValue &set, unsigned count)
{ {
@@ -640,7 +645,14 @@ static inline AbstractSymbolGroupNodePtrVector
return rc; return rc;
} }
// std::map<K,V>: A list of std::pair<K,V> (derived from std::pair_base<K,V>) static inline AbstractSymbolGroupNodePtrVector
stdHashChildList(const SymbolGroupValue &set, unsigned count)
{
SymbolGroupValue list = set.findMember(set, "_List");
return stdListChildList(list.node(), count, list.context());
}
// std::(multi)map<K,V>: A list of std::pair<K,V> (derived from std::pair_base<K,V>)
static inline AbstractSymbolGroupNodePtrVector static inline AbstractSymbolGroupNodePtrVector
stdMapChildList(const SymbolGroupValue &map, unsigned count) stdMapChildList(const SymbolGroupValue &map, unsigned count)
{ {
@@ -1161,10 +1173,16 @@ AbstractSymbolGroupNodePtrVector containerChildren(SymbolGroupNode *node, int ty
return stdDequeChildList(deque, size); return stdDequeChildList(deque, size);
break; break;
case KT_StdSet: case KT_StdSet:
case KT_StdMultiSet:
return stdSetChildList(SymbolGroupValue(node, ctx), size); return stdSetChildList(SymbolGroupValue(node, ctx), size);
case KT_StdMap: case KT_StdMap:
case KT_StdMultiMap: case KT_StdMultiMap:
return stdMapChildList(SymbolGroupValue(node, ctx), size); return stdMapChildList(SymbolGroupValue(node, ctx), size);
case KT_StdUnorderedMap:
case KT_StdUnorderedMultiMap:
case KT_StdUnorderedMultiSet:
case KT_StdUnorderedSet:
return stdHashChildList(SymbolGroupValue(node, ctx), size);
} }
return AbstractSymbolGroupNodePtrVector(); return AbstractSymbolGroupNodePtrVector();
} }

View File

@@ -173,8 +173,14 @@ enum KnownType
KT_StdStack = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 3, KT_StdStack = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 3,
KT_StdDeque = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 4, KT_StdDeque = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 4,
KT_StdSet = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 5, KT_StdSet = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 5,
KT_StdMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 6, KT_StdMultiSet = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 6,
KT_StdMultiMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 7, KT_StdUnorderedSet = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 7,
KT_StdArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 8, KT_StdUnorderedMultiSet = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 8,
KT_StdValArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 9 KT_StdMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 9,
KT_StdMultiMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 10,
KT_StdUnorderedMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 11,
KT_StdUnorderedMultiMap = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 12,
KT_StdArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 13,
KT_StdValArray = KT_STL_Type + KT_ContainerType + KT_HasSimpleDumper + 14
}; };

View File

@@ -1241,9 +1241,23 @@ static KnownType knownClassTypeHelper(const std::string &type,
case 8: case 8:
if (!type.compare(hPos, 8, "multimap")) if (!type.compare(hPos, 8, "multimap"))
return KT_StdMultiMap; return KT_StdMultiMap;
if (!type.compare(hPos, 8, "multiset"))
return KT_StdMultiSet;
if (!type.compare(hPos, 8, "valarray")) if (!type.compare(hPos, 8, "valarray"))
return KT_StdValArray; return KT_StdValArray;
break; break;
case 13:
if (!type.compare(hPos, 13, "unordered_map"))
return KT_StdUnorderedMap;
if (!type.compare(hPos, 13, "unordered_set"))
return KT_StdUnorderedSet;
break;
case 18:
if (!type.compare(hPos, 18, "unordered_multimap"))
return KT_StdUnorderedMultiMap;
if (!type.compare(hPos, 18, "unordered_multiset"))
return KT_StdUnorderedMultiSet;
break;
} }
} }
// STL strings // STL strings