From d48cc9dd6fbc2e64af32b5ec1680e8255eeb4edd Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Thu, 12 Nov 2009 19:47:25 +0000 Subject: 2009-11-12 Daniel Jacobowitz Paul Brook * c-typeprint.c (c_type_print_base): Skip artificial fields. Use get_vptr_fieldno to skip the vtable pointer. * dwarf2read.c (dwarf2_add_field): Set FIELD_ARTIFICIAL on artificial fields. (dwarf2_add_member_fn): Complain about virtual member functions without DW_AT_vtable_elem_location and force TYPE_CPLUS_DYNAMIC. * gdbtypes.c (get_vptr_fieldno): Update comment. * gdbtypes.h (struct cplus_struct_type): Add is_dynamic. (TYPE_CPLUS_DYNAMIC): New macro. * gnu-v3-abi.c (gnuv3_dynamic_class): New. (gnuv3_get_vtable): Rewrite to use gnuv3_dynamic_class. Move higher. (gnuv3_rtti_type, gnuv3_get_virtual_fn, gnuv3_baseclass_offset): Use gnuv3_get_vtable. * varobj.c (cplus_class_num_children, cplus_describe_child): Skip artificial fields. Use get_vptr_fieldno to skip the vtable pointer. --- gdb/dwarf2read.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gdb/dwarf2read.c') diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 381350f..2f6e522 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4484,6 +4484,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, pointer or virtual base class pointer) to private. */ if (dwarf2_attr (die, DW_AT_artificial, cu)) { + FIELD_ARTIFICIAL (*fp) = 1; new_field->accessibility = DW_ACCESS_private; fip->non_public_fields = 1; } @@ -4803,6 +4804,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, else dwarf2_complex_location_expr_complaint (); } + else + { + attr = dwarf2_attr (die, DW_AT_virtuality, cu); + if (attr && DW_UNSND (attr)) + { + /* GCC does this, as of 2008-08-25; PR debug/37237. */ + complaint (&symfile_complaints, + _("Member function \"%s\" (offset %d) is virtual but the vtable offset is not specified"), + fieldname, die->offset); + TYPE_CPLUS_DYNAMIC (type) = 1; + } + } } /* Create the vector of member function fields, and attach it to the type. */ -- cgit v1.1