From fe1cbd0f877ee8c055911b7e8bdf8f7c6cd131d8 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 15 Sep 2017 08:03:09 +0200 Subject: [PATCH] Debugger: Add yet another virtual inheritance test Failing for now. Change-Id: Ic624b9c64f85f06bf61a2e8f765a272a835c0c43 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/misctypes.py | 25 -------------- tests/auto/debugger/tst_dumpers.cpp | 49 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index 5b0aa0b30c..0b7662660b 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -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) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index e7e833796a..46956dea7f 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -6834,6 +6834,55 @@ void tst_Dumpers::dumper_data() + Check("s.storage_.@1.size_", "4", "int"); + QTest::newRow("Internal4") + << Data("template\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::Node\n" + "{\n" + " int baz = 84;\n" + "};\n\n", + "Derived d1, d2; unused(&d1, &d2);\n" + "QtcDumperTest_List 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 \n" "static int c = 0;\n" -- GitLab