From: Don Howard <dhoward@redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: <gdb@sources.redhat.com>
Subject: Re: Redefining built-in commands.
Date: Wed, 05 Jun 2002 14:39:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.33.0206051412080.3324-100000@theotherone> (raw)
In-Reply-To: <3995-Fri31May2002102222+0300-eliz@is.elta.co.il>
On Fri, 31 May 2002, Eli Zaretskii wrote:
> > Date: Thu, 30 May 2002 17:24:05 -0700 (PDT)
> > From: Don Howard <dhoward@redhat.com>
> >
> > 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
next prev parent reply other threads:[~2002-06-05 21:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-30 17:23 Don Howard
2002-05-30 17:37 ` Don Howard
2002-05-31 0:29 ` Eli Zaretskii
2002-06-05 14:39 ` Don Howard [this message]
2002-06-10 9:23 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.33.0206051412080.3324-100000@theotherone \
--to=dhoward@redhat.com \
--cc=eliz@is.elta.co.il \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox