From 60cfcb20ce8f95a6f71f68c51b295defa5d27032 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Thu, 11 Jul 2019 15:39:55 +0100 Subject: 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. --- gdb/stack.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gdb/stack.c') diff --git a/gdb/stack.c b/gdb/stack.c index 175f211..9b1d1a6 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -3423,18 +3423,20 @@ Print information about a stack frame selected by level.\n\ Usage: info frame level LEVEL"), &info_frame_cmd_list); - add_info ("locals", info_locals_command, - info_print_args_help (_("\ + cmd = add_info ("locals", info_locals_command, + info_print_args_help (_("\ All local variables of current stack frame or those matching REGEXPs.\n\ Usage: info locals [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\ Prints the local variables of the current stack frame.\n"), _("local variables"))); - add_info ("args", info_args_command, - info_print_args_help (_("\ + set_cmd_completer_handle_brkchars (cmd, info_print_command_completer); + cmd = add_info ("args", info_args_command, + info_print_args_help (_("\ All argument variables of current stack frame or those matching REGEXPs.\n\ Usage: info args [-q] [-t TYPEREGEXP] [NAMEREGEXP]\n\ Prints the argument variables of the current stack frame.\n"), _("argument variables"))); + set_cmd_completer_handle_brkchars (cmd, info_print_command_completer); if (dbx_commands) add_com ("func", class_stack, func_command, _("\ -- cgit v1.1