From: Pedro Alves <pedro@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [RFA, doc RFA] Add gdb.add_command_alias
Date: Tue, 13 Sep 2011 19:32:00 -0000 [thread overview]
Message-ID: <201109132015.04463.pedro@codesourcery.com> (raw)
In-Reply-To: <CADPb22QyEZ__rx5-svwh4EErtJkSgrqUhM2ODGvrGdr9kM+coQ@mail.gmail.com>
On Tuesday 13 September 2011 19:48:45, Doug Evans wrote:
> On Tue, Sep 13, 2011 at 10:39 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> > 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. E.g.,
> >
> > (gdb) alias isl info shared library
> > (gdb) isl
> > <list shared libraries>
> >
> > 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.
I was just throwing out the idea. Hadn't though much on
such details. :-)
>
> 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.
Hmm, you mean prefixes on the alias name? Cause
we have aliases that expand to prefixed commands:
infcmd.c:2797: add_com_alias ("tty", "set inferior-tty", class_alias, 0);
> E.g.
> (gdb) alias spe set print elements
> (gdb) spe 20 # set print elements = 20
Right.
> 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!)
Hmm, what's the advantage of add_alias_cmd over add_com_alias
(or vice versa)? Are these really two use cases from the user's
perpective, or just two ways to end up with the same thing?
> 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".
Ah, right, yes, of course. That sounds useful. Irrespective
of what we do know, do you think it _shouldn't_ work?
Maybe it's useful.
E.g., `alias -f FROM -t TO' would work for me. E.g.,
(gdb) alias -f "set print foobars" -t "set print elements"
The command would fail if "set" or "set print" in FROM
don't exist, or TO doesn't exist. But if that's hard,
we can just not support it (yet at least), as long as
we leave the door open in terms of syntax.
--
Pedro Alves
next prev parent reply other threads:[~2011-09-13 19:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 19:25 Doug Evans
2011-09-09 21:15 ` Eli Zaretskii
2011-09-13 17:40 ` Doug Evans
2011-09-13 17:47 ` Pedro Alves
2011-09-13 19:15 ` Doug Evans
2011-09-13 19:32 ` Pedro Alves [this message]
2011-09-13 21:42 ` Doug Evans
2011-09-21 21:46 ` Doug Evans
2011-09-22 14:08 ` Pedro Alves
2011-09-22 17:45 ` Doug Evans
2011-09-22 18:13 ` Eli Zaretskii
2011-09-22 21:48 ` Doug Evans
2011-09-23 11:40 ` Eli Zaretskii
2011-09-13 18:49 ` Pedro Alves
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=201109132015.04463.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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