aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2010-08-30 15:26:28 +0000
committerYao Qi <yao@codesourcery.com>2010-08-30 15:26:28 +0000
commit25b41d01eaa6f8f68491ef2eb65ca403907269f7 (patch)
treea14669ff0fd05c2310996f7fb51fd2beaa740599 /gdb/arm-tdep.c
parenteb34ac7a77ac46a9ddde8c67914c2f4e584429dc (diff)
downloadgdb-25b41d01eaa6f8f68491ef2eb65ca403907269f7.zip
gdb-25b41d01eaa6f8f68491ef2eb65ca403907269f7.tar.gz
gdb-25b41d01eaa6f8f68491ef2eb65ca403907269f7.tar.bz2
2010-08-30 Yao Qi <yao@codesourcery.com>
* arm-linux-tdep.c (arm_linux_sigreturn_return_addr): New. (arm_linux_syscall_next_pc): New. (arm_linux_copy_svc): Use arm_linux_sigreturn_return_addr instead. (arm_linux_init_abi): Initialize syscall_next_pc. * arm-tdep.c (thumb_get_next_pc_raw): Get next pc of SWI in Thumb mode. (arm_get_next_pc_raw): Get next pc of SWI in ARM mode. * arm-tdep.h (struct gdbarch_tdep): Add a function pointer syscall_next_pc. Declare arm_frame_is_thumb.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 5a7e76d..4a028c8 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -270,7 +270,7 @@ arm_psr_thumb_bit (struct gdbarch *gdbarch)
/* Determine if FRAME is executing in Thumb mode. */
-static int
+int
arm_frame_is_thumb (struct frame_info *frame)
{
CORE_ADDR cpsr;
@@ -2828,7 +2828,16 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
else if ((inst1 & 0xf000) == 0xd000) /* conditional branch */
{
unsigned long cond = bits (inst1, 8, 11);
- if (cond != 0x0f && condition_true (cond, status)) /* 0x0f = SWI */
+ if (cond == 0x0f) /* 0x0f = SWI */
+ {
+ struct gdbarch_tdep *tdep;
+ tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->syscall_next_pc != NULL)
+ nextpc = tdep->syscall_next_pc (frame);
+
+ }
+ else if (cond != 0x0f && condition_true (cond, status))
nextpc = pc_val + (sbits (inst1, 0, 7) << 1);
}
else if ((inst1 & 0xf800) == 0xe000) /* unconditional branch */
@@ -3277,7 +3286,16 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
case 0xc:
case 0xd:
case 0xe: /* coproc ops */
+ break;
case 0xf: /* SWI */
+ {
+ struct gdbarch_tdep *tdep;
+ tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->syscall_next_pc != NULL)
+ nextpc = tdep->syscall_next_pc (frame);
+
+ }
break;
default: