This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/3 V2] [aarch64] Use opcodes to decode instructions in GDB
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: marcus dot shawcroft at gmail dot com
- Cc: gdb-patches at sourceware dot org, binutils at sourceware dot org
- Date: Fri, 2 Oct 2015 12:23:56 +0100
- Subject: [PATCH 0/3 V2] [aarch64] Use opcodes to decode instructions in GDB
- Authentication-results: sourceware.org; auth=none
- References: <CAFqB+Px8-V8eojj8T66_zrM6krPeGXBVLU9h+_j5yEcrk0MMJg at mail dot gmail dot com>
Hi Marcus,
On 02/10/15 08:51, Marcus Shawcroft wrote:
> I'll let others comment on the gdb aspect of this patch, w.r.t
> opcodes, the aarch64-dis.h header is internal to opcodes. The public
> interface to opcodes is exposed via include/opcode/aarch64.h or
> include/dis-asm.h. The latter exposes just the cross architecture
> disassembler interface so I think includes/opcode/aarch64.h is the
> right choice in this case.
OK, I move the declaration to includes/opcode/aarch64.h in V2.
>
> Before we expose this function, can we put in a patch to rename it to
> following the name space convention used by the other exposed
> functions, something like aarch64_disassemble_insn.? I think we should
Patch #2 in V2 does this, but renames it to aarch64_decode_insn,
because aarch64_decode_insn can be used in disassemble, but also in
something else.
> take the patch to drop the PC argument first, then rename and expose
> the function, then the gdb patch to use the interface.
OK, in V2, there are three patches. Patch #1 remove the PC argument,
patch #2 exposes and renames disas_aarch64_insn, and patch #3 use it
GDB.
>
>> >+/* Decode INSN and fill in *INST the instruction information. Return zero
>> >+ on success. */
>> >+
>> >+int disas_aarch64_insn (uint32_t insn, aarch64_inst *inst);
> The prototype should drop the formal argument names, irrespective of
> which .h file it lands in.
Fixed in V2.
*** BLURB HERE ***
Yao Qi (3):
[aarch64] Remove argument pc from disas_aarch64_insn
[aarch64] expose disas_aarch64_insn and rename it to
aarch64_decode_insn
[aarch64] use aarch64_decode_insn to decode instructions in GDB
gdb/aarch64-tdep.c | 29 ++++++++++++++++++-----------
include/opcode/aarch64.h | 3 +++
opcodes/aarch64-dis.c | 10 +++++-----
3 files changed, 26 insertions(+), 16 deletions(-)
--
1.9.1