From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA v2/code+DOCO+NEWS] new "set/show serial baud" command
Date: Wed, 09 Oct 2013 16:17:00 -0000 [thread overview]
Message-ID: <5255819D.1080802@redhat.com> (raw)
In-Reply-To: <20131009112334.GJ3092@adacore.com>
On 10/09/2013 12:23 PM, Joel Brobecker wrote:
> Unfortunately, I hit a limitation when trying to deprecate the alias,
> and my guess is because the command is prefixed. I had a quick look,
> and basically, I think "lookup_cmd_1" recurses into himself by first
> finding the prefixed command, then does the recursion by trying to
> find the rest of the command within that prefix. It finds the command
> and notices the fact that it is deprecated, and even tries to warn
> the user by calling deprecated_cmd_warning. But this function only
> takes the deprecated command names, and the name it passes is lacking
> the prefix (due to the recursion). As a result, deprecated_cmd_warning
> fails to find the aliased command and returns immediately:
>
> if (!lookup_cmd_composition (text, &alias, &prefix_cmd, &cmd))
> /* Return if text doesn't evaluate to a command. */
> return;
>
Bummer.
> Lifting that limitation would take a little bit more time than I have,
> so I went with the sort of trick as the one used in remote.c, which
> is to duplicate the command.
Oh well. That's fine with me.
> Not pretty, but as the FIXME says, it's
> temporary (I've already added a TODO item in the GDB 7.8 release
> management wiki page).
...
> + /* FIXME: There is a limitation in the deprecation mechanism,
> + and the warning ends up not being displayed for prefixed
> + aliases. So use a real command instead of an alias.
> + This is temporary code anyway, so should go away soon
> + after the next release cycle starts. */
I actually think that "temporary anyway" comment should be removed. We
don't really have a habit of removing deprecated commands. Marking a
command deprecated already makes it less visible. E.g., it removes the
command from completion suggestions. As long as the old command doesn't
get in the way, there's really no pressing need to remove it.
"soon after the next release" has itself a tendency to get
old and outdated :-)
> This patch implements that change, as well as updates the GDB Manual.
> For now, it's a straight search-and-replace, as there was no real
> section where the option could go. Eventually, I think we will want
> to dissociate the options relative to the remote protocol, from the
> options specific to serial line handling. I think other option names
> might need to be renamed as well, but this I've already far exceeded
> the amount of time I could spend on this.
>
> gdb/ChangeLog:
>
> * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
> serial_baud_show_cmd.
> (_initialize_cli_cmds): Delete the code creating the
> "set/show remotebaud" commands.
> * serial.c (baud_rate): Move here from top.c.
> (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
> (_initialize_serial): Create "set/show serial baud" commands.
> Add "set/show remotebaud" command aliases.
> * top.c (baud_rate): Moved to serial.c.
> * NEWS: Document the new "set/show serial baud" commands,
> replacing "set/show remotebaud".
>
> gdb/doc/ChangeLog:
>
> * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
> by "set serial baud" and "show serial baud" (resp) throughout.
>
> I hope it's a sufficient improvement in itself. OK to apply?
This is fine with me.
--
Pedro Alves
next prev parent reply other threads:[~2013-10-09 16:17 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-10 15:18 Setting parity for remote serial Yurij Grechishhev
2013-07-10 18:10 ` Tom Tromey
[not found] ` <524ECCBB.5050307@gmail.com>
2013-10-07 18:33 ` Yurij Grechishhev
2013-10-08 3:56 ` Joel Brobecker
2013-10-08 12:03 ` Pedro Alves
2013-10-08 14:16 ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Joel Brobecker
2013-10-08 14:34 ` [RFA/code+NEWS] new "set/show serial baud" command Pedro Alves
2013-10-08 15:00 ` Joel Brobecker
2013-10-08 15:12 ` Tom Tromey
2013-10-09 11:23 ` [RFA v2/code+DOCO+NEWS] " Joel Brobecker
2013-10-09 16:17 ` Pedro Alves [this message]
2013-10-10 5:55 ` checked in: " Joel Brobecker
2013-10-09 16:44 ` Eli Zaretskii
2013-10-10 5:59 ` Joel Brobecker
2013-10-10 16:06 ` Eli Zaretskii
2013-10-11 4:51 ` Joel Brobecker
2013-10-11 7:02 ` Eli Zaretskii
2013-10-08 15:24 ` [RFA/code+NEWS] new "set/show serial baud" command (was: "Re: Setting parity for remote serial") Eli Zaretskii
2013-10-09 2:05 ` Doug Evans
2013-10-09 3:57 ` Joel Brobecker
2013-10-09 8:31 ` [RFA/code+NEWS] new "set/show serial baud" command 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=5255819D.1080802@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--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