diff options
author | Pierre Langlois <pierre.langlois@arm.com> | 2015-09-21 15:01:04 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2015-09-21 15:01:04 +0100 |
commit | 6ec5f4be052e594dc90b6677fec1c1e7727d9651 (patch) | |
tree | a3cd573fae1dca52781754dedb6c281563509679 /gdb/aarch64-tdep.c | |
parent | 787749ead66eee8c20754c160bd79404b2109553 (diff) | |
download | binutils-gdb-6ec5f4be052e594dc90b6677fec1c1e7727d9651.tar.gz |
Make aarch64_decode_adrp handle both ADR and ADRP instructions
We will need to decode both ADR and ADRP instructions in GDBserver.
This patch makes common code handle both cases, even if GDB only needs
to decode the ADRP instruction.
gdb/ChangeLog:
* aarch64-tdep.c (aarch64_analyze_prologue): New is_adrp
variable. Call aarch64_decode_adr instead of
aarch64_decode_adrp.
* arch/aarch64-insn.h (aarch64_decode_adrp): Delete.
(aarch64_decode_adr): New function declaration.
* arch/aarch64-insn.c (aarch64_decode_adrp): Delete.
(aarch64_decode_adr): New function, factored out from
aarch64_decode_adrp to decode both adr and adrp instructions.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 92e24047bb4..da61e546db9 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -551,13 +551,15 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch, int is_cbnz; int is_tbnz; unsigned bit; + int is_adrp; int32_t offset; insn = read_memory_unsigned_integer (start, 4, byte_order_for_code); if (aarch64_decode_add_sub_imm (start, insn, &rd, &rn, &imm)) regs[rd] = pv_add_constant (regs[rn], imm); - else if (aarch64_decode_adrp (start, insn, &rd)) + else if (aarch64_decode_adr (start, insn, &is_adrp, &rd, &offset) + && is_adrp) regs[rd] = pv_unknown (); else if (aarch64_decode_b (start, insn, &is_link, &offset)) { |