aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-01-31 14:45:26 -0800
committerDoug Evans <xdje42@gmail.com>2015-01-31 14:45:26 -0800
commit276d885b572b12221f639641846ab94ef9582995 (patch)
tree979dd34e3f0f20d27e1bf1b7227b25bde3b17ff1 /gdb/dwarf2read.c
parent5dd31d7995882a43fab9b35b11775499126d7bd8 (diff)
downloadgdb-276d885b572b12221f639641846ab94ef9582995.zip
gdb-276d885b572b12221f639641846ab94ef9582995.tar.gz
gdb-276d885b572b12221f639641846ab94ef9582995.tar.bz2
new callback parameter expansion_notify for expand_symtabs_matching
This commit adds a new callback parameter, "expansion_notify", to the top-level expand_symtabs_matching function and to all the vectorized functions it defers to. If expansion_notify is non-NULL, it will be called every time a symbol table is expanded. gdb/ChangeLog: * 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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 090d1a5..56e82f5 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3825,6 +3825,7 @@ dw2_expand_symtabs_matching
(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)
{
@@ -3996,7 +3997,20 @@ dw2_expand_symtabs_matching
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);
+ }
+ }
}
}
}