From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79777 invoked by alias); 28 Oct 2016 14:15:34 -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 79078 invoked by uid 89); 28 Oct 2016 14:15:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=unavailable version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Oct 2016 14:15:22 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9SEEGco143764 for ; Fri, 28 Oct 2016 10:15:20 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 26c3kh0fdu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2016 10:15:20 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Oct 2016 15:15:17 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 28 Oct 2016 15:15:14 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id DD50A17D8063; Fri, 28 Oct 2016 15:17:29 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9SEFEXN26607848; Fri, 28 Oct 2016 14:15:14 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9SEFC2D009990; Fri, 28 Oct 2016 08:15:13 -0600 Received: from oc8523832656.ibm.com (icon-9-164-186-41.megacenter.de.ibm.com [9.164.186.41]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9SEFCob009980; Fri, 28 Oct 2016 08:15:12 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id 5B39E10B91A; Fri, 28 Oct 2016 16:15:11 +0200 (CEST) Subject: Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER. To: bergner@vnet.ibm.com (Peter Bergner) Date: Fri, 28 Oct 2016 14:15:00 -0000 From: "Ulrich Weigand" Cc: palves@redhat.com (Pedro Alves), amodra@gmail.com (Alan Modra), gdb-patches@sourceware.org, binutils@sourceware.org (binutils) In-Reply-To: from "Peter Bergner" at Oct 28, 2016 08:45:17 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102814-0012-0000-0000-0000047C7BA0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102814-0013-0000-0000-000015FCB52F Message-Id: <20161028141511.5B39E10B91A@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-28_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610280243 X-SW-Source: 2016-10/txt/msg00804.txt.bz2 Peter Bergner wrote: > Yes, given Pedro's last comment, that is what I'm working on. > One complication is that some arches (eg, arm) not only allow > comma's as separators, but also allow spaces. Do we allow > that for all architectures or should an architecture register > which char(s) it allows as separators? It's probably not that important to exactly match objdump behavior here. B.t.w. how do you even enter a space as separator with the -M option? > We could add a generic show_disassembler_options loops that dumps > out all of the valid options, but many of the architectures have > functions that already do that, that include extra option info. > I'm hesitant to copy that info over as well as the formatting > will be different since we'll have a common displayer. I was > thinking of modifying the opcodes/*-dis.c display functions > to take a generic function pointer that they would use to > print their output, then the objdump and gdb calls to that > function could pass fprintf (std.., and fprintf_unfiltered(... > and then things should work and look as before? Thoughts on that? I thought rather that it would be preferable to refactor the objdump code first, so that even in objdump, there is already a generic printing routine that simply works on a list of option name / description pairs provided by the target back-end. Then we could simply make that list of option name / description pairs available to GDB and use it in a GDB generic print routine that then automatically looks similar to the native objdump help output. > My only thought after moving all of this code to generic code is, > how do I handle the arch specific "set disassenbler..." > code? One thought is that maybe we don't even need it anymore > and we just always use the generic "set disassembler...." command. > Thoughts? Otherwise, we'll have to setup the arch specific > routine to call the generic one. If all the existing use cases continue to work, I think this would be the preferable option. > > In fact, once the option processing is done in common code, we don't > > even really need the per-gdbarch disassemble_init_for_target option > > any more, since common code could simply set the disassembler_options > > string before calling disassemble_init_for_target. > > I realized that too and have already removed it. Instead, I'm just > unconditionally setting info->disassembler_options just before calling > disassemble_init_for_target. For those architectures that don't > opt in for this, it will just set info->disassembler_options to > NULL, which is what it already is doing for them. OK, sounds good. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com