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.
+2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ 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.
+
2010-06-28 Joel Brobecker <brobecker@adacore.com>
* NEWS: Add entry announcing the python directory.
complaint (&symfile_complaints,
_("Member function \"%s\" (offset %d) is virtual but the vtable offset is not specified"),
fieldname, die->offset);
+ ALLOCATE_CPLUS_STRUCT_TYPE (type);
TYPE_CPLUS_DYNAMIC (type) = 1;
}
}
}
}
-const struct cplus_struct_type cplus_struct_default;
+/* Ensure it is in .rodata (if available) by workarounding GCC PR 44690. */
+const struct cplus_struct_type cplus_struct_default = { };
void
allocate_cplus_struct_type (struct type *type)
+2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.cp/virtbase.cc (class RTTI_base, class RTTI_data)
+ (main) <rtti_data>: New.
+ * gdb.cp/virtbase.exp (print rtti_data): New.
+
2010-06-28 Jan Kratochvil <jan.kratochvil@redhat.com>
Joel Brobecker <brobecker@adacore.com>
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;
E *e = new E;
RHB *b = new RHC();
+ RTTI_data rtti_data;
return 0; // breakpoint 3
}
# 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\}"