summaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorqiyao <qiyao>2011-02-16 14:54:39 +0000
committerqiyao <qiyao>2011-02-16 14:54:39 +0000
commit48d7883334d3a2d3f3fec543dd6636a32dd4230f (patch)
tree90e058c55394b4ee2d3ffb89a154e4d7b8d4a3ad /gdb/arm-tdep.c
parentdd1ced47463d49196deb4d46c687dbb468622505 (diff)
downloadgdb-48d7883334d3a2d3f3fec543dd6636a32dd4230f.tar.gz
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 6a279d19e1a..96061e37d9f 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))