aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-02-16 14:54:42 +0000
committerYao Qi <yao@codesourcery.com>2011-02-16 14:54:42 +0000
commita42244dbec4d58c5577a84215d92c85a6c067d1a (patch)
tree26c29b1b46afb067d5cc8d0fd227585b706c73d3 /gdb/arm-tdep.c
parent3dfcbbd281d9c7f0a0f29a3aabf59e45a5142fd4 (diff)
downloadgdb-a42244dbec4d58c5577a84215d92c85a6c067d1a.zip
gdb-a42244dbec4d58c5577a84215d92c85a6c067d1a.tar.gz
gdb-a42244dbec4d58c5577a84215d92c85a6c067d1a.tar.bz2
2011-02-16 Yao Qi <yao@qiyaows>
* infrun.c (get_displaced_step_closure_by_addr): New. * inferior.h: Declare it. * arm-tdep.c: (arm_pc_is_thumb): Call get_displaced_step_closure_by_addr. Adjust MEMADDR if it returns non-NULL.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 6a279d1..96061e3 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -369,6 +369,20 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr)
struct obj_section *sec;
struct minimal_symbol *sym;
char type;
+ struct displaced_step_closure* dsc
+ = get_displaced_step_closure_by_addr(memaddr);
+
+ /* If checking the mode of displaced instruction in copy area, the mode
+ should be determined by instruction on the original address. */
+ if (dsc)
+ {
+ if (debug_displaced)
+ fprintf_unfiltered (gdb_stdlog,
+ "displaced: check mode of %.8lx instead of %.8lx\n",
+ (unsigned long) dsc->insn_addr,
+ (unsigned long) memaddr);
+ memaddr = dsc->insn_addr;
+ }
/* If bit 0 of the address is set, assume this is a Thumb address. */
if (IS_THUMB_ADDR (memaddr))