This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Remove BITS_BIG_ENDIAN from defs.h
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: deuling at de dot ibm dot com (Markus Deuling)
- Cc: gdb-patches at sourceware dot org (GDB Patches), eliz at gnu dot org (Eli Zaretskii)
- Date: Mon, 14 Jan 2008 19:11:14 +0100 (CET)
- Subject: 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