From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52877 invoked by alias); 28 Oct 2016 14:53:14 -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 52777 invoked by uid 89); 28 Oct 2016 14:53:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,SPF_PASS autolearn=ham version=3.3.2 spammy=*options, *prospective_options X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Oct 2016 14:53:12 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9SEn4NR060807 for ; Fri, 28 Oct 2016 10:53:10 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 26c2rg5dx7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2016 10:53:10 -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 10:53:09 -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 10:53:07 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DFDB338C8046; Fri, 28 Oct 2016 10:53:06 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9SEr7Yw27197662; Fri, 28 Oct 2016 14:53:07 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F4209AE05F; Fri, 28 Oct 2016 10:53:06 -0400 (EDT) Received: from otta.local (unknown [9.85.133.123]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 8CA09AE051; Fri, 28 Oct 2016 10:53:06 -0400 (EDT) Subject: Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER. To: Pedro Alves , Ulrich Weigand References: <20161012082525.3250910FDC3@oc8523832656.ibm.com> <88940498-822b-b192-b983-d8571a81ad87@redhat.com> <2c62687d-f013-5af8-96ae-d7f56d28c218@redhat.com> <4f8959a7-33b9-385c-3c63-2d5b26286579@vnet.ibm.com> <3b814d5e-f716-f1c7-1530-684901b28e30@redhat.com> Cc: Alan Modra , gdb-patches@sourceware.org, binutils From: Peter Bergner Date: Fri, 28 Oct 2016 14:53: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: <3b814d5e-f716-f1c7-1530-684901b28e30@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102814-0040-0000-0000-000001B5C8C1 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.00773969; UDB=6.00371701; IPR=6.00550770; 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 14:53:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102814-0041-0000-0000-000005A8DC9F Message-Id: <88312c99-f1bb-c3d9-8e65-8ab64f086f42@vnet.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=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610280253 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00810.txt.bz2 On 10/28/16 9:30 AM, Pedro Alves wrote: > On 10/28/2016 03:24 PM, Peter Bergner wrote: >> On 10/28/16 9:10 AM, Pedro Alves wrote: >>> Maybe not. Where are the per-arch settings stored? >> >> They're stored in the gdbarch... > > You mean, as a new string member of gdbarch? That sounds > problematic, since you can have multiple different gdbarch > instances for the same architecture live at the same time. > > BTC, I'm talking about where does the FOO > in "set disassembler-options FOO" end up stored. The way the code is now, I create a static var in _initialize_disasm to hold it: disasm.c: +void +_initialize_disasm (void) +{ + static char *prospective_options = NULL; Only after we have validated FOO is ok, I copy it to the gdbarch in set_disassembler_options: disasm.c: +static void +set_disassembler_options (struct gdbarch *gdbarch, char *args, + int from_tty, struct cmd_list_element *c) +{ + char *options = *(char **)c->var; + free (gdbarch_disassembler_options (gdbarch)); + set_gdbarch_disassembler_options (gdbarch, xstrdup (options)); I didn't realize we could have multiple gdbarchs for the same arch live at the same time. Do you have a suggestion on how to fix this? Maybe each arch will have its own *-tdep.c global var to hold it and maybe store a pointer to that in the gdbarch? Peter