(basic_lookup_transparent_type): Likewise.
* symfile.h (struct quick_symbol_functions)
<pre_expand_symtabs_matching>: New field.
* psymtab.c (pre_expand_symtabs_matching_psymtabs): New function.
(psym_functions): Update.
+2010-07-13 Tom Tromey <tromey@redhat.com>
+
+ * symtab.c (lookup_symbol_aux_symtabs): Call pre-expand hook.
+ (basic_lookup_transparent_type): Likewise.
+ * symfile.h (struct quick_symbol_functions)
+ <pre_expand_symtabs_matching>: New field.
+ * psymtab.c (pre_expand_symtabs_matching_psymtabs): New function.
+ (psym_functions): Update.
+
2010-07-13 Tom Tromey <tromey@redhat.com>
PR breakpoints/8357:
return NULL;
}
+static void
+pre_expand_symtabs_matching_psymtabs (struct objfile *objfile,
+ int kind, const char *name,
+ domain_enum domain)
+{
+ /* Nothing. */
+}
+
/* Look, in partial_symtab PST, for symbol whose natural name is NAME.
Check the global symbols if GLOBAL, the static symbols if not. */
forget_cached_source_info_partial,
lookup_symtab_via_partial_symtab,
lookup_symbol_aux_psymtabs,
+ pre_expand_symtabs_matching_psymtabs,
print_psymtab_stats_for_objfile,
dump_psymtabs_for_objfile,
relocate_psymtabs,
int kind, const char *name,
domain_enum domain);
+ /* This is called to expand symbol tables before looking up a
+ symbol. A backend can choose to implement this and then have its
+ `lookup_symbol' hook always return NULL, or the reverse. (It
+ doesn't make sense to implement both.) The arguments are as for
+ `lookup_symbol'. */
+ void (*pre_expand_symtabs_matching) (struct objfile *objfile,
+ int kind, const char *name,
+ domain_enum domain);
+
/* Print statistics about any indices loaded for OBJFILE. The
statistics should be printed to gdb_stdout. This is used for
"maint print statistics". */
const struct block *block;
struct symtab *s;
- ALL_PRIMARY_SYMTABS (objfile, s)
+ ALL_OBJFILES (objfile)
{
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, domain);
- if (sym)
- {
- block_found = block;
- return fixup_symbol_section (sym, objfile);
- }
+ if (objfile->sf)
+ objfile->sf->qf->pre_expand_symtabs_matching (objfile,
+ block_index,
+ name, domain);
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ if (s->primary)
+ {
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, domain);
+ if (sym)
+ {
+ block_found = block;
+ return fixup_symbol_section (sym, objfile);
+ }
+ }
}
return NULL;
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
- ALL_PRIMARY_SYMTABS (objfile, s)
+ ALL_OBJFILES (objfile)
{
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
- if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
- {
- return SYMBOL_TYPE (sym);
- }
+ if (objfile->sf)
+ objfile->sf->qf->pre_expand_symtabs_matching (objfile,
+ GLOBAL_BLOCK,
+ name, STRUCT_DOMAIN);
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ if (s->primary)
+ {
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+ sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
+ if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
+ {
+ return SYMBOL_TYPE (sym);
+ }
+ }
}
ALL_OBJFILES (objfile)