diff options
author | Yao Qi <yao@codesourcery.com> | 2011-04-07 04:18:02 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2011-04-07 04:18:02 +0000 |
commit | bd18283a08463e34d632cb27a21c2962eecf65cd (patch) | |
tree | 40060d26fd5b981e2f17c50b1f7163b36bb92fe4 /gdb/arm-tdep.c | |
parent | 8c8dba6d3d8f6509729107b34385d98e3301621e (diff) | |
download | gdb-bd18283a08463e34d632cb27a21c2962eecf65cd.zip gdb-bd18283a08463e34d632cb27a21c2962eecf65cd.tar.gz gdb-bd18283a08463e34d632cb27a21c2962eecf65cd.tar.bz2 |
2011-04-07 Yao Qi <yao@codesourcery.com>
* arm-linux-tdep.c (arm_linux_copy_svc): Remove parameters INSN
and TO.
* arm-tdep.c (cleanup_svc): Handle variable instruction size.
(arm_copy_svc): Remove parameters INSN and TO.
(decode_svc_copro): Update caller.
* arm-tdep.h (struct displaced_step_closure): Remove parameters
from function pointer `copy_svc_os'.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 024191b..f33dc10 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -6358,7 +6358,7 @@ static void cleanup_svc (struct gdbarch *gdbarch, struct regcache *regs, struct displaced_step_closure *dsc) { - CORE_ADDR resume_addr = dsc->insn_addr + 4; + CORE_ADDR resume_addr = dsc->insn_addr + dsc->insn_size; if (debug_displaced) fprintf_unfiltered (gdb_stdlog, "displaced: cleanup for svc, resume at " @@ -6368,12 +6368,9 @@ cleanup_svc (struct gdbarch *gdbarch, struct regcache *regs, } static int -copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to, +copy_svc (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs, struct displaced_step_closure *dsc) { - /* Allow OS-specific code to override SVC handling. */ - if (dsc->u.svc.copy_svc_os) - return dsc->u.svc.copy_svc_os (gdbarch, insn, to, regs, dsc); if (debug_displaced) fprintf_unfiltered (gdb_stdlog, "displaced: copying svc insn %.8lx\n", @@ -6385,12 +6382,19 @@ copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to, dsc->modinsn[0] = insn; - dsc->cleanup = &cleanup_svc; /* Pretend we wrote to the PC, so cleanup doesn't set PC to the next instruction. */ dsc->wrote_to_pc = 1; - return 0; + /* Allow OS-specific code to override SVC handling. */ + if (dsc->u.svc.copy_svc_os) + return dsc->u.svc.copy_svc_os (gdbarch, regs, dsc); + else + { + dsc->cleanup = &cleanup_svc; + return 0; + } + } /* Copy undefined instructions. */ @@ -6843,7 +6847,7 @@ decode_svc_copro (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to, else if ((op1 & 0x31) == 0x21 && op && (coproc & 0xe) != 0xa) return copy_unmodified (gdbarch, insn, "mrc/mrc2", dsc); else if ((op1 & 0x30) == 0x30) - return copy_svc (gdbarch, insn, to, regs, dsc); + return copy_svc (gdbarch, insn, regs, dsc); else return copy_undef (gdbarch, insn, dsc); /* Possibly unreachable. */ } |