This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Per-type architecture (Re: [10/15] Basic value access routines)

On Tue, Jun 23, 2009 at 07:00:24PM +0200, Ulrich Weigand wrote:
> We *do* need the architecture to interpret bitfield types; see e.g. the
> comment in gdbtypes.h:
>       /* Position of this field, counting in bits from start of
>          containing structure.
>          For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB.
>          For gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB.
>          For a range bound or enum value, this is the value itself. */
>       int bitpos;
> and the various references to gdbarch_bits_big_endian (current_gdbarch)
> in unpack_field_as_long, modify_field, etc.   There's no way to operate
> on a bitfield value without knowledge of this property.

You're right, we do - it's a very odd representation where we need the
endianness both to set and to use the position, if you ask me, but it
does tend to line up with symbol readers.

> OK, thanks.  I've checked the patch in now.

Great.  I'll let you know if I have any problems.

Daniel Jacobowitz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]