diff options
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/cli/cli-decode.c | 2 | ||||
-rw-r--r-- | gdb/completer.c | 9 | ||||
-rw-r--r-- | gdb/completer.h | 3 | ||||
-rw-r--r-- | gdb/guile/scm-cmd.c | 2 | ||||
-rw-r--r-- | gdb/python/py-cmd.c | 2 | ||||
-rw-r--r-- | gdb/symtab.c | 10 | ||||
-rw-r--r-- | gdb/symtab.h | 3 |
8 files changed, 26 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8b37cda..3e41709 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 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. * dwarf2read.c: Include "filename-seen-cache.h". * dwarf2read.c (dwarf2_per_objfile) <filenames_cache>: New field. diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 383adf8..0a78f4e 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -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; diff --git a/gdb/completer.c b/gdb/completer.c index 68e68eb..89cecbc 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -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. diff --git a/gdb/completer.h b/gdb/completer.h index 2aa1987..0a40eaa 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -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 *); diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c index ae5d145..0c6419d 100644 --- a/gdb/guile/scm-cmd.c +++ b/gdb/guile/scm-cmd.c @@ -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 }, }; diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 6203211..72ea577 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -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 }, }; diff --git a/gdb/symtab.c b/gdb/symtab.c index 44809ae..e5cd397 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -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. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index 30d7eee..5261a69 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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 *, |