]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
gdb: don't warn about deprecated aliases during tab completion
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 8 Dec 2020 17:32:34 +0000 (17:32 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 11 Dec 2020 22:10:50 +0000 (22:10 +0000)
commit1536146f30900b77c8381930669532f4073df196
tree5d743ff450de62eb026bb9dbb99ffe4dc2abee14
parent966484941738b7a474fb7e4fe29eb5693fc9096c
gdb: don't warn about deprecated aliases during tab completion

Consider this gdb session, where on line #3 tab completion is used:

  (gdb) alias xxx_yyy_zzz=break
  (gdb) maint deprecate xxx_yyy_zzz
  (gdb) xxx_yyy_<TAB>

The third line then updates to look like this:

  (gdb) xxx_yyy_Warning: 'xxx_yyy_zzz', an alias for the command 'break' is deprecated.
  No alternative known.

  zzz

What's happened is during tab completion the alias has been resolved
to the actual command being aliased, and at this stage the warning is
issued.  Clearly this is not what we want during tab completion.

In this commit I add a new parameter to the lookup function, a boolean
that indicates if the lookup is being done as part of completion.
This flag is used to suppress the warning.  Now we get the expected
behaviour, the alias completes without any warning, but the warning is
still given once the user executes the alias.

gdb/ChangeLog:

* cli/cli-decode.c (lookup_cmd_1): Move header comment into
command.h, add extra parameter, and use this to guard giving a
warning.
* command.h (lookup_cmd_1): Add comment from cli/cli-decode.c,
include argument names in declaration, add new argument.
* completer.c (complete_line_internal_1): Remove unneeded
brackets, pass extra argument to lookup_cmd_1.

gdb/testsuite/ChangeLog:

* gdb.base/completion.exp: Add additional tests.
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/command.h
gdb/completer.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/completion.exp