diff options
author | Per Bothner <per@bothner.com> | 1997-08-05 21:58:57 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1997-08-05 21:58:57 +0000 |
commit | f7f37388dc1d7910711f89b1c6b4f3808533ff2d (patch) | |
tree | 8f18c81b7fd22c852dd579cc2afe559caea8b7ac /gdb/dwarf2read.c | |
parent | 0e25edcacc69ff157685d6653fb1304eae9b773d (diff) | |
download | gdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.zip gdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.tar.gz gdb-f7f37388dc1d7910711f89b1c6b4f3808533ff2d.tar.bz2 |
* gdbtypes.h: Re-interpret struct field. Suppport address of static.
Add a bunch of macros.
* coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c:
Update to use new macros.
* coffread.c, hpread.c, stabsread.c: Remove bugus TYPE_FIELD_VALUE.
* value.h, values.c (value_static_field): New function.
* cp-valprint.c, valops.c: Modify to use value_static_field.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 6434246..38d80fb 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1710,22 +1710,22 @@ dwarf2_add_field (fip, die, objfile) attr = dwarf_attr (die, DW_AT_bit_size); if (attr) { - fp->bitsize = DW_UNSND (attr); + FIELD_BITSIZE (*fp) = DW_UNSND (attr); } else { - fp->bitsize = 0; + FIELD_BITSIZE (*fp) = 0; } /* Get bit offset of field. */ attr = dwarf_attr (die, DW_AT_data_member_location); if (attr) { - fp->bitpos = + FIELD_BITPOS (*fp) = decode_locdesc (DW_BLOCK (attr), objfile) * bits_per_byte; } else - fp->bitpos = 0; + FIELD_BITPOS (*fp) = 0; attr = dwarf_attr (die, DW_AT_bit_offset); if (attr) { @@ -1736,7 +1736,7 @@ dwarf2_add_field (fip, die, objfile) anonymous object to the MSB of the field. We don't have to do anything special since we don't need to know the size of the anonymous object. */ - fp->bitpos += DW_UNSND (attr); + FIELD_BITPOS (*fp) += DW_UNSND (attr); } else { @@ -1765,8 +1765,8 @@ dwarf2_add_field (fip, die, objfile) bit field. */ anonymous_size = TYPE_LENGTH (fp->type); } - fp->bitpos += - anonymous_size * bits_per_byte - bit_offset - fp->bitsize; + FIELD_BITPOS (*fp) += anonymous_size * bits_per_byte + - bit_offset - FIELD_BITSIZE (*fp); } } @@ -1806,11 +1806,10 @@ dwarf2_add_field (fip, die, objfile) complain (&dwarf2_bad_static_member_name, physname); } - fp->bitpos = -1; - fp->bitsize = (long) obsavestring (physname, strlen (physname), - &objfile->type_obstack); - fp->type = die_type (die, objfile); - fp->name = obsavestring (fieldname, strlen (fieldname), + SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname), + &objfile->type_obstack)); + FIELD_TYPE (*fp) = die_type (die, objfile); + FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname), &objfile->type_obstack); } else if (die->tag == DW_TAG_inheritance) @@ -1818,10 +1817,10 @@ dwarf2_add_field (fip, die, objfile) /* C++ base class field. */ attr = dwarf_attr (die, DW_AT_data_member_location); if (attr) - fp->bitpos = decode_locdesc (DW_BLOCK (attr), objfile) * bits_per_byte; - fp->bitsize = 0; - fp->type = die_type (die, objfile); - fp->name = type_name_no_tag (fp->type); + FIELD_BITPOS (*fp) = decode_locdesc (DW_BLOCK (attr), objfile) * bits_per_byte; + FIELD_BITSIZE (*fp) = 0; + FIELD_TYPE (*fp) = die_type (die, objfile); + FIELD_NAME (*fp) = type_name_no_tag (fp->type); fip->nbaseclasses++; } } @@ -2379,10 +2378,10 @@ read_enumeration (die, objfile) * sizeof (struct field)); } - fields[num_fields].name = SYMBOL_NAME (sym); - fields[num_fields].type = NULL; - fields[num_fields].bitpos = SYMBOL_VALUE (sym); - fields[num_fields].bitsize = 0; + FIELD_NAME (fields[num_fields]) = SYMBOL_NAME (sym); + FIELD_TYPE (fields[num_fields]) = NULL; + FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym); + FIELD_BITSIZE (fields[num_fields]) = 0; num_fields++; } |