From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34549 invoked by alias); 13 Feb 2017 17:32:39 -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 34537 invoked by uid 89); 13 Feb 2017 17:32:38 -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,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=connects, alans, power-based, POWER-based 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; Mon, 13 Feb 2017 17:32:37 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1DHSuDa055343 for ; Mon, 13 Feb 2017 12:32:36 -0500 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 28keajgu5s-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Feb 2017 12:32:35 -0500 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2017 10:32:35 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Feb 2017 10:32:31 -0700 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id B6A423E40047; Mon, 13 Feb 2017 10:32:30 -0700 (MST) Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1DHWUDE16908724; Mon, 13 Feb 2017 17:32:30 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FD64AC03A; Mon, 13 Feb 2017 12:32:29 -0500 (EST) Received: from otta.rchland.ibm.com (unknown [9.10.86.191]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id E35C1AC043; Mon, 13 Feb 2017 12:32:28 -0500 (EST) Subject: Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Pedro Alves , Yao Qi References: <867f4uccky.fsf@gmail.com> <72237b44-c785-c22d-5664-a87c28a9678a@redhat.com> Cc: gdb-patches@sourceware.org, Alan Modra , Ulrich Weigand , Eli Zaretskii , Nick Clifton , binutils From: Peter Bergner Date: Mon, 13 Feb 2017 17:32:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <72237b44-c785-c22d-5664-a87c28a9678a@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021317-0004-0000-0000-0000118FC5AD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006610; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000203; SDB=6.00821419; UDB=6.00401738; IPR=6.00598872; BA=6.00005133; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014268; XFM=3.00000011; UTC=2017-02-13 17:32:33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021317-0005-0000-0000-00007D04DBED Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-13_09:,, 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-1612050000 definitions=main-1702130170 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00352.txt.bz2 On 2/13/17 10:58 AM, Pedro Alves wrote: > On 02/13/2017 03:52 PM, Yao Qi wrote: >> These options should be modeled as per-architecture data. We need to >> define a key to access that data dynamically. grep >> "static struct gdbarch_data *" in *.c. > > If I understand the suggestion correctly, that would make all the different > POWER (etc.) gdbarch instances have their own instance of the option string. > I.e., the POWER gdbarch instance determined for the objfile before the program > is run or GDB connects to a target would have a different set of options than > the gdbarch instance created based on the POWER-based XML target description > returned by the (e.g.), remote server, because those are different > gdbarch object instances. As a result "set disassembler-options" would > show different options before and after run/connection (and in other > situations that use different gdbarch objects). > > What Alan's implementation achieves instead is that there's only one option > value string for the whole family of gdbarchs of a given architecture, like > POWER vs MIPS, vs x86, etc, so that the disassembler options active persist > across internal uses of all the different gdbarch instances that > model variants of the same CPU architecture. s/Alan's/Peter's/. :-) Thank you for explaining what Yao's suggestion would do. As a user, I'd much prefer setting a disassembler option (per arch) and having that be used for all of my disassemble commands, versus to having to set it for each gdbarch instance. I think that would also fall under the principle of least surprise rule too. Peter