Commit 84d59453 by Jeffrey A Law Committed by Jeff Law

dwarfout.c (field_byte_offset): Correctly compute the object's byte offset for…

dwarfout.c (field_byte_offset): Correctly compute the object's byte offset for the first bit of a field which...

        * dwarfout.c (field_byte_offset): Correctly compute the object's
        byte offset for the first bit of a field which crosses an alignment
        boundary on a !BYTES_BIG_ENDIAN target.

From-SVN: r27921
parent 92080f30
Fri Jul 2 03:05:44 1999 Jeffrey A Law (law@cygnus.com)
* dwarfout.c (field_byte_offset): Correctly compute the object's
byte offset for the first bit of a field which crosses an alignment
boundary on a !BYTES_BIG_ENDIAN target.
Fri Jul 2 01:36:36 1999 Robert Lipe <robertlipe@usa.net>
* fixinc.svr4: Fix <arpa/inet.h> by deleting protos for htons and
......
......@@ -2106,8 +2106,16 @@ field_byte_offset (decl)
negative. Gdb fails when given negative bit offsets. We avoid this
by recomputing using the first bit of the bitfield. This will give
us an object which does not completely contain the bitfield, but it
will be aligned, and it will contain the first bit of the bitfield. */
if (object_offset_in_bits > bitpos_int)
will be aligned, and it will contain the first bit of the bitfield.
However, only do this for a BYTES_BIG_ENDIAN target. For a
! BYTES_BIG_ENDIAN target, bitpos_int + field_size_in_bits is the first
first bit of the bitfield. If we recompute using bitpos_int + 1 below,
then we end up computing the object byte offset for the wrong word of the
desired bitfield, which in turn causes the field offset to be negative
in bit_offset_attribute. */
if (BYTES_BIG_ENDIAN
&& object_offset_in_bits > bitpos_int)
{
deepest_bitpos = bitpos_int + 1;
object_offset_in_bits
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment