Ulrich Weigand schrieb: > 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. > Hi, thank you very much for all of your valuable feedback. I rewrote the patch and introduce a new gdbarch property bits_big_endian now to replace BITS_BIG_ENDIAN. I tested this patch on both Little and Big Endian machine (x86/ppc) without regression. If this patch is ok I'll post another one for the documentation. Ok to commit? ChangeLog: * gdbarch.sh (function_list): Add new property bits_big_endian to gdbarch structure. * gdbarch.{c,h}: Regenerate. * value.c (struct value): Replace BITS_BIG_ENDIAN by gdbarch_bits_big_endian (comment). (unpack_field_as_long, modify_field): Likewise. * value.h: Likewise (comment). * valops.c (value_slice): Likewise. * valarith.c (value_subscript, value_bit_index): Likewise. * gdbtypes.h (field): Likewise (comment). * eval.c (evaluate_subexp_standard): Likewise. * dwarf2read.c (dwarf2_add_field): Likewise. * ada-lang.c (decode_packed_array, ada_value_primitive_packed_val) (move_bits, ada_value_assign, value_assign_to_component): Likewise. * defs.h (BITS_BIG_ENDIAN): Remove. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com