This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Add expansion_notify callback to expand_symtabs_matching


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]