From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111364 invoked by alias); 11 Oct 2016 00:09:02 -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 111344 invoked by uid 89); 11 Oct 2016 00:09:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Bonus, Hx-languages-length:1368, seemingly, bonus 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; Tue, 11 Oct 2016 00:09:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 43B057F7AB; Tue, 11 Oct 2016 00:08:59 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9B08t0a000695; Mon, 10 Oct 2016 20:08:56 -0400 Subject: Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER. To: Peter Bergner References: <20160930161908.6A43511C24D@oc8523832656.ibm.com> <20161003222527.GO4877@bubble.grove.modra.org> <5a66aca9-dfe9-7c44-21f9-27774a07d143@vnet.ibm.com> <91e1cf79-06d8-0eff-a1a0-5665563f0054@vnet.ibm.com> Cc: Alan Modra , Ulrich Weigand , gdb-patches@sourceware.org, binutils From: Pedro Alves Message-ID: <98f7c932-3347-a07c-5282-ca83cbb89593@redhat.com> Date: Tue, 11 Oct 2016 00:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <91e1cf79-06d8-0eff-a1a0-5665563f0054@vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00240.txt.bz2 On 10/06/2016 08:26 PM, Peter Bergner wrote: >> But if we could have a single generic command, that'd be of course better. >> It's worth it to think about how it'd work at the user-interface level, >> even if we don't make any other arch use it right away. > > I'm not sure what you mean by a generic command, A command that works for all architectures, like your original "set disassembler-cpu" seemingly would be (ignoring implementation details). Maybe "set disassembler-cpu" could be an alias for "set $current_arch disassembler-cpu". GDB would then only need to store a disassemble option string for each possible arch, and the alias would just need to map the current arch's cpu to the right option string variable. All the information to build this should be in opcodes, I think. Even for "help show disassembler-cpu", it should be possible for gdb to ask opcodes to print a description of each possible option, since "objdump --help" does it. Bonus points for hooking that to a completer for "set disassembler-cpu ". :-) BTW, AFAICS, objdump's -M isn't really only about "cpu". "objdump --help" on an --enable-targets=all build of binutils shows -M options that are not cpu options. "set disassembler-options" would probably be a better name for this. Thanks, Pedro Alves