diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-02-05 22:17:41 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-02-05 22:17:41 +0000 |
commit | 41d27058f2a51665c78726b4a13510fcfc7db007 (patch) | |
tree | cdb0c24e4d0af929e86276b5e1cbcf5aaa16344f /gdb/symtab.c | |
parent | 2276bc20896a6f94f7061327e59032cfceb8ef08 (diff) | |
download | gdb-41d27058f2a51665c78726b4a13510fcfc7db007.zip gdb-41d27058f2a51665c78726b4a13510fcfc7db007.tar.gz gdb-41d27058f2a51665c78726b4a13510fcfc7db007.tar.bz2 |
* language.h (struct language_defn): Add new field
la_make_symbol_completion_list.
* symtab.c (default_make_symbol_completion_list): Renames
make_symbol_completion_list.
(make_symbol_completion_list): New function.
* symtab.h (default_make_symbol_completion_list): Add declaration.
* langauge.c (unknown_language): Set la_make_symbol_completion_list.
(auto_language, local_language): Likewise.
* objc-lang.c (objc_language_defn): Likewise.
* scm-lang.c (scm_language_defn): Likewise.
* m2-lang.c (m2_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* jv-lang.c (java_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn)
(minimal_language_defn): Likewise.
* ada-lang.c (struct string_vector): New structure.
(new_string_vector, string_vector_append, ada_unqualified_name)
(add_angle_brackets, symbol_completion_match, symbol_completion_add)
(ada_make_symbol_completion_list): New functions.
(ada_language_defn): Set la_make_symbol_completion_list.
* ada-lang.h (ada_make_symbol_completion_list): Remove declaration,
this function is static.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 3912ebd..40e31dc 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3523,17 +3523,13 @@ language_search_unquoted_string (char *text, char *p) return p; } - -/* Return a NULL terminated array of all symbols (regardless of class) - which begin by matching TEXT. If the answer is no symbols, then - the return value is an array which contains only a NULL pointer. - - Problem: All of the symbols have to be copied because readline frees them. - I'm not going to worry about this; hopefully there won't be that many. */ - char ** -make_symbol_completion_list (char *text, char *word) +default_make_symbol_completion_list (char *text, char *word) { + /* Problem: All of the symbols have to be copied because readline + frees them. I'm not going to worry about this; hopefully there + won't be that many. */ + struct symbol *sym; struct symtab *s; struct partial_symtab *ps; @@ -3548,8 +3544,7 @@ make_symbol_completion_list (char *text, char *word) /* Length of sym_text. */ int sym_text_len; - /* Now look for the symbol we are supposed to complete on. - FIXME: This should be language-specific. */ + /* Now look for the symbol we are supposed to complete on. */ { char *p; char quote_found; @@ -3717,6 +3712,16 @@ make_symbol_completion_list (char *text, char *word) return (return_val); } +/* Return a NULL terminated array of all symbols (regardless of class) + which begin by matching TEXT. If the answer is no symbols, then + the return value is an array which contains only a NULL pointer. */ + +char ** +make_symbol_completion_list (char *text, char *word) +{ + return current_language->la_make_symbol_completion_list (text, word); +} + /* Like make_symbol_completion_list, but returns a list of symbols defined in a source file FILE. */ |