Rename make_symbol_completion_list_fn -> symbol_completer

"make_symbol_completion_list_fn" is odly named when you look at a list
of "standard" completers, like the Python/Guile completer lists
adjusted by this patch.  Rename / move it to completers.h/c, for
consistency.

gdb/ChangeLog:
2017-07-17  Pedro Alves  <palves@redhat.com>

	* completer.c (symbol_completer): New function, based on
	make_symbol_completion_list_fn.
	* completer.h (symbol_completer): New declaration.
	* guile/scm-cmd.c (cmdscm_completers): Adjust.
	* python/py-cmd.c (completers): Adjust.
	* symtab.c (make_symbol_completion_list_fn): Delete.
	* symtab.h (make_symbol_completion_list_fn): Delete.
	* cli/cli-decode.c (add_cmd): Adjust.
This commit is contained in:
Pedro Alves 2017-07-17 11:55:42 +01:00
parent bbf2f4dfae
commit 78b13106ed
8 changed files with 26 additions and 16 deletions

View File

@ -1,3 +1,14 @@
2017-07-17 Pedro Alves <palves@redhat.com>
* completer.c (symbol_completer): New function, based on
make_symbol_completion_list_fn.
* completer.h (symbol_completer): New declaration.
* guile/scm-cmd.c (cmdscm_completers): Adjust.
* python/py-cmd.c (completers): Adjust.
* symtab.c (make_symbol_completion_list_fn): Delete.
* symtab.h (make_symbol_completion_list_fn): Delete.
* cli/cli-decode.c (add_cmd): Adjust.
2017-07-17 Pedro Alves <palves@redhat.com>
* Makefile.in (COMMON_OBS): Add filename-seen-cache.o.

View File

@ -244,7 +244,7 @@ add_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun,
c->allow_unknown = 0;
c->prefix = NULL;
c->abbrev_flag = 0;
set_cmd_completer (c, make_symbol_completion_list_fn);
set_cmd_completer (c, symbol_completer);
c->completer_handle_brkchars = NULL;
c->destroyer = NULL;
c->type = not_set_cmd;

View File

@ -663,6 +663,15 @@ set_gdb_completion_word_break_characters (completer_ftype *fn)
set_rl_completer_word_break_characters (break_chars);
}
/* Complete on symbols. */
VEC (char_ptr) *
symbol_completer (struct cmd_list_element *ignore,
const char *text, const char *word)
{
return make_symbol_completion_list (text, word);
}
/* Here are some useful test cases for completion. FIXME: These
should be put in the test suite. They should be tested with both
M-? and TAB.

View File

@ -87,6 +87,9 @@ extern VEC (char_ptr) *expression_completer (struct cmd_list_element *,
extern VEC (char_ptr) *location_completer (struct cmd_list_element *,
const char *, const char *);
extern VEC (char_ptr) *symbol_completer (struct cmd_list_element *,
const char *, const char *);
extern VEC (char_ptr) *command_completer (struct cmd_list_element *,
const char *, const char *);

View File

@ -114,7 +114,7 @@ static const struct cmdscm_completer cmdscm_completers[] =
{ "COMPLETE_FILENAME", filename_completer },
{ "COMPLETE_LOCATION", location_completer },
{ "COMPLETE_COMMAND", command_completer },
{ "COMPLETE_SYMBOL", make_symbol_completion_list_fn },
{ "COMPLETE_SYMBOL", symbol_completer },
{ "COMPLETE_EXPRESSION", expression_completer },
};

View File

@ -44,7 +44,7 @@ static const struct cmdpy_completer completers[] =
{ "COMPLETE_FILENAME", filename_completer },
{ "COMPLETE_LOCATION", location_completer },
{ "COMPLETE_COMMAND", command_completer },
{ "COMPLETE_SYMBOL", make_symbol_completion_list_fn },
{ "COMPLETE_SYMBOL", symbol_completer },
{ "COMPLETE_EXPRESSION", expression_completer },
};

View File

@ -5299,16 +5299,6 @@ make_symbol_completion_type (const char *text, const char *word,
return current_language->la_make_symbol_completion_list (text, word, code);
}
/* Like make_symbol_completion_list, but suitable for use as a
completion function. */
VEC (char_ptr) *
make_symbol_completion_list_fn (struct cmd_list_element *ignore,
const char *text, const char *word)
{
return make_symbol_completion_list (text, word);
}
/* Like make_symbol_completion_list, but returns a list of symbols
defined in all source files name SRCFILE. */

View File

@ -1507,9 +1507,6 @@ extern VEC (char_ptr) *default_make_symbol_completion_list (const char *,
extern VEC (char_ptr) *make_symbol_completion_list (const char *, const char *);
extern VEC (char_ptr) *make_symbol_completion_type (const char *, const char *,
enum type_code);
extern VEC (char_ptr) *make_symbol_completion_list_fn (struct cmd_list_element *,
const char *,
const char *);
extern VEC (char_ptr) *make_file_symbol_completion_list (const char *,
const char *,