From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107925 invoked by alias); 13 Feb 2017 16:31:29 -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 107364 invoked by uid 89); 13 Feb 2017 16:31:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=unavailable version=3.3.2 spammy=sk:host_ad, *c, bergner, U*bergner 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 16:31:27 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1DGNtRe062087 for ; Mon, 13 Feb 2017 11:31:26 -0500 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 28kaqqyer2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 13 Feb 2017 11:31:26 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2017 09:31:25 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Feb 2017 09:31:20 -0700 Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 525DD19D8042; Mon, 13 Feb 2017 09:30:33 -0700 (MST) Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1DGVIHF16908706; Mon, 13 Feb 2017 16:31:19 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 617C6112051; Mon, 13 Feb 2017 11:31:19 -0500 (EST) Received: from otta.rchland.ibm.com (unknown [9.10.86.191]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id 0557711204B; Mon, 13 Feb 2017 11:31:18 -0500 (EST) Subject: Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Yao Qi References: <867f4uccky.fsf@gmail.com> Cc: gdb-patches@sourceware.org, Alan Modra , Pedro Alves , Ulrich Weigand , Eli Zaretskii , Nick Clifton , binutils From: Peter Bergner Date: Mon, 13 Feb 2017 16:31: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: <867f4uccky.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021316-0012-0000-0000-000013A459E3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006609; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000203; SDB=6.00821399; UDB=6.00401726; IPR=6.00598852; 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.00014267; XFM=3.00000011; UTC=2017-02-13 16:31:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021316-0013-0000-0000-00004B60CE3D Message-Id: <0748a6dd-4e70-0a0e-9315-b9182acf65cc@vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-13_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-1612050000 definitions=main-1702130160 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00344.txt.bz2 On 2/13/17 9:52 AM, Yao Qi wrote: > Peter Bergner writes: > Function get_arm_regname_num_options is only used in gdb. Since we've > have disassembler_options_arm, we can use it in gdb and remove > get_arm_regname_num_options. > > We use get_arm_regname_num_options in arm-tdep.c, > > /* Get the number of possible sets of register names defined in opcodes. */ > num_disassembly_options = get_arm_regname_num_options (); > > We can get 'num_disassembly_options' by iterating options from > disassembler_options_arm. > [snip] > > Likewise, we can use disassembler_options_arm in gdb and remove [snip] > but we can replace it by disassembler_options_arm instead. Sure, that should be doable. >> +# Functions for allowing a target to modify its disassembler options. >> +v:char *:disassembler_options:::0:0::0:pstring (gdbarch->disassembler_options) > > 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. This is new to me, so can you give me an explicit example? Can you also explain how its behavior will change but doing it your way? >> +v:const disasm_options_t *:disassembler_options_arch:::0:0::0:host_address_to_string (gdbarch->disassembler_options_arch->name) > > disassembler_options_arch is not clear to me, and I feel > gdbarch_disassembler_options_arch is even worse. How about renaming it > to "disassembler_options_supported" or "valid_disassembler_options"? Heh, looking back on it, yeah, I don't like the name either. :-) Yours are much better. I'll probably go with valid_disassembler_options. Thanks. Peter