Rename make_symbol_completion_list_fn -> symbol_completer
authorPedro Alves <palves@redhat.com>
Mon, 17 Jul 2017 10:55:42 +0000 (11:55 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 17 Jul 2017 10:55:42 +0000 (11:55 +0100)
"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.

gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/completer.c
gdb/completer.h
gdb/guile/scm-cmd.c
gdb/python/py-cmd.c
gdb/symtab.c
gdb/symtab.h

index 8b37cda6b471362867acf67b1468367d3876cd99..3e41709f8ae5c29aa6396583fb60183f1e28231a 100644 (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.
index 383adf8b1ac496a4ddb248265d294b8099afcacc..0a78f4e5a8e866f374b908cf0c64dc785037132d 100644 (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;
index 68e68eb8d68c0fae85eacc86d37a80a6518675ea..89cecbc9a8ba9c5ce08a3bec09a76bd66ba5800f 100644 (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.
index 2aa1987f303e31313bac4f56a254fe7bfcd62a0d..0a40eaa5025542e3b753d483a64b870f6953520e 100644 (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 *);
 
index ae5d14599dbea5207d2557b608bad2d7b5929ac9..0c6419d9d04768a5f0b0c1870127ad8127af33f7 100644 (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 },
 };
 
index 62032115b0c7963d0b190b15c220b5a2fa662754..72ea577081826fb13a7c3fcc8b9fa9496081c2e7 100644 (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 },
 };
 
index 44809aeaff52983a15b76ff2dd53a875e5f02794..e5cd397f6ca434ee842c75b644c1a0a4fda250d4 100644 (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.  */
 
index 30d7eeeb8434ffe7ef2ee2ffc1cccf663a92705a..5261a6940c955f2d3ceaef0f7c131c519e13eea2 100644 (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 *,