From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6003 invoked by alias); 5 Jun 2002 21:39:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5996 invoked from network); 5 Jun 2002 21:39:42 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 5 Jun 2002 21:39:42 -0000 Received: from theotherone.redhat-remotie.org (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id OAA14497 for ; Wed, 5 Jun 2002 14:39:41 -0700 (PDT) Received: from localhost (localhost.fidalgo.net [127.0.0.1]) by theotherone.redhat-remotie.org (Postfix) with ESMTP id 4BFB8BB47D; Wed, 5 Jun 2002 14:39:44 -0700 (PDT) Date: Wed, 05 Jun 2002 14:39:00 -0000 From: Don Howard X-X-Sender: To: Eli Zaretskii Cc: Subject: Re: Redefining built-in commands. In-Reply-To: <3995-Fri31May2002102222+0300-eliz@is.elta.co.il> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-06/txt/msg00054.txt.bz2 On Fri, 31 May 2002, Eli Zaretskii wrote: > > Date: Thu, 30 May 2002 17:24:05 -0700 (PDT) > > From: Don Howard > > > > Should gdb allow users to redefine built-in commands? > > I think it should, unless we cannot do it safely. > > > If so, should the > > orignial alias continue to behave like the original built-in, or should > > it's behavior be modified also? > > I'm not 100% sure, but I tend to think the aliases that are mere > abbreviations, like `n' for `next', should be redefined to the new > command, while aliases which aren't abbreviations should be left to > point to the original command. > > But if the above cannot be done, we should either redefine the aliases > to the new command, or disable the aliases entirely. Crashing is not > an option, obviously. > Ignoring the alias issue, I don't see any benefit to being able to redefine built-in commands. When a built-in command is redefined, it's original functionality is lost for the remainder of that debugging session. For example, say the user redefines the 'step' command -- there is no longer a way to do source-level stepping. (gdb) define step > do something special > step > end (gdb) The above example ends up "doing something special" until gdb hits it's recursion limit, rather than doing something special and then stepping. The example *does* work just fine if the user picks anything other than a built-in name: (gdb) define special_step > do something special > step > end (gdb) I think the ability to redefine built-in commands is a misfeature. Users can always choose an alternate name for their custom commands. -- dhoward@redhat.com gdb engineering