+2015-01-31 Gary Benson <gbenson@redhat.com>
+
+ * symfile.h (expand_symtabs_exp_notify_ftype): New typedef.
+ (struct quick_symbol_functions) <expand_symtabs_matching>:
+ New argument expansion_notify. All uses updated.
+ (expand_symtabs_matching): New argument expansion_notify.
+ All uses updated.
+ * symfile-debug.c (debug_qf_expand_symtabs_matching):
+ Also print expansion notify.
+ * symtab.c (expand_symtabs_matching_via_partial): Call
+ expansion_notify whenever a partial symbol table is expanded.
+ * dwarf2read.c (dw2_expand_symtabs_matching): Call
+ expansion_notify whenever a symbol table is instantiated.
+
2015-01-31 Doug Evans <xdje42@gmail.com>
* cli-out.c: #include completer.h, readline/readline.h.
data.word = word;
data.wild_match = wild_match_p;
data.encoded = encoded_p;
- expand_symtabs_matching (NULL, ada_complete_symbol_matcher, ALL_DOMAIN,
- &data);
+ expand_symtabs_matching (NULL, ada_complete_symbol_matcher, NULL,
+ ALL_DOMAIN, &data);
}
/* At this point scan through the misc symbol vectors and add each
struct objfile *objfile;
struct compunit_symtab *s;
- expand_symtabs_matching (NULL, ada_exc_search_name_matches,
+ expand_symtabs_matching (NULL, ada_exc_search_name_matches, NULL,
VARIABLES_DOMAIN, preg);
ALL_COMPUNITS (objfile, s)
(struct objfile *objfile,
expand_symtabs_file_matcher_ftype *file_matcher,
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
+ expand_symtabs_exp_notify_ftype *expansion_notify,
enum search_domain kind,
void *data)
{
per_cu = dw2_get_cutu (cu_index);
if (file_matcher == NULL || per_cu->v.quick->mark)
- dw2_instantiate_symtab (per_cu);
+ {
+ int symtab_was_null =
+ (per_cu->v.quick->compunit_symtab == NULL);
+
+ dw2_instantiate_symtab (per_cu);
+
+ if (expansion_notify != NULL
+ && symtab_was_null
+ && per_cu->v.quick->compunit_symtab != NULL)
+ {
+ expansion_notify (per_cu->v.quick->compunit_symtab,
+ data);
+ }
+ }
}
}
}
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile, NULL,
iterate_name_matcher,
- ALL_DOMAIN,
+ NULL, ALL_DOMAIN,
&matcher_data);
ALL_OBJFILE_COMPUNITS (objfile, cu)
(struct objfile *objfile,
expand_symtabs_file_matcher_ftype *file_matcher,
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
+ expand_symtabs_exp_notify_ftype *expansion_notify,
enum search_domain kind,
void *data)
{
}
if (recursively_search_psymtabs (ps, objfile, kind, symbol_matcher, data))
- psymtab_to_symtab (objfile, ps);
+ {
+ struct compunit_symtab *symtab =
+ psymtab_to_symtab (objfile, ps);
+
+ if (expansion_notify != NULL)
+ expansion_notify (symtab, data);
+ }
}
}
(struct objfile *objfile,
expand_symtabs_file_matcher_ftype *file_matcher,
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
+ expand_symtabs_exp_notify_ftype *expansion_notify,
enum search_domain kind, void *data)
{
const struct debug_sym_fns_data *debug_data =
objfile_data (objfile, symfile_debug_objfile_data_key);
fprintf_filtered (gdb_stdlog,
- "qf->expand_symtabs_matching (%s, %s, %s, %s, %s)\n",
+ "qf->expand_symtabs_matching (%s, %s, %s, %s, %s, %s)\n",
objfile_debug_name (objfile),
host_address_to_string (file_matcher),
host_address_to_string (symbol_matcher),
+ host_address_to_string (expansion_notify),
search_domain_name (kind),
host_address_to_string (data));
debug_data->real_sf->qf->expand_symtabs_matching (objfile,
file_matcher,
symbol_matcher,
+ expansion_notify,
kind, data);
}
void
expand_symtabs_matching (expand_symtabs_file_matcher_ftype *file_matcher,
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
+ expand_symtabs_exp_notify_ftype *expansion_notify,
enum search_domain kind,
void *data)
{
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile, file_matcher,
- symbol_matcher, kind,
+ symbol_matcher,
+ expansion_notify, kind,
data);
}
}
typedef int (expand_symtabs_symbol_matcher_ftype) (const char *name,
void *data);
+/* Callback for quick_symbol_functions->expand_symtabs_matching
+ to be called after a symtab has been expanded. */
+
+typedef void (expand_symtabs_exp_notify_ftype) \
+ (struct compunit_symtab *symtab, void *data);
+
/* The "quick" symbol functions exist so that symbol readers can
avoiding an initial read of all the symbols. For example, symbol
readers might choose to use the "partial symbol table" utilities,
(struct objfile *objfile,
expand_symtabs_file_matcher_ftype *file_matcher,
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
+ expand_symtabs_exp_notify_ftype *expansion_notify,
enum search_domain kind,
void *data);
void expand_symtabs_matching (expand_symtabs_file_matcher_ftype *,
expand_symtabs_symbol_matcher_ftype *,
+ expand_symtabs_exp_notify_ftype *,
enum search_domain kind, void *data);
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
{
objfile->sf->qf->expand_symtabs_matching
(objfile, maintenance_expand_file_matcher,
- maintenance_expand_name_matcher, ALL_DOMAIN, regexp);
+ maintenance_expand_name_matcher, NULL, ALL_DOMAIN, regexp);
}
}
? NULL
: search_symbols_file_matches),
search_symbols_name_matches,
- kind, &datum);
+ NULL, kind, &datum);
/* Here, we search through the minimal symbol tables for functions
and variables that match, and force their symbols to be read.
/* Look through the partial symtabs for all symbols which begin
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_symtabs_matching (NULL, symbol_completion_matcher, ALL_DOMAIN,
- &datum);
+ expand_symtabs_matching (NULL, symbol_completion_matcher, NULL,
+ ALL_DOMAIN, &datum);
/* At this point scan through the misc symbol vectors and add each
symbol you find to the list. Eventually we want to ignore