aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-06-28 20:12:53 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-06-28 20:12:53 +0000
commit9655fd1aecac0e494b53902baaf50cf53f899526 (patch)
tree28573cff710a4be4459d4bc9381069a02f6a3b28 /gdb/testsuite/gdb.cp
parent824cc8dd7cdd81143790e8f78d989d32161d5121 (diff)
downloadgdb-9655fd1aecac0e494b53902baaf50cf53f899526.zip
gdb-9655fd1aecac0e494b53902baaf50cf53f899526.tar.gz
gdb-9655fd1aecac0e494b53902baaf50cf53f899526.tar.bz2
gdb/
Fix modification of cplus_struct_default. * dwarf2read.c (dwarf2_add_member_fn) <no DW_AT_vtable_elem_location>: Call ALLOCATE_CPLUS_STRUCT_TYPE. * gdbtypes.c (cplus_struct_default): New empty initializer, comment it. gdb/testsuite/ * gdb.cp/virtbase.cc (class RTTI_base, class RTTI_data) (main) <rtti_data>: New. * gdb.cp/virtbase.exp (print rtti_data): New.
Diffstat (limited to 'gdb/testsuite/gdb.cp')
-rw-r--r--gdb/testsuite/gdb.cp/virtbase.cc14
-rw-r--r--gdb/testsuite/gdb.cp/virtbase.exp5
2 files changed, 18 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/virtbase.cc b/gdb/testsuite/gdb.cp/virtbase.cc
index fed5927..1e6874f 100644
--- a/gdb/testsuite/gdb.cp/virtbase.cc
+++ b/gdb/testsuite/gdb.cp/virtbase.cc
@@ -74,8 +74,19 @@ public:
virtual void b() {}
};
+class RTTI_base
+{
+public:
+ virtual ~RTTI_base() {}
+};
-
+class RTTI_data
+{
+public:
+ RTTI_base base;
+ int data;
+ RTTI_data() : data(1) {}
+};
int main() {
ph::Derived tst;
@@ -84,6 +95,7 @@ int main() {
E *e = new E;
RHB *b = new RHC();
+ RTTI_data rtti_data;
return 0; // breakpoint 3
}
diff --git a/gdb/testsuite/gdb.cp/virtbase.exp b/gdb/testsuite/gdb.cp/virtbase.exp
index 1f845a7..b9bde08 100644
--- a/gdb/testsuite/gdb.cp/virtbase.exp
+++ b/gdb/testsuite/gdb.cp/virtbase.exp
@@ -60,3 +60,8 @@ gdb_test "print *(D *) e" " = {<C> = {v = 11}, _vptr.D = $hex}"
# https://bugzilla.redhat.com/show_bug.cgi?id=560741
gdb_test_no_output "set print object on"
gdb_test "print/x b->mA" " = 0xaaaaaaaa"
+
+# A regression test reported to Red Hat bugzilla, see:
+# https://bugzilla.redhat.com/show_bug.cgi?id=606660
+# `set print object on' is expected.
+gdb_test "print rtti_data" " = .*, data = 1\}"