aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-07-22 17:10:51 +0100
committerWill Newton <will.newton@linaro.org>2014-07-28 15:48:23 +0100
commitf347ffc90a320a26394715e6f1629c856458ae15 (patch)
treec6f248738a859601e3893c1c9f6f0f196472457f /gdb
parentfdb1adc6854e4240bd8ad940c57c93d48abcc040 (diff)
downloadgdb-f347ffc90a320a26394715e6f1629c856458ae15.zip
gdb-f347ffc90a320a26394715e6f1629c856458ae15.tar.gz
gdb-f347ffc90a320a26394715e6f1629c856458ae15.tar.bz2
gdb/arm-linux-tdep.c: Handle Thumb2 signal trampolines
Recent versions of glibc have assembled the signal trampoline code as Thumb2, which causes gdb to misinterpret them and a number of testsuite tests to fail. Educate gdb about these trampolines and get the tests running again. gdb/ChangeLog: 2014-07-28 Will Newton <will.newton@linaro.org> * arm-linux-tdep.c (THUMB2_SET_R7_SIGRETURN1): New define. (THUMB2_SET_R7_SIGRETURN2): Likewise. (THUMB2_SET_R7_RT_SIGRETURN1): Likewise. (THUMB2_SET_R7_RT_SIGRETURN2): Likewise. (THUMB2_EABI_SYSCALL): Likewise. (thumb2_eabi_linux_sigreturn_tramp_frame): Create new struct tramp_frame. (thumb2_eabi_linux_rt_sigreturn_tramp_frame): Likewise. (arm_linux_init_abi): Add Thumb2 tramp frame unwinders.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/arm-linux-tdep.c35
2 files changed, 47 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0ee72df..0b80869 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2014-07-28 Will Newton <will.newton@linaro.org>
+
+ * arm-linux-tdep.c (THUMB2_SET_R7_SIGRETURN1): New define.
+ (THUMB2_SET_R7_SIGRETURN2): Likewise.
+ (THUMB2_SET_R7_RT_SIGRETURN1): Likewise.
+ (THUMB2_SET_R7_RT_SIGRETURN2): Likewise.
+ (THUMB2_EABI_SYSCALL): Likewise.
+ (thumb2_eabi_linux_sigreturn_tramp_frame): Create new
+ struct tramp_frame.
+ (thumb2_eabi_linux_rt_sigreturn_tramp_frame): Likewise.
+ (arm_linux_init_abi): Add Thumb2 tramp frame unwinders.
+
2014-07-27 Doug Evans <xdje42@gmail.com>
* guile/scm-param.c (pascm_print_param_smob): Fix output.
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index a96ea3f..4e17abd 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -246,6 +246,13 @@ static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa
#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad
#define ARM_EABI_SYSCALL 0xef000000
+/* Equivalent patterns for Thumb2. */
+#define THUMB2_SET_R7_SIGRETURN1 0xf04f
+#define THUMB2_SET_R7_SIGRETURN2 0x0777
+#define THUMB2_SET_R7_RT_SIGRETURN1 0xf04f
+#define THUMB2_SET_R7_RT_SIGRETURN2 0x07ad
+#define THUMB2_EABI_SYSCALL 0xdf00
+
/* OABI syscall restart trampoline, used for EABI executables too
whenever OABI support has been enabled in the kernel. */
#define ARM_OABI_SYSCALL_RESTART_SYSCALL 0xef900000
@@ -444,6 +451,30 @@ static struct tramp_frame arm_eabi_linux_rt_sigreturn_tramp_frame = {
arm_linux_rt_sigreturn_init
};
+static struct tramp_frame thumb2_eabi_linux_sigreturn_tramp_frame = {
+ SIGTRAMP_FRAME,
+ 2,
+ {
+ { THUMB2_SET_R7_SIGRETURN1, -1 },
+ { THUMB2_SET_R7_SIGRETURN2, -1 },
+ { THUMB2_EABI_SYSCALL, -1 },
+ { TRAMP_SENTINEL_INSN }
+ },
+ arm_linux_sigreturn_init
+};
+
+static struct tramp_frame thumb2_eabi_linux_rt_sigreturn_tramp_frame = {
+ SIGTRAMP_FRAME,
+ 2,
+ {
+ { THUMB2_SET_R7_RT_SIGRETURN1, -1 },
+ { THUMB2_SET_R7_RT_SIGRETURN2, -1 },
+ { THUMB2_EABI_SYSCALL, -1 },
+ { TRAMP_SENTINEL_INSN }
+ },
+ arm_linux_rt_sigreturn_init
+};
+
static struct tramp_frame arm_linux_restart_syscall_tramp_frame = {
NORMAL_FRAME,
4,
@@ -1416,6 +1447,10 @@ arm_linux_init_abi (struct gdbarch_info info,
tramp_frame_prepend_unwinder (gdbarch,
&arm_eabi_linux_rt_sigreturn_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
+ &thumb2_eabi_linux_sigreturn_tramp_frame);
+ tramp_frame_prepend_unwinder (gdbarch,
+ &thumb2_eabi_linux_rt_sigreturn_tramp_frame);
+ tramp_frame_prepend_unwinder (gdbarch,
&arm_linux_restart_syscall_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&arm_kernel_linux_restart_syscall_tramp_frame);