Commit fe1cbd0f authored by hjk's avatar hjk

Debugger: Add yet another virtual inheritance test

Failing for now.

Change-Id: Ic624b9c64f85f06bf61a2e8f765a272a835c0c43
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 4f03ea96
......@@ -406,31 +406,6 @@ def qdump__QtcDumperTest_List(d, value):
d.putFields(value)
#d.putPlainChildren(value)
def qdump__QtcDumperTest_List__NodeX(d, value):
typename = value.type.unqualified().name
pos0 = typename.find('<')
pos1 = typename.find('>')
tName = typename[pos0+1:pos1]
d.putBetterType('QtcDumperTest_List<' + tName + '>::Node')
d.putNumChild(1)
if d.isExpanded():
obj_type = d.lookupType(tName)
with Children(d):
d.putSubItem("this", value.cast(obj_type))
d.putFields(value)
#d.putPlainChildren(value)
def qdump__QtcDumperTest_List(d, value):
innerType = value.type[0]
d.putNumChild(1)
p = value['root']
if d.isExpanded():
with Children(d):
d.putSubItem("[p]", p)
d.putSubItem("[root]", value["root"].cast(innerType))
d.putFields(value)
#d.putPlainChildren(value)
def qdump__QtcDumperTest_String(d, value):
with Children(d):
first = d.hexdecode(d.putSubItem('first', value['first']).value)
......
......@@ -6834,6 +6834,55 @@ void tst_Dumpers::dumper_data()
+ Check("s.storage_.@1.size_", "4", "int");
QTest::newRow("Internal4")
<< Data("template<class T>\n"
"struct QtcDumperTest_List\n"
"{\n"
" struct Node\n"
" {\n"
" virtual ~Node() {}\n"
" Node *prev = nullptr;\n"
" Node *next = nullptr;\n"
" };\n\n"
" QtcDumperTest_List()\n"
" {\n"
" root.prev = &root;\n"
" root.next = &root;\n"
" }\n\n"
" void insert(Node *n)\n"
" {\n"
" if (n->next)\n"
" return;\n"
" Node *r = root.prev;\n"
" Node *node = r->next;\n"
" n->next = node;\n"
" node->prev = n;\n"
" r->next = n;\n"
" n->prev = r;\n"
" }\n"
" Node root;\n"
"};\n\n"
"struct Base\n"
"{\n"
" virtual ~Base() {}\n"
" int foo = 42;\n"
"};\n\n"
"struct Derived : Base, QtcDumperTest_List<Derived>::Node\n"
"{\n"
" int baz = 84;\n"
"};\n\n",
"Derived d1, d2; unused(&d1, &d2);\n"
"QtcDumperTest_List<Derived> list; unused(&list);\n"
"list.insert(&d1);\n"
"list.insert(&d2);\n")
+ Cxx11Profile()
+ Check("d1.@1.foo", "42", "int")
+ Check("d1.baz", "84", "int")
+ Check("d2.@1.foo", "42", "int")
+ Check("d2.baz", "84", "int")
//+ Check("list.1.baz", "15", "int")
;
QTest::newRow("BufArray")
<< Data("#include <new>\n"
"static int c = 0;\n"
......
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