aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-utils.h
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-07-11 15:39:55 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-07-11 20:19:24 +0100
commit60cfcb20ce8f95a6f71f68c51b295defa5d27032 (patch)
tree2037083f33150d7dc6e6d3be5ae62047d4c7d235 /gdb/cli/cli-utils.h
parentb16507e0917169555f8bbfcb1d6c9685813ccf6c (diff)
downloadgdb-60cfcb20ce8f95a6f71f68c51b295defa5d27032.zip
gdb-60cfcb20ce8f95a6f71f68c51b295defa5d27032.tar.gz
gdb-60cfcb20ce8f95a6f71f68c51b295defa5d27032.tar.bz2
gdb: Add command completers for some info commands
Add command completion for info variables, functions, args, and locals. This completer only completes the command line options as these commands all take a regexp which GDB can't really offer completions for. gdb/ChangeLog: * cli/cli-utils.c (info_print_command_completer): New function. * cli/cli-utils.h: Add 'completer.h' include, and forward declaration for 'struct cmd_list_element'. (info_print_command_completer): Declare. * stack.c (_initialize_stack): Add completer for 'info locals' and 'info args'. * symtab.c (_initialize_symtab): Add completer for 'info variables' and 'info functions'. * NEWS: Mention completion for additional info commands.
Diffstat (limited to 'gdb/cli/cli-utils.h')
-rw-r--r--gdb/cli/cli-utils.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/cli/cli-utils.h b/gdb/cli/cli-utils.h
index a3826be..17cdd84 100644
--- a/gdb/cli/cli-utils.h
+++ b/gdb/cli/cli-utils.h
@@ -20,6 +20,10 @@
#ifndef CLI_CLI_UTILS_H
#define CLI_CLI_UTILS_H
+#include "completer.h"
+
+struct cmd_list_element;
+
/* *PP is a string denoting a number. Get the number. Advance *PP
after the string and any trailing whitespace.
@@ -66,6 +70,15 @@ struct info_print_options
extern void extract_info_print_options (info_print_options *opts,
const char **args);
+/* Function that can be used as a command completer for 'info variable'
+ and friends. This offers command option completion as well as symbol
+ completion. At the moment all symbols are offered for all commands. */
+
+extern void info_print_command_completer (struct cmd_list_element *ignore,
+ completion_tracker &tracker,
+ const char *text,
+ const char * /* word */);
+
/* Throws an error telling the user that ARGS starts with an option
unrecognized by COMMAND. */