This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Add expansion_notify callback to expand_symtabs_matching
- From: Tom Tromey <tromey at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 12 Feb 2014 13:10:39 -0700
- Subject: Re: [PATCH 1/2] Add expansion_notify callback to expand_symtabs_matching
- Authentication-results: sourceware.org; auth=none
- References: <20140212115548 dot GA2866 at blade dot nx> <20140212115641 dot GB2866 at blade dot nx>
>>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
Gary> This patch adds a new callback parameter, "expansion_notify", to the
Gary> top-level expand_symtabs_matching function and to all the vectorized
Gary> functions it defers to. If expansion_notify is non-NULL, it will be
Gary> called every time a psymtab is expanded to a symtab.
Gary> * symfile.h (struct partial_symtab): New forward declaration.
Gary> (expand_symtabs_exp_notify_ftype): New typedef.
Gary> (struct quick_symbol_functions) <expand_symtabs_matching>: New
Gary> parameter "expansion_notify". All uses updated.
Gary> (expand_symtabs_matching): Likewise.
Gary> * psymtab.c (expand_symtabs_matching_via_partial): New
Gary> parameter "expansion_notify". If non-NULL, call it prior
Gary> to calling psymtab_to_symtab.
The ChangeLog doesn't mention the dwarf2read change.
Gary> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
Gary> index 54c538a..f9da5db 100644
Gary> --- a/gdb/dwarf2read.c
Gary> +++ b/gdb/dwarf2read.c
Gary> @@ -3773,6 +3773,7 @@ dw2_expand_symtabs_matching
Gary> (struct objfile *objfile,
Gary> expand_symtabs_file_matcher_ftype *file_matcher,
Gary> expand_symtabs_symbol_matcher_ftype *symbol_matcher,
Gary> + expand_symtabs_exp_notify_ftype *expansion_notify,
Gary> enum search_domain kind,
Gary> void *data)
Gary> {
I think this ought to call the callback after it calls
dw2_instantiate_symtab. Otherwise you will miss some symtab expansions
if your program is using .gdb_index.
Tom