]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/record: remove unnecessary use of filename_completer
authorAndrew Burgess <aburgess@redhat.com>
Mon, 15 Apr 2024 12:48:34 +0000 (13:48 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 17 Apr 2024 12:34:29 +0000 (13:34 +0100)
Spotted that the 'record' command has its completer set to
filename_completer.  The problem is that 'record' is a prefix command,
as such, its completer is hard-coded to complete on sub-commands.  The
attempt to use filename_completer is irrelevant.

The 'record' command is itself a command though, that is, a user can
do this:

  (gdb) record

which is really just an alias for:

  (gdb) target record-full

Nowhere does cmd_record_start (which is called when 'record' is used)
expect a filename, and 'target record-full' doesn't expect a filename
either.

So lets just drop the line which sets filename_completer as the
completer for 'record'.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/record.c

index 1843969c2c9bb045f7b2127a519a6fda3e07bc39..25a4c1e71b619bb45a2f91afc49f18063cf83627 100644 (file)
@@ -791,8 +791,6 @@ A size of \"unlimited\" means unlimited lines.  The default is 10."),
     = add_prefix_cmd ("record", class_obscure, cmd_record_start,
                      _("Start recording."),
                      &record_cmdlist, 0, &cmdlist);
-  set_cmd_completer (record_cmd, filename_completer);
-
   add_com_alias ("rec", record_cmd, class_obscure, 1);
 
   set_show_commands setshow_record_cmds