From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: [RFA] Completion of add-inferior
Date: Fri, 11 May 2012 17:51:00 -0000 [thread overview]
Message-ID: <83pqaay5b3.fsf@gnu.org> (raw)
I'm a completion junkie, so this pisses me off:
(gdb) add-inferior -exec oo/i TAB
Display all 355 possibilities? (y or n) n
(gdb) add-inferior -exec TAB
Display all 25806 possibilities? (y or n) n
(gdb) add-inferior -exec d:/gnu TAB TAB
gnutls_alert_description_t
gnutls_alloc_function
gnutls_anon_client_credentials_t
gnutls_certificate_client_credentials
...
(it completes on symbols).
OK to commit the following?
2012-05-11 Eli Zaretskii <eliz@gnu.org>
* inferior.c: Include completer.h
(initialize_inferiors): Set completer of add-inferior to
filename_completer.
--- gdb/inferior.c~0 2012-01-06 06:43:16.000000000 +0200
+++ gdb/inferior.c 2012-05-11 20:44:23.218048400 +0300
@@ -22,6 +22,7 @@
#include "inferior.h"
#include "target.h"
#include "command.h"
+#include "completer.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "ui-out.h"
@@ -1065,6 +1066,8 @@ inferior_data (struct inferior *inf, con
void
initialize_inferiors (void)
{
+ struct cmd_list_element *c = NULL;
+
/* There's always one inferior. Note that this function isn't an
automatic _initialize_foo function, since other _initialize_foo
routines may need to install their per-inferior data keys. We
@@ -1078,12 +1081,13 @@ initialize_inferiors (void)
add_info ("inferiors", info_inferiors_command,
_("IDs of specified inferiors (all inferiors if no argument)."));
- add_com ("add-inferior", no_class, add_inferior_command, _("\
+ c = add_com ("add-inferior", no_class, add_inferior_command, _("\
Add a new inferior.\n\
Usage: add-inferior [-copies <N>] [-exec <FILENAME>]\n\
N is the optional number of inferiors to add, default is 1.\n\
FILENAME is the file name of the executable to use\n\
as main program."));
+ set_cmd_completer (c, filename_completer);
add_com ("remove-inferiors", no_class, remove_inferior_command, _("\
Remove inferior ID (or list of IDs).\n\
next reply other threads:[~2012-05-11 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 17:51 Eli Zaretskii [this message]
2012-05-11 20:21 ` Tom Tromey
2012-05-11 20:55 ` Eli Zaretskii
2012-05-11 20:58 ` Tom Tromey
2012-05-12 6:36 ` Eli Zaretskii
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=83pqaay5b3.fsf@gnu.org \
--to=eliz@gnu.org \
--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