From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90036 invoked by alias); 14 Feb 2017 17:21:19 -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 89474 invoked by uid 89); 14 Feb 2017 17:21:17 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*uweigand, ppc64, ppcps, ppc32 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-qt0-f196.google.com Received: from mail-qt0-f196.google.com (HELO mail-qt0-f196.google.com) (209.85.216.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Feb 2017 17:21:14 +0000 Received: by mail-qt0-f196.google.com with SMTP id s58so18182960qtc.2; Tue, 14 Feb 2017 09:21:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=D5c1fnsIrLu55YefoALkZ1ASSbg30JVzHInYGmKMB/o=; b=j9UgM6hdwVgcUq8fLdmp+Mg+4KsNuEIIrq1WATOsgjt2qCD7ZljwqSUQepqVSADrUC jR0vSCPbiaqk34CQDzOlIbbgy7Bhl6H7kj3E1PWy/Ld/Jm97SNQp4toXA1xuHI4w/NTH JgIUeazxvf9yrAhOCRDCbum9Y25kQSIlP/5ScppN6lqIeQmfmCgoXKqMzE64F8r7vlK9 HgKCsvBh0M+Bf/quPpb9fYjU54sgMy3iTYVfDfQH9Seak81+xLxiGkeO4aZNVT56xZ8F UiPsouyMgBVYOB5d0VShvK/ls10i7E8o8bSL/mAUZq75sxBbIDUszVikFMHkgEKmkOlU CBuA== X-Gm-Message-State: AMke39lXEitVxV7gEZVl/e05kvlH/J2poQ2dPp7crJ2mA3Tne9atV1xVeA8qguGuiHeDkiFFV2Hr6ID+cp2r/g== X-Received: by 10.237.63.119 with SMTP id q52mr27577143qtf.29.1487092873182; Tue, 14 Feb 2017 09:21:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.140.194 with HTTP; Tue, 14 Feb 2017 09:21:12 -0800 (PST) In-Reply-To: <72237b44-c785-c22d-5664-a87c28a9678a@redhat.com> References: <867f4uccky.fsf@gmail.com> <72237b44-c785-c22d-5664-a87c28a9678a@redhat.com> From: Yao Qi Date: Tue, 14 Feb 2017 17:21:00 -0000 Message-ID: Subject: Re: [PATCH, updated] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Pedro Alves Cc: Peter Bergner , "gdb-patches@sourceware.org" , Alan Modra , Ulrich Weigand , Eli Zaretskii , Nick Clifton , binutils Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00390.txt.bz2 On Mon, Feb 13, 2017 at 4:58 PM, 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 differe= nt > POWER (etc.) gdbarch instances have their own instance of the option stri= ng. Hi Pedro, Peter's patch makes each gdbarch instance has its own instance of option string set by GDB. Peter's patch adds two things in gdbarch, +# Functions for allowing a target to modify its disassembler options. +v:char *:disassembler_options:::0:0::0:pstring (gdbarch->disassembler_opti= ons) +v:const disasm_options_t *:disassembler_options_arch:::0:0::0:host_address_to_string (gdbarch->disassembler_options_arch->name The former one is a string, and it is per-gdbarch-instance. The latter is a function, which provides all valid options for an arch. Different gdbarch instances for powerpc, for example, have the same valid options, but each gdbarch instance will have its own setting (set by GDB command). With Peter's patch applied, (gdb) set architecture powerpc:403 The target architecture is assumed to be powerpc:403 (gdb) set disassembler-options ppc32 (gdb) show disassembler-options The current disassembler options are 'ppc32' The following disassembler options are supported for use with the 'set disassembler-options