aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-linux-tdep.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-02-01 16:13:17 +0000
committerDaniel Jacobowitz <drow@false.org>2010-02-01 16:13:17 +0000
commit177321bd85d5a3d4ca05d320696d8af43bc0fc05 (patch)
treeffd4365fcfcbd8de561b1f7d37570927d180b9d6 /gdb/arm-linux-tdep.c
parenta1dcb23a280b453738e569f0f7674dbd8ca39933 (diff)
downloadgdb-177321bd85d5a3d4ca05d320696d8af43bc0fc05.zip
gdb-177321bd85d5a3d4ca05d320696d8af43bc0fc05.tar.gz
gdb-177321bd85d5a3d4ca05d320696d8af43bc0fc05.tar.bz2
* arm-linux-tdep.c (arm_linux_thumb2_be_breakpoint)
(arm_linux_thumb2_le_breakpoint): New constants. (arm_linux_init_abi): Set thumb2_breakpoint and thumb2_breakpoint_size. * arm-tdep.c (thumb_insn_size, thumb_advance_itstate): New functions. (thumb_get_next_pc): Add a comment. Rename IT to ITSTATE. Implement support for single stepping through IT blocks if a 32-bit Thumb breakpoint instruction is available. (arm_breakpoint_from_pc): If a 32-bit Thumb breakpoint instruction is available, use it when needed. (arm_remote_breakpoint_from_pc): New function. (arm_gdbarch_init): Register arm_remote_breakpoint_from_pc. * arm-tdep.h (struct gdbarch_tdep): Correct thumb_breakpoint comment. Add thumb2_breakpoint and thumb2_breakpoint_size. gdbserver/ * linux-arm-low.c (thumb_breakpoint_len): Delete. (thumb2_breakpoint): New. (arm_breakpoint_at): Check for Thumb-2 breakpoints. testsuite/ * gdb.arch/thumb2-it.S, gdb.arch/thumb2-it.exp: New files.
Diffstat (limited to 'gdb/arm-linux-tdep.c')
-rw-r--r--gdb/arm-linux-tdep.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 661a5bd..af409f6 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -74,6 +74,14 @@ static const char arm_linux_thumb_be_breakpoint[] = {0xde, 0x01};
static const char arm_linux_thumb_le_breakpoint[] = {0x01, 0xde};
+/* Because the 16-bit Thumb breakpoint is affected by Thumb-2 IT blocks,
+ we must use a length-appropriate breakpoint for 32-bit Thumb
+ instructions. See also thumb_get_next_pc. */
+
+static const char arm_linux_thumb2_be_breakpoint[] = { 0xf7, 0xf0, 0xa0, 0x00 };
+
+static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
+
/* Description of the longjmp buffer. */
#define ARM_LINUX_JB_ELEMENT_SIZE INT_REGISTER_SIZE
#define ARM_LINUX_JB_PC 21
@@ -851,6 +859,7 @@ arm_linux_init_abi (struct gdbarch_info info,
else
tdep->arm_breakpoint = arm_linux_arm_be_breakpoint;
tdep->thumb_breakpoint = arm_linux_thumb_be_breakpoint;
+ tdep->thumb2_breakpoint = arm_linux_thumb2_be_breakpoint;
}
else
{
@@ -859,9 +868,11 @@ arm_linux_init_abi (struct gdbarch_info info,
else
tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
tdep->thumb_breakpoint = arm_linux_thumb_le_breakpoint;
+ tdep->thumb2_breakpoint = arm_linux_thumb2_le_breakpoint;
}
tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
tdep->thumb_breakpoint_size = sizeof (arm_linux_thumb_le_breakpoint);
+ tdep->thumb2_breakpoint_size = sizeof (arm_linux_thumb2_le_breakpoint);
if (tdep->fp_model == ARM_FLOAT_AUTO)
tdep->fp_model = ARM_FLOAT_FPA;