From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13889 invoked by alias); 13 Sep 2011 18:49:03 -0000 Received: (qmail 13881 invoked by uid 22791); 13 Sep 2011 18:49:02 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Sep 2011 18:48:48 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id p8DImlmm021016 for ; Tue, 13 Sep 2011 11:48:47 -0700 Received: from qyk30 (qyk30.prod.google.com [10.241.83.158]) by wpaz13.hot.corp.google.com with ESMTP id p8DImR56026415 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 13 Sep 2011 11:48:46 -0700 Received: by qyk30 with SMTP id 30so2956600qyk.12 for ; Tue, 13 Sep 2011 11:48:46 -0700 (PDT) Received: by 10.224.211.3 with SMTP id gm3mr4906130qab.111.1315939725952; Tue, 13 Sep 2011 11:48:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.211.3 with SMTP id gm3mr4906123qab.111.1315939725754; Tue, 13 Sep 2011 11:48:45 -0700 (PDT) Received: by 10.224.80.201 with HTTP; Tue, 13 Sep 2011 11:48:45 -0700 (PDT) In-Reply-To: <201109131839.49816.pedro@codesourcery.com> References: <20110909183636.444932461B1@ruffy.mtv.corp.google.com> <834o0l5sic.fsf@gnu.org> <201109131839.49816.pedro@codesourcery.com> Date: Tue, 13 Sep 2011 19:15:00 -0000 Message-ID: Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org, Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-09/txt/msg00220.txt.bz2 On Tue, Sep 13, 2011 at 10:39 AM, Pedro Alves wrot= e: > On Tuesday 13 September 2011 18:20:16, Doug Evans wrote: >> On Fri, Sep 9, 2011 at 2:13 PM, Eli Zaretskii wrote: >> >> Date: Fri, =A09 Sep 2011 11:36:36 -0700 (PDT) >> >> From: dje@google.com (Doug Evans) >> >> >> >> Per discussion on IRC, here is a patch to add support for adding >> >> command aliases. >> > >> > I wish people would discuss such issues here, not on IRC. =A0These >> > discussions should be recorded, for one thing. >> >> Whatever additional discussion one wants to have we can have here. >> No worries. >> >> > Me, I don't understand the need for this feature, especially not why >> > it should be a Python-only feature. =A0Moreover, why do we need to have >> > this, when one can easily write a command that just calls an existing >> > one, to have the same effect. > > IMO, since this is really about aliasing new CLI spellings for > existing CLI commands, it'd make sense to have a way to alias commands > in the CLI, without python. =A0E.g., > > (gdb) alias isl info shared library > (gdb) isl > > > Python could then of course just do gdb.execute("alias ..."). [s/shared library/sharedlibrary/ It's not clear how general you intended this to be. E.g., handle an arbitrary number of prefixes?] If the intent is to handle an arbitrary number of prefixes then that's a different kind of alias than how gdb uses the word today. E.g. (gdb) alias spe set print elements (gdb) spe 20 # set print elements =3D 20 That's fine, just checking ... IWBN to add aliases from the CLI for anything, (e.g., grep for add_alias_cmd in mips-tdep.c, sheesh!) but that will require a bit more syntax. One would need to distinguish aliasing "spe" --> "set print elements" from "set print foobars" --> "set print elements".