From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41467 invoked by alias); 2 Oct 2015 07:51:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 41444 invoked by uid 89); 2 Oct 2015 07:51:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lb0-f170.google.com Received: from mail-lb0-f170.google.com (HELO mail-lb0-f170.google.com) (209.85.217.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 02 Oct 2015 07:51:21 +0000 Received: by lbos8 with SMTP id s8so22114535lbo.0; Fri, 02 Oct 2015 00:51:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.25.16.195 with SMTP id 64mr3151133lfq.39.1443772278135; Fri, 02 Oct 2015 00:51:18 -0700 (PDT) Received: by 10.25.165.142 with HTTP; Fri, 2 Oct 2015 00:51:18 -0700 (PDT) In-Reply-To: <1443717344-8632-3-git-send-email-yao.qi@linaro.org> References: <1443717344-8632-1-git-send-email-yao.qi@linaro.org> <1443717344-8632-3-git-send-email-yao.qi@linaro.org> Date: Fri, 02 Oct 2015 07:51:00 -0000 Message-ID: Subject: Re: [PATCH 2/2] [aarch64] Use opcodes to decode instructions in GDB From: Marcus Shawcroft To: Yao Qi Cc: "gdb-patches@sourceware.org" , "binutils@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00013.txt.bz2 Hi Yao On 1 October 2015 at 17:35, Yao Qi wrote: > In this patch, I expose disas_aarch64_insn in opcodes, and use it in > aarch64_software_single_step to decode instructions. If this is a > good way to go, I'll continue using disas_aarch64_insn in other > places such as prologue analysis and even fast tracepoint in GDBserver. > > Regression tested GDB for target aarch64-linux-gnu. Is opcodes change OK? > > opcodes: > > 2015-10-01 Yao Qi > > * aarch64-dis.c (disas_aarch64_insn): Make it external. Update > comments. > * aarch64-dis.h (disas_aarch64_insn): Declare it. 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. 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 take the patch to drop the PC argument first, then rename and expose the function, then the gdb patch to use the interface. > +/* 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. Cheers /Marcus