This is the mail archive of the gdb-patches@sourceware.org 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: [patch] Remove BITS_BIG_ENDIAN from defs.h


Markus Deuling wrote:

> this patch removes BITS_BIG_ENDIAN from defs.h by replacing it with
> its expression. The way to recognize endianess of a target is
> gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG which is
> widely used by most files.  So this macro is unnecessary.

As Dan and Eli pointed out, there *is* a difference between the two:
- gdbarch_byte_order says whether in a multi-byte value, the least
  or most significant *byte* comes first
- BITS_BIG_ENDIAN is intended to say whether in a bitfield, the
  least of most significant *bit* comes first

Looking at GCC, there are targets with big endian byte order but
little endian bit order (or vice versa), even though those are 
not supported in GDB today (or maybe they are but bitfields simply
do not work correctly).

Thus I think we should introduce a new gdbarch property to allow
to set the bit order.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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