This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: 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: Sat, 6 Sep 2003 21:36:43 -0400
- Subject: Re: RFA/arm-linux: Add support for big endian
- References: <20030813221551.GA22697@nevyn.them.org> <200309050953.h859rm406772@pc960.cambridge.arm.com>
On Fri, Sep 05, 2003 at 10:53:48AM +0100, Richard Earnshaw wrote:
> >
> > > 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.
>
> OK
>
> > >
> > > 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};
>
> Please format these to the same way -- I'm not to fussed which you use.
Thanks. I asked GNU indent, and it suggested this way. I also
realized that the comment above arm_linux_arm_le_breakpoint needed an
update.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-09-06 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: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.35
diff -u -p -r1.35 arm-linux-tdep.c
--- arm-linux-tdep.c 13 Jun 2003 14:13:13 -0000 1.35
+++ arm-linux-tdep.c 7 Sep 2003 01:33:57 -0000
@@ -41,11 +41,12 @@
is to execute a particular software interrupt, rather than use a
particular undefined instruction to provoke a trap. Upon exection
of the software interrupt the kernel stops the inferior with a
- SIGTRAP, and wakes the debugger. Since ARM GNU/Linux is little
- endian, and doesn't support Thumb at the moment we only override
- the ARM little-endian breakpoint. */
+ SIGTRAP, and wakes the debugger. Since ARM GNU/Linux doesn't support
+ Thumb at the moment we only override the ARM breakpoints. */
-static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
+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
@@ -566,7 +567,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;