diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2020-05-05 21:38:38 +0200 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2020-05-15 22:17:45 +0200 |
commit | 0605465feb51d7a8552db8019c5cfc8a5fc22c3f (patch) | |
tree | 04ab765e122b7c1b032898d9d4ec721069b1cb11 /gdb/cli/cli-cmds.h | |
parent | 58e6ac70065131e82e0256f571e5277553096051 (diff) | |
download | gdb-0605465feb51d7a8552db8019c5cfc8a5fc22c3f.zip gdb-0605465feb51d7a8552db8019c5cfc8a5fc22c3f.tar.gz gdb-0605465feb51d7a8552db8019c5cfc8a5fc22c3f.tar.bz2 |
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.
Diffstat (limited to 'gdb/cli/cli-cmds.h')
0 files changed, 0 insertions, 0 deletions