diff options
author | Doug Evans <xdje42@gmail.com> | 2015-01-31 21:40:57 -0800 |
---|---|---|
committer | Doug Evans <xdje42@gmail.com> | 2015-01-31 21:40:57 -0800 |
commit | ae6ae97502b183d0cdb9c298a60fa05240f230bf (patch) | |
tree | 21c2fcba0eba7afd4d1ac80e98ec2dd21698fcd1 /gdb/dwarf2read.c | |
parent | 09e2d7c72040dd2d1833c140b5f04a85bc3f6a0f (diff) | |
download | gdb-ae6ae97502b183d0cdb9c298a60fa05240f230bf.zip gdb-ae6ae97502b183d0cdb9c298a60fa05240f230bf.tar.gz gdb-ae6ae97502b183d0cdb9c298a60fa05240f230bf.tar.bz2 |
Move vptr_{fieldno,basetype} out of main_type, and update everything accordingly.
Every type has to pay the price in memory usage for their presence.
The proper place for them is in the type_specific field which exists
for this purpose.
gdb/ChangeLog:
* dwarf2read.c (process_structure_scope): Update setting of
TYPE_VPTR_BASETYPE, TYPE_VPTR_FIELDNO.
* gdbtypes.c (internal_type_vptr_fieldno): New function.
(set_type_vptr_fieldno): New function.
(internal_type_vptr_basetype): New function.
(set_type_vptr_basetype): New function.
(get_vptr_fieldno): Update setting of TYPE_VPTR_FIELDNO,
TYPE_VPTR_BASETYPE.
(allocate_cplus_struct_type): Initialize vptr_fieldno.
(recursive_dump_type): Printing of vptr_fieldno, vptr_basetype ...
(print_cplus_stuff): ... moved here.
(copy_type_recursive): Don't copy TYPE_VPTR_BASETYPE.
* gdbtypes.h (struct main_type): Members vptr_fieldno, vptr_basetype
moved to ...
(struct cplus_struct_type): ... here. All uses updated.
(TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE): Rewrite.
(internal_type_vptr_fieldno, set_type_vptr_fieldno): Declare.
(internal_type_vptr_basetype, set_type_vptr_basetype): Declare.
* stabsread.c (read_tilde_fields): Update setting of
TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE.
gdb/testsuite/ChangeLog:
* gdb.base/maint.exp <maint print type argc>: Update expected output.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 36248f5..0d8026f 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -13255,7 +13255,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) { struct type *t = die_containing_type (die, cu); - TYPE_VPTR_BASETYPE (type) = t; + set_type_vptr_basetype (type, t); if (type == t) { int i; @@ -13269,7 +13269,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) if (is_vtable_name (fieldname, cu)) { - TYPE_VPTR_FIELDNO (type) = i; + set_type_vptr_fieldno (type, i); break; } } @@ -13284,7 +13284,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) } else { - TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (t); + set_type_vptr_fieldno (type, TYPE_VPTR_FIELDNO (t)); } } else if (cu->producer @@ -13303,8 +13303,8 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu) { if (strcmp (TYPE_FIELD_NAME (type, i), "__vfp") == 0) { - TYPE_VPTR_FIELDNO (type) = i; - TYPE_VPTR_BASETYPE (type) = type; + set_type_vptr_fieldno (type, i); + set_type_vptr_basetype (type, type); break; } } |