public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCH 1/3] gdb/record: remove unnecessary use of filename_completer
Date: Mon, 15 Apr 2024 15:19:26 +0100	[thread overview]
Message-ID: <754ab2b77ccc626c0d9684fced83bfd514a5b836.1713190701.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1713190701.git.aburgess@redhat.com>

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'.
---
 gdb/record.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gdb/record.c b/gdb/record.c
index 1843969c2c9..25a4c1e71b6 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -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
-- 
2.25.4


  reply	other threads:[~2024-04-15 14:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 14:19 [PATCH 0/3] Small cleanups in gdb/record*.c code Andrew Burgess
2024-04-15 14:19 ` Andrew Burgess [this message]
2024-04-15 14:19 ` [PATCH 2/3] gdb/record: add an assert in cmd_record_start Andrew Burgess
2024-04-15 14:19 ` [PATCH 3/3] gdb/record: minor clean, remove some unneeded arguments Andrew Burgess
2024-04-15 14:41   ` Eli Zaretskii
2024-04-16 14:12   ` Keith Seitz
2024-04-16 17:18 ` [PATCH 0/3] Small cleanups in gdb/record*.c code Tom Tromey
2024-04-17 13:48   ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=754ab2b77ccc626c0d9684fced83bfd514a5b836.1713190701.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).