From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80034 invoked by alias); 28 Oct 2016 15:02:13 -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 80009 invoked by uid 89); 28 Oct 2016 15:02:12 -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=ham version=3.3.2 spammy=U*bergner, cell 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 15:02:11 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9SExrRW129861 for ; Fri, 28 Oct 2016 11:02:10 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 26c3ar4q77-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2016 11:02:09 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Oct 2016 11:02:08 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 28 Oct 2016 11:02:05 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 774FE38C8039; Fri, 28 Oct 2016 11:02:04 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9SF244u31916234; Fri, 28 Oct 2016 15:02:04 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 997F6AE056; Fri, 28 Oct 2016 11:02:04 -0400 (EDT) Received: from otta.local (unknown [9.85.133.123]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 32859AE051; Fri, 28 Oct 2016 11:02:04 -0400 (EDT) Subject: Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER. To: Ulrich Weigand References: <20161028141511.5B39E10B91A@oc8523832656.ibm.com> Cc: Pedro Alves , Alan Modra , gdb-patches@sourceware.org, binutils From: Peter Bergner Date: Fri, 28 Oct 2016 15:02:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161028141511.5B39E10B91A@oc8523832656.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102815-0040-0000-0000-000001B5CEA0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005994; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00773970; UDB=6.00371703; IPR=6.00550772; BA=6.00004838; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013128; XFM=3.00000011; UTC=2016-10-28 15:02:07 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102815-0041-0000-0000-000005A8E27A Message-Id: 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-1610280256 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00812.txt.bz2 On 10/28/16 9:15 AM, Ulrich Weigand wrote: > 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? bergner@genoa:~$ objdump -d -M'power5 power6' wait.o | grep warning warning: ignoring unknown -Mpower5 power6 option > 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. But not all arches have descriptions paired with the option name. Looking at Pedro's objdump output from before: The following ARM specific disassembler options are supported for use with the -M switch: reg-names-special-atpcs Select special register names used in the ATPCS reg-names-atpcs Select register names used in the ATPCS reg-names-apcs Select register names used in the APCS reg-names-std Select register names used in ARM's ISA documentation reg-names-gcc Select register names used by GCC reg-names-raw Select raw register names force-thumb Assume all insns are Thumb insns no-force-thumb Examine preceding label to determine an insn's type This would work well for what you propose, but on power, we just dump them out: The following PPC specific disassembler options are supported for use with the -M switch: 403, 405, 440, 464, 476, 601, 603, 604, 620, 7400, 7410, 7450, 7455, 750cl, 821, 850, 860, a2, altivec, any, booke, booke32, cell, com, e200z4, e300, e500, e500mc, e500mc64, e5500, e6500, e500x2, efs, power4, power5, power6, power7, power8, power9, ppc, ppc32, ppc64, ppc64bridge, ppcps, pwr, pwr2, pwr4, pwr5, pwr5x, pwr6, pwr7, pwr8, pwr9, pwrx, spe, titan, vle, vsx, htm, 32, 64 I wouldn't want all of those cpus dumped out on one line apiece ala: The following PPC specific disassembler options are supported for use with the -M switch: 403 405 440 464 476 601 ... That would get very long! Peter