diff options
author | Yao Qi <yao.qi@linaro.org> | 2015-10-05 11:15:58 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2015-10-28 14:22:57 +0000 |
commit | 43cdf5aeb8ae6ac2ec3bdbf636cbb2731ccbbb2a (patch) | |
tree | 69ea73c3be6425045db21170af2694f58dc5cc49 /opcodes | |
parent | 82188b295de579bee5f68de9f4d76ce4a3d41aa9 (diff) | |
download | gdb-43cdf5aeb8ae6ac2ec3bdbf636cbb2731ccbbb2a.zip gdb-43cdf5aeb8ae6ac2ec3bdbf636cbb2731ccbbb2a.tar.gz gdb-43cdf5aeb8ae6ac2ec3bdbf636cbb2731ccbbb2a.tar.bz2 |
Pass noaliases_p to aarch64_decode_insn
Nowadays aarch64_decode_insn is a public interface used by both
opcodes and gdb. However, its behaviour relies on a global variable
no_aliases, which isn't a good practise. On the other hand, In default,
no_aliases is zero, but in GDB, we do want no alias when decoding
instructions for prologue analysis (patches to be posted), so that we
can handle both instructions "add" and "mov" (an alias of "add") as
"add". The code in GDB can be simplified.
This patch adds a new argument in aarch64_decode_insn, and pass no_aliases
to it. In GDB side, always pass 1 to it.
include/opcode:
2015-10-28 Yao Qi <yao.qi@linaro.org>
* aarch64.h (aarch64_decode_insn): Update declaration.
opcodes:
2015-10-28 Yao Qi <yao.qi@linaro.org>
* aarch64-dis.c (aarch64_decode_insn): Add one argument
noaliases_p. Update comments. Pass noaliases_p rather than
no_aliases to aarch64_opcode_decode.
(print_insn_aarch64_word): Pass no_aliases to
aarch64_decode_insn.
gdb:
2015-10-28 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_software_single_step): Pass 1 to
aarch64_decode_insn.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 8 | ||||
-rw-r--r-- | opcodes/aarch64-dis.c | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index d0f7771..8952872 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,11 @@ +2015-10-28 Yao Qi <yao.qi@linaro.org> + + * aarch64-dis.c (aarch64_decode_insn): Add one argument + noaliases_p. Update comments. Pass noaliases_p rather than + no_aliases to aarch64_opcode_decode. + (print_insn_aarch64_word): Pass no_aliases to + aarch64_decode_insn. + 2015-10-27 Vinay <Vinay.G@kpit.com> PR binutils/19159 diff --git a/opcodes/aarch64-dis.c b/opcodes/aarch64-dis.c index 9b96cff..93766c6 100644 --- a/opcodes/aarch64-dis.c +++ b/opcodes/aarch64-dis.c @@ -2029,11 +2029,13 @@ user_friendly_fixup (aarch64_inst *inst) } } -/* Decode INSN and fill in *INST the instruction information. Return zero - on success. */ +/* Decode INSN and fill in *INST the instruction information. An alias + opcode may be filled in *INSN if NOALIASES_P is FALSE. Return zero on + success. */ int -aarch64_decode_insn (aarch64_insn insn, aarch64_inst *inst) +aarch64_decode_insn (aarch64_insn insn, aarch64_inst *inst, + bfd_boolean noaliases_p) { const aarch64_opcode *opcode = aarch64_opcode_lookup (insn); @@ -2060,7 +2062,7 @@ aarch64_decode_insn (aarch64_insn insn, aarch64_inst *inst) { /* But only one opcode can be decoded successfully for, as the decoding routine will check the constraint carefully. */ - if (aarch64_opcode_decode (opcode, insn, inst, no_aliases) == 1) + if (aarch64_opcode_decode (opcode, insn, inst, noaliases_p) == 1) return ERR_OK; opcode = aarch64_find_next_opcode (opcode); } @@ -2172,7 +2174,7 @@ print_insn_aarch64_word (bfd_vma pc, addresses, since the addend is not currently pc-relative. */ pc = 0; - ret = aarch64_decode_insn (word, &inst); + ret = aarch64_decode_insn (word, &inst, no_aliases); if (((word >> 21) & 0x3ff) == 1) { |