diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-20 19:42:51 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-04-20 19:42:51 +0000 |
commit | 7b08b9eb1217e4f1ea29e569faac77651597e30b (patch) | |
tree | 5e8fac8e69dcb3d63eeb0c77c10779b9998b525e /gdb/psymtab.c | |
parent | 4ff224cb8d9347245ffea0f5853d862f0574452e (diff) | |
download | gdb-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/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index a0647bc..93a7ea2 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1074,42 +1074,6 @@ read_psymtabs_with_filename (struct objfile *objfile, const char *filename) } static void -map_symbol_names_psymtab (struct objfile *objfile, - void (*fun) (const char *, void *), void *data) -{ - struct partial_symtab *ps; - - ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, ps) - { - struct partial_symbol **psym; - - /* If the psymtab's been read in we'll get it when we search - through the blockvector. */ - if (ps->readin) - continue; - - for (psym = objfile->global_psymbols.list + ps->globals_offset; - psym < (objfile->global_psymbols.list + ps->globals_offset - + ps->n_global_syms); - psym++) - { - /* If interrupted, then quit. */ - QUIT; - (*fun) (SYMBOL_NATURAL_NAME (*psym), data); - } - - for (psym = objfile->static_psymbols.list + ps->statics_offset; - psym < (objfile->static_psymbols.list + ps->statics_offset - + ps->n_static_syms); - psym++) - { - QUIT; - (*fun) (SYMBOL_NATURAL_NAME (*psym), data); - } - } -} - -static void map_symbol_filenames_psymtab (struct objfile *objfile, void (*fun) (const char *, const char *, void *), @@ -1259,7 +1223,7 @@ expand_symtabs_matching_via_partial (struct objfile *objfile, if (ps->readin) continue; - if (! (*file_matcher) (ps->filename, data)) + if (file_matcher && ! (*file_matcher) (ps->filename, data)) continue; gbound = objfile->global_psymbols.list @@ -1288,14 +1252,15 @@ expand_symtabs_matching_via_partial (struct objfile *objfile, { QUIT; - if ((*name_matcher) (SYMBOL_NATURAL_NAME (*psym), data) - && ((kind == VARIABLES_DOMAIN + if ((kind == ALL_DOMAIN + || (kind == VARIABLES_DOMAIN && SYMBOL_CLASS (*psym) != LOC_TYPEDEF && SYMBOL_CLASS (*psym) != LOC_BLOCK) - || (kind == FUNCTIONS_DOMAIN - && SYMBOL_CLASS (*psym) == LOC_BLOCK) - || (kind == TYPES_DOMAIN - && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))) + || (kind == FUNCTIONS_DOMAIN + && SYMBOL_CLASS (*psym) == LOC_BLOCK) + || (kind == TYPES_DOMAIN + && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)) + && (*name_matcher) (SYMBOL_NATURAL_NAME (*psym), data)) { PSYMTAB_TO_SYMTAB (ps); keep_going = 0; @@ -1330,7 +1295,6 @@ const struct quick_symbol_functions psym_functions = map_matching_symbols_psymtab, expand_symtabs_matching_via_partial, find_pc_sect_symtab_from_partial, - map_symbol_names_psymtab, map_symbol_filenames_psymtab }; @@ -1933,14 +1897,15 @@ maintenance_check_symtabs (char *ignore, int from_tty) void -map_partial_symbol_names (void (*fun) (const char *, void *), void *data) +expand_partial_symbol_names (int (*fun) (const char *, void *), void *data) { struct objfile *objfile; ALL_OBJFILES (objfile) { if (objfile->sf) - objfile->sf->qf->map_symbol_names (objfile, fun, data); + objfile->sf->qf->expand_symtabs_matching (objfile, NULL, fun, + ALL_DOMAIN, data); } } |