]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gdb/gdb-6.3/thumb-breakpoint.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gdb / gdb-6.3 / thumb-breakpoint.patch
1 # This patch causes gdb to use thumb swi(1) on linux for a thumb breakpoint
2 # rather than the default, swi(254).  To stand any chance of making this
3 # work a linux kernel patch is required to read the swi number on a thumb
4 # swi.  In the absence of this patch gdb will effectively insert a random
5 # swi because the kernel reads the swi number from r7...
6 #
7 --- gdb-6.3/gdb/arm-linux-tdep.c.orig   2005-09-19 13:55:16.486702426 -0700
8 +++ gdb-6.3/gdb/arm-linux-tdep.c        2005-09-19 13:57:44.127992906 -0700
9 @@ -44,6 +44,12 @@
10  
11  static const char arm_linux_arm_be_breakpoint[] = { 0xef, 0x9f, 0x00, 0x01 };
12  
13 +/* The following requires the corresponding patch to the kernel to recognise
14 + * this SWI as a breakpoint.
15 + */
16 +static const char arm_linux_thumb_le_breakpoint[] = {0x01, 0xdf};
17 +static const char arm_linux_thumb_be_breakpoint[] = {0xdf, 0x01};
18 +
19  /* Description of the longjmp buffer.  */
20  #define ARM_LINUX_JB_ELEMENT_SIZE      INT_REGISTER_SIZE
21  #define ARM_LINUX_JB_PC                        21
22 @@ -463,10 +469,17 @@
23  
24    tdep->lowest_pc = 0x8000;
25    if (info.byte_order == BFD_ENDIAN_BIG)
26 -    tdep->arm_breakpoint = arm_linux_arm_be_breakpoint;
27 +    {
28 +      tdep->arm_breakpoint = arm_linux_arm_be_breakpoint;
29 +      tdep->thumb_breakpoint = arm_linux_thumb_be_breakpoint;
30 +    }
31    else
32 -    tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
33 +    {
34 +      tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
35 +      tdep->thumb_breakpoint = arm_linux_thumb_le_breakpoint;
36 +    }
37    tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
38 +  tdep->thumb_breakpoint_size = sizeof (arm_linux_thumb_le_breakpoint);
39  
40    tdep->fp_model = ARM_FLOAT_FPA;
41