ARM's BE8 format introduces yet another amusing variation on endianness, in which the data is big-endian while the code is little-endian. The bits for binutils went in a while ago, this patch extends GDB. In theory, we should change functions like read_memory_unsigned_integer to have forms for both code and data; in lieu of such a sweeping change for what is rather a narrow use, I introduced macros to swap instruction bytes after reading. Fortunately, GDB doesn't often need to examine instructions! This was tested by passing --be8 to the linker and running under a hacked qemu simulator, no hardware being available yet. Review-wise, Richard Earnshaw is listed as ARM maintainer, not sure if he's active here? 2008-08-04 Stan Shebs ARM BE8 support. * disasm.c (gdb_disassemble_info): Set endian_code. * gdbarch.sh (gdbarch_info): New field byte_order_for_code. * gdbarch.h, gdbarch.c: Regenerate. * arch-utils.c (initialize_current_architecture): Set the default byte_order_for_code. (gdbarch_info_init): Ditto. (gdbarch_info_fill): Ditto. * arm-tdep.c (SWAP_INT, SWAP_SHORT): New macros. (thumb_analyze_prologue): Swap halfword if code endianness is different from general endianness. (arm_skip_prologue): Similarly. (arm_scan_prologue): Ditto. (thumb_get_next_pc): Ditto. (arm_get_next_pc): Ditto. (arm_gdbarch_init): Set byte_order_for_code from BE8 flag, choose correct endianness for breakpoints.