]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
Fix problem that alias can be defined or not depending on the order.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Tue, 5 May 2020 19:38:38 +0000 (21:38 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 15 May 2020 20:17:45 +0000 (22:17 +0200)
commit0605465feb51d7a8552db8019c5cfc8a5fc22c3f
tree04ab765e122b7c1b032898d9d4ec721069b1cb11
parent58e6ac70065131e82e0256f571e5277553096051
Fix problem that alias can be defined or not depending on the order.

When an alias name starts with the name of another alias,
GDB was accepting to define the aliases in one order (short first, long after),
but refused it the other way around.

So, fix the logic to recognise an already existing alias by using
lookup_cmd_composition.

Also, this revealed a bug in lookup_cmd_composition:
when the searched command is a prefix command, lookup_cmd_composition
was not returning the fact that a command was found even if the
TEXT to parse was fully consumed.

gdb/ChangeLog
YYYY-MM-DD  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* cli/cli-cmds.c (alias_command): Check for an existing alias
using lookup_cmd_composition, as valid_command_p is too strict
and forbids aliases that are the prefix of an existing alias
or command.
* cli/cli-decode.c (lookup_cmd_composition): Ensure a prefix
command is properly recognised as a valid command.

gdb/testsuite/ChangeLog
2020-05-15  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.base/alias.exp: Test aliases starting with a prefix of
another alias.
gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/cli/cli-decode.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/alias.exp