diff options
author | Fred Fish <fnf@specifix.com> | 1992-05-03 23:05:07 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-05-03 23:05:07 +0000 |
commit | 4db8e515c4db19f91a671c81fcc87bbc2b48c242 (patch) | |
tree | 6f5baa70bf3b92aa0ce5e19d909165c549b88b93 /gdb/dwarfread.c | |
parent | d752f749c86c0b43e54d2da9f5963e27f5baa3e3 (diff) | |
download | gdb-4db8e515c4db19f91a671c81fcc87bbc2b48c242.zip gdb-4db8e515c4db19f91a671c81fcc87bbc2b48c242.tar.gz gdb-4db8e515c4db19f91a671c81fcc87bbc2b48c242.tar.bz2 |
* Makefile.in (VERSION): Bump to 4.5.2.
* Makefile.in (DEMANGLE_OPTS): Add, default to -Dnounderscore.
* configure.in: Simplify ncr3000 gdb_host logic, add gdb_target.
* dwarfread.c (struct_type): Apply fix from Peggy Fieland for
proper handling of bit fields.
* gdbtypes.h (struct type): Clarify use of field.bitpos.
* symtab.h: Fix couple of misspellings in comments.
* value.h (struct value): Clarify use of bitpos.
* value.h (unpack_field_as_long): Change prototype, returns
LONGEST.
* values.c (unpack_field_as_long): Change return type to LONGEST,
sign extend unpacked fields that are signed, other rewriting.
* config/ncr3000.mt: New target config file.
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r-- | gdb/dwarfread.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 2e52295..1cd34cd 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -856,7 +856,27 @@ struct_type (dip, thisdie, enddie, objfile) list -> field.name = savestring (mbr.at_name, strlen (mbr.at_name)); list -> field.type = decode_die_type (&mbr); list -> field.bitpos = 8 * locval (mbr.at_location); - list -> field.bitsize = 0; + /* Handle bit fields. */ + list -> field.bitsize = mbr.at_bit_size; +#if BITS_BIG_ENDIAN + /* For big endian bits, the at_bit_offset gives the additional + bit offset from the MSB of the containing 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. */ + list -> field.bitpos += mbr.at_bit_offset; +#else + /* For little endian bits, we need to have a non-zero at_bit_size, + so that we know we are in fact dealing with a bitfield. Compute + the bit offset to the MSB of the anonymous object, subtract off + the number of bits from the MSB of the field to the MSB of the + object, and then subtract off the number of bits of the field + itself. The result is the bit offset of the LSB of the field. */ + if (mbr.at_bit_size > 0) + { + list -> field.bitpos += + mbr.at_byte_size * 8 - mbr.at_bit_offset - mbr.at_bit_size; + } +#endif nfields++; break; default: |