Add a way to invoke redefined (overridden) GDB commands

Philippe Waroquiers philippe.waroquiers@skynet.be
Mon Oct 19 18:47:04 GMT 2020


On Mon, 2020-10-19 at 19:05 +0100, Pedro Alves wrote:
> ISTM that (optional) quotes would be the natural thing here:
> 
>     (gdb) rename "foo bar" "baz"
>     (gdb) rename "foo" "bar baz"
> 
> I'd rather leave "--" for the typical splitting of options from
> other arguments.  Commands get that for free if they use
> the cli/cli-option.h framework.  So "--" would be used like in other
> commands, to unambiguously split options from commands that may
> start with "-", like:
Effectively better to keep -- to separate options from args.

For what concerns the rename, alias uses = to separate
the 2 commands:
  (gdb) h alias
  Define a new command that is an alias of an existing command.
  Usage: alias [-a] [--] ALIAS = COMMAND [DEFAULT-ARGS...]
  ...
So, maybe better/more consistent to use = similarly for rename.

I am wondering how rename will interact with alias:
alias are resolved at definition time, so a rename
following an alias might not have the expected effect.

Thanks

Philippe




More information about the Gdb-patches mailing list