aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2017-09-22 17:00:33 -0300
committerAlexandre Oliva <aoliva@redhat.com>2017-09-22 17:00:33 -0300
commit9e0703de64a6dd4deae2ebd569955f14337f2710 (patch)
treecec45139f1febef6441deabae142c3fb3f2c61f3 /gdb/command.h
parent13b9f79a1904081d984a64037af6457c1e3ff7b6 (diff)
parent43573013c9836f2b91b74b9b29dac35fdb41e06b (diff)
downloadgdb-9e0703de64a6dd4deae2ebd569955f14337f2710.zip
gdb-9e0703de64a6dd4deae2ebd569955f14337f2710.tar.gz
gdb-9e0703de64a6dd4deae2ebd569955f14337f2710.tar.bz2
Merge remote-tracking branch 'remotes/master' into users/aoliva/SFN
Updated local changes to binutils/testsuite/binutils-all/readelf.exp to match the unresolved (failed to assemble) messages introduced by Alan Modra.
Diffstat (limited to 'gdb/command.h')
-rw-r--r--gdb/command.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/gdb/command.h b/gdb/command.h
index 4a56a51..3a4a449 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -21,6 +21,8 @@
#include "gdb_vecs.h"
#include "common/scoped_restore.h"
+struct completion_tracker;
+
/* This file defines the public interface for any code wanting to
create commands. */
@@ -174,18 +176,30 @@ typedef void cmd_sfunc_ftype (char *args, int from_tty,
extern void set_cmd_sfunc (struct cmd_list_element *cmd,
cmd_sfunc_ftype *sfunc);
-typedef VEC (char_ptr) *completer_ftype (struct cmd_list_element *,
- const char *, const char *);
+/* A completion routine. Add possible completions to tracker.
+
+ TEXT is the text beyond what was matched for the command itself
+ (leading whitespace is skipped). It stops where we are supposed to
+ stop completing (rl_point) and is '\0' terminated. WORD points in
+ the same buffer as TEXT, and completions should be returned
+ relative to this position. For example, suppose TEXT is "foo" and
+ we want to complete to "foobar". If WORD is "oo", return "oobar";
+ if WORD is "baz/foo", return "baz/foobar". */
+typedef void completer_ftype (struct cmd_list_element *,
+ completion_tracker &tracker,
+ const char *text, const char *word);
-typedef void completer_ftype_void (struct cmd_list_element *,
- const char *, const char *);
+/* Same, but for set_cmd_completer_handle_brkchars. */
+typedef void completer_handle_brkchars_ftype (struct cmd_list_element *,
+ completion_tracker &tracker,
+ const char *text, const char *word);
extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *);
/* Set the completer_handle_brkchars callback. */
extern void set_cmd_completer_handle_brkchars (struct cmd_list_element *,
- completer_ftype_void *);
+ completer_handle_brkchars_ftype *);
/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
around in cmd objects to test the value of the commands sfunc(). */
@@ -249,11 +263,13 @@ extern struct cmd_list_element *add_info (const char *,
extern struct cmd_list_element *add_info_alias (const char *, const char *,
int);
-extern VEC (char_ptr) *complete_on_cmdlist (struct cmd_list_element *,
- const char *, const char *, int);
+extern void complete_on_cmdlist (struct cmd_list_element *,
+ completion_tracker &tracker,
+ const char *, const char *, int);
-extern VEC (char_ptr) *complete_on_enum (const char *const *enumlist,
- const char *, const char *);
+extern void complete_on_enum (completion_tracker &tracker,
+ const char *const *enumlist,
+ const char *, const char *);
/* Functions that implement commands about CLI commands. */