aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c57
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);
}
}