forked from Imagelibrary/binutils-gdb
2009-11-12 Daniel Jacobowitz <dan@codesourcery.com>
Paul Brook <paul@codesourcery.com> * 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.
This commit is contained in:
@@ -775,6 +775,13 @@ struct cplus_struct_type
|
||||
int line;
|
||||
}
|
||||
*localtype_ptr;
|
||||
|
||||
/* One if this struct is a dynamic class, as defined by the
|
||||
Itanium C++ ABI: if it requires a virtual table pointer,
|
||||
because it or any of its base classes have one or more virtual
|
||||
member functions or virtual base classes. Minus one if not
|
||||
dynamic. Zero if not yet computed. */
|
||||
int is_dynamic : 2;
|
||||
};
|
||||
|
||||
/* Struct used in computing virtual base list */
|
||||
@@ -861,6 +868,7 @@ extern void allocate_cplus_struct_type (struct type *);
|
||||
#define TYPE_BASECLASS_BITPOS(thistype,index) TYPE_FIELD_BITPOS(thistype,index)
|
||||
#define BASETYPE_VIA_PUBLIC(thistype, index) \
|
||||
((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index)))
|
||||
#define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic
|
||||
|
||||
#define BASETYPE_VIA_VIRTUAL(thistype, index) \
|
||||
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
|
||||
|
||||
Reference in New Issue
Block a user