Commit 0c0b430f authored by hjk's avatar hjk
Browse files

debugger: add python dumper for __gnu_cxx::hash_set

parent 71ad41a0
...@@ -1856,6 +1856,30 @@ def qdump__wstring(d, item): ...@@ -1856,6 +1856,30 @@ def qdump__wstring(d, item):
qdump__std__string(d, item) qdump__std__string(d, item)
def qdump____gnu_cxx__hash_set(d, item):
ht = item.value["_M_ht"]
size = ht["_M_num_elements"]
d.putItemCount(size)
d.putNumChild(size)
type = item.value.type.template_argument(0)
d.putType("__gnu__cxx::hash_set<%s>" % type)
if d.isExpanded(item):
with Children(d, [size, 1000], type):
buckets = ht["_M_buckets"]["_M_impl"]
bucketStart = buckets["_M_start"]
bucketFinish = buckets["_M_finish"]
p = bucketStart
itemCount = 0
for i in xrange(bucketFinish - bucketStart):
if not isNull(p.dereference()):
cur = p.dereference()
while not isNull(cur):
with SubItem(d):
d.putValue(cur["_M_val"])
cur = cur["_M_next"]
itemCount += 1
p = p + 1
####################################################################### #######################################################################
# #
# Symbian # Symbian
......
...@@ -71,6 +71,11 @@ ...@@ -71,6 +71,11 @@
#include <string> #include <string>
#include <vector> #include <vector>
#define USE_GCC_EXT 1
#if USE_GCC_EXT
#include <hash_set>
#endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#undef min #undef min
...@@ -888,6 +893,20 @@ void testStdDeque() ...@@ -888,6 +893,20 @@ void testStdDeque()
flist.push_front(2); flist.push_front(2);
} }
void testStdHashSet()
{
#if USE_GCC_EXT
using namespace __gnu_cxx;
hash_set<int> h;
h.insert(1);
h.insert(194);
h.insert(2);
h.insert(3);
h.insert(4);
h.insert(5);
#endif
}
void testStdList() void testStdList()
{ {
std::list<int> big; std::list<int> big;
...@@ -1606,6 +1625,7 @@ int main(int argc, char *argv[]) ...@@ -1606,6 +1625,7 @@ int main(int argc, char *argv[])
testStdDeque(); testStdDeque();
testStdList(); testStdList();
testStdHashSet();
testStdMap(); testStdMap();
testStdSet(); testStdSet();
testStdStack(); testStdStack();
......
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