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.
This commit is contained in:
parent
b16507e091
commit
60cfcb20ce
6 changed files with 64 additions and 11 deletions
|
@ -473,3 +473,20 @@ extract_info_print_options (info_print_options *opts,
|
|||
if (*args != nullptr && **args == '\0')
|
||||
*args = nullptr;
|
||||
}
|
||||
|
||||
/* See documentation in cli-utils.h. */
|
||||
|
||||
void
|
||||
info_print_command_completer (struct cmd_list_element *ignore,
|
||||
completion_tracker &tracker,
|
||||
const char *text, const char * /* word */)
|
||||
{
|
||||
const auto group
|
||||
= make_info_print_options_def_group (nullptr);
|
||||
if (gdb::option::complete_options
|
||||
(tracker, &text, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, group))
|
||||
return;
|
||||
|
||||
const char *word = advance_to_expression_complete_word_point (tracker, text);
|
||||
symbol_completer (ignore, tracker, text, word);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue