From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62045 invoked by alias); 13 Feb 2017 16:58:38 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 62022 invoked by uid 89); 13 Feb 2017 16:58:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=connects, HTo:U*bergner, H*MI:sk:867f4uc, family X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Feb 2017 16:58:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C7D23D952; Mon, 13 Feb 2017 16:58:37 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1DGwUqC015111; Mon, 13 Feb 2017 11:58:30 -0500 Subject: Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Yao Qi , Peter Bergner References: <867f4uccky.fsf@gmail.com> Cc: gdb-patches@sourceware.org, Alan Modra , Ulrich Weigand , Eli Zaretskii , Nick Clifton , binutils From: Pedro Alves Message-ID: <72237b44-c785-c22d-5664-a87c28a9678a@redhat.com> Date: Mon, 13 Feb 2017 16:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <867f4uccky.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00085.txt.bz2 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. Thanks, Pedro Alves