aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-04-20 19:42:51 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-04-20 19:42:51 +0000
commit7b08b9eb1217e4f1ea29e569faac77651597e30b (patch)
tree5e8fac8e69dcb3d63eeb0c77c10779b9998b525e /gdb/symtab.c
parent4ff224cb8d9347245ffea0f5853d862f0574452e (diff)
downloadgdb-7b08b9eb1217e4f1ea29e569faac77651597e30b.zip
gdb-7b08b9eb1217e4f1ea29e569faac77651597e30b.tar.gz
gdb-7b08b9eb1217e4f1ea29e569faac77651597e30b.tar.bz2
gdb/
* ada-lang.c (struct add_partial_datum): Update the comment for expand_partial_symbol_name. (ada_add_partial_symbol_completions): Rename to ... (ada_expand_partial_symbol_name): ... here, change return type, update function comment, call symbol_completion_match instead of symbol_completion_add. (ada_make_symbol_completion_list): Use now expand_partial_symbol_names and ada_expand_partial_symbol_name. * dwarf2read.c (dw2_expand_symtabs_matching): Support NULL FILE_MATCHER. (dw2_map_symbol_names): Remove. (dwarf2_gdb_index_functions): Unlist dw2_map_symbol_names. * psymtab.c (map_symbol_names_psymtab): Remove. (expand_symtabs_matching_via_partial): Support NULL FILE_MATCHER. Support KIND == ALL_DOMAIN. Exchange the NAME_MATCHER and KIND check order. (psym_functions): Unlist map_symbol_names_psymtab. (map_partial_symbol_names): Rename to ... (expand_partial_symbol_names): ... here, change the FUN type, call expand_symtabs_matching with ALL_DOMAIN and NULL FILE_MATCHER now. * psymtab.h (map_partial_symbol_names): Rename to ... (expand_partial_symbol_names): ... here, change the FUN type. * symfile.h (struct quick_symbol_functions): Update the description of expand_symtabs_matching. Remove map_symbol_names. * symtab.c (search_symbols): Add ALL_DOMAIN to the function comment. (struct add_name_data): Update the comment for expand_partial_symbol_name. (add_partial_symbol_name): Rename to ... (expand_partial_symbol_name): ... here. Replace completion_list_add_name call by strncmp. (default_make_symbol_completion_list_break_on): Use now expand_partial_symbol_names and expand_partial_symbol_name. * symtab.h (enum search_domain): New element ALL_DOMAIN. gdb/testsuite/ * gdb.cp/cpcompletion.exp (complete class methods) (complete class methods beginning with F): Move them above runto. New comment about the runto delimiter.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 10bf04e..86ffb98 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2974,6 +2974,7 @@ search_symbols_name_matches (const char *symname, void *user_data)
and constants (enums)
FUNCTIONS_DOMAIN - search all functions
TYPES_DOMAIN - search all type names
+ ALL_DOMAIN - an internal error for this function
free_search_symbols should be called when *MATCHES is no longer needed.
@@ -3665,7 +3666,7 @@ completion_list_add_fields (struct symbol *sym, char *sym_text,
}
/* Type of the user_data argument passed to add_macro_name or
- add_partial_symbol_name. The contents are simply whatever is
+ expand_partial_symbol_name. The contents are simply whatever is
needed by completion_list_add_name. */
struct add_name_data
{
@@ -3688,15 +3689,13 @@ add_macro_name (const char *name, const struct macro_definition *ignore,
datum->text, datum->word);
}
-/* A callback for map_partial_symbol_names. */
-static void
-add_partial_symbol_name (const char *name, void *user_data)
+/* A callback for expand_partial_symbol_names. */
+static int
+expand_partial_symbol_name (const char *name, void *user_data)
{
struct add_name_data *datum = (struct add_name_data *) user_data;
- completion_list_add_name ((char *) name,
- datum->sym_text, datum->sym_text_len,
- datum->text, datum->word);
+ return strncmp (name, datum->sym_text, datum->sym_text_len) == 0;
}
char **
@@ -3786,8 +3785,9 @@ default_make_symbol_completion_list_break_on (char *text, char *word,
datum.word = word;
/* Look through the partial symtabs for all symbols which begin
- by matching SYM_TEXT. Add each one that you find to the list. */
- map_partial_symbol_names (add_partial_symbol_name, &datum);
+ by matching SYM_TEXT. Expand all CUs that you find to the list.
+ The real names will get added by COMPLETION_LIST_ADD_SYMBOL below. */
+ expand_partial_symbol_names (expand_partial_symbol_name, &datum);
/* At this point scan through the misc symbol vectors and add each
symbol you find to the list. Eventually we want to ignore