From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68148 invoked by alias); 23 May 2017 09:19:15 -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 68091 invoked by uid 89); 23 May 2017 09:19:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=POWER X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 May 2017 09:19:12 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2546AC054C29; Tue, 23 May 2017 09:19:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2546AC054C29 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2546AC054C29 Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A0A37FBA0; Tue, 23 May 2017 09:19:13 +0000 (UTC) Subject: Re: [PATCH 0/6] Unify the disassembler selection in gdb and objdump To: Yao Qi , binutils@sourceware.org, gdb-patches@sourceware.org References: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> From: Pedro Alves Message-ID: <4043318f-b008-1f51-3aa9-2d8fab461273@redhat.com> Date: Tue, 23 May 2017 09:19:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00506.txt.bz2 On 05/16/2017 11:48 AM, Yao Qi wrote: > Nowadays, we have opcodes library which provides disassembler for each > architecture (print_insn_XX functions), and gdb, objdump and sim use > them. However, they (at least gdb and objdump) select disassembler > in different places, so this causes some duplicated code and > inconsistencies. > > This patch series change gdb selecting disassembler through > opcodes/disassemble.c:disassembler in default, but there are still > some targets select their disassemblers in their own way (AFAICS, > they can be changed to disassemble.c:disassembler too in the > follow up patches). > > Patch #1 refactor the code. Patch #2 does the major change in this > series, but only apply to the obvious places. Patch #3-4 do the > similar changes too, but not as obvious as patch #2. Patch #5 > fixes the inconsistency of rs6000 disassembler selection. As a > result of these changes, a lot of print_insn_XXX functions are no > longer needed out side of opcodes library, so patch #6, as an RFC, > moves these function declarations from include/dis-asm.h to an > internal header in opcodes/. > > If this series is on the right track, I'll change the rest of gdb > ports (like arm, mips, aarch64, etc) to default disassembler > selection. I like this. Eliminating objdump / gdb inconsistencies by design is great. Passing arch/mach to opcodes:disassembler makes it possible to have gdb tell opcodes to select the right disassembler based on what arch the remote target description says the target has, even without a bfd. The GDB parts look good to me. > > The series is tested for gdb on x86_64-linux and ppc64-linux (gcc110). Good testing. I was wondering whether the POWER/gdb change had any visible effect on the testsuite. [OTOH, if it didn't, then it sounds like we're missing some kind of test that exercises default disassembler selection]. > It is also tested for binutils/ld/gas on x86_64-linux with all targets > enabled. Thanks, Pedro Alves