This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA/arm-linux: Add support for big endian
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 15 Jul 2003 14:12:13 -0400
- Subject: RFA/arm-linux: Add support for big endian
There's really no excuse for how many times I've meant to post this patch
and forgotten about it. This is all it takes to support big-endian
ARM GNU/Linux targets - just put the breakpoint instruction in the right
endianness.
OK?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-07-15 Daniel Jacobowitz <drow@mvista.com>
* arm-linux-tdep.c (arm_linux_arm_be_breakpoint): New.
(arm_linux_init_abi): Use arm_linux_arm_be_breakpoint.
Index: gdb-6.0/gdb/arm-linux-tdep.c
===================================================================
--- gdb-6.0.orig/gdb/arm-linux-tdep.c 2003-07-07 12:04:45.000000000 -0400
+++ gdb-6.0/gdb/arm-linux-tdep.c 2003-07-07 15:02:45.000000000 -0400
@@ -47,6 +47,8 @@
static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
+static const char arm_linux_arm_be_breakpoint[] = {0xef, 0x9f, 0x00, 0x01};
+
/* DEPRECATED_CALL_DUMMY_WORDS:
This sequence of words is the instructions
@@ -768,7 +770,10 @@ arm_linux_init_abi (struct gdbarch_info
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
tdep->lowest_pc = 0x8000;
- tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
+ if (info.byte_order == BFD_ENDIAN_BIG)
+ tdep->arm_breakpoint = arm_linux_arm_be_breakpoint;
+ else
+ tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
tdep->fp_model = ARM_FLOAT_FPA;