diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 2268ab549563dffd5081e9ff6c73e07dab253da7..b689e1538fa538f1d56fff23c7e94167b32532c6 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -4281,6 +4281,31 @@ void tst_Dumpers::dumper_data() % Check("f", "2", "double"); + QByteArray inheritanceData = + "struct Empty {};\n" + "struct Data { Data() : a(42) {} int a; };\n" + "struct VEmpty {};\n" + "struct VData { VData() : v(42) {} int v; };\n" + "struct S1 : Empty, Data, virtual VEmpty, virtual VData\n" + " { S1() : i1(1) {} int i1; };\n" + "struct S2 : Empty, Data, virtual VEmpty, virtual VData\n" + " { S2() : i2(1) {} int i2; };\n" + "struct Combined : S1, S2 { Combined() : c(1) {} int c; };\n"; + + QTest::newRow("inheritance") + << Data(inheritanceData, + "Combined c;\n" + "c.S1::a = 42;\n" + "c.S2::a = 43;\n" + "c.S1::v = 44;\n" + "c.S2::v = 45;\n") + % Check("c.c", "1", "int") + % Check("c.@1.@2.a", "42", "int") + % Check("c.@1.@4.v", "45", "int") + % Check("c.@2.@2.a", "43", "int") + % Check("c.@2.@4.v", "45", "int"); + + QTest::newRow("gdb13393") << Data( "struct Base {\n" diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 9fd0b4fa904a44bc15f4ed361d313806283292e0..9259ff27f030133c1af99adfbf35f75f5e6439ee 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -4600,6 +4600,44 @@ QString fooxx() namespace basic { + + struct Empty {}; + struct Data { Data() : a(42) {} int a; }; + struct VEmpty {}; + struct VData { VData() : v(42) {} int v; }; + + struct S1 : Empty, Data, virtual VEmpty, virtual VData + { + S1() : i1(1) {} + int i1; + }; + + struct S2 : Empty, Data, virtual VEmpty, virtual VData + { + S2() : i2(1) {} + int i2; + }; + + struct Combined : S1, S2 + { + Combined() : c(1) {} int c; + }; + + + void testInheritance() + { + Combined combined; + combined.S1::a = 42; + combined.S2::a = 43; + combined.S1::v = 44; + combined.S2::v = 45; + + BREAK_HERE; + // Continue. + + dummyStatement(&combined); + } + // This tests display of basic types. void testInt() @@ -5393,6 +5431,7 @@ namespace basic { void testBasic() { + testInheritance(); testInt(); testReference1(); testReference2();