public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Simplify quick_symbol_functions
@ 2021-03-25 17:04 Tom Tromey
  2021-03-25 17:04 ` [PATCH 1/9] Add block_search_flags Tom Tromey
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Tom Tromey @ 2021-03-25 17:04 UTC (permalink / raw)
  To: gdb-patches

I have been looking at writing a new implementation of
quick_symbol_functions, and while doing so I was reminded that there
is some redundancy in these methods.

These were introduced when .gdb_index was created, by factoring out
some psymtab calls.  They were purely ad hoc -- which I think can be
seen by reading through the descriptions.

This series removes the map_symtabs_matching_filename,
expand_symtabs_for_function, and lookup_symbol calls, in favor of
slightly expanding expand_symtabs_matching and using that.

Doing this required a few additions to expand_symtabs_matching.  This
series also requires my earlier 2-patch series to tweak psymtabs a
bit; otherwise there are regressions.

Note that the new approach may look slightly less performant, because
expand_symtabs_matching does not binary search global psymbols.
However, I instrumented "maint print statistics" and found that the
median number of global psymbols (per psymtab, which is what matters
for searching) is actually quite low -- it was 8 for gdb.

So, I tend to think the binary search is not important.  However,
perhaps psymbol_functions::expand_symtabs_matching (really
recursively_search_psymtabs) could be improved to use binary search,
if that should prove necessary.

I wrote a patch to remove expand_all_symtabs, but didn't include it
here.  It required some special cases in the DWARF
quick_symbol_functions, and didn't seem to add much value, considering
that this method is normally easy to implement.

I looked at removing map_matching_symbols, but it does name
comparisons in a subtly different way than expand_symtabs_matching.
Perhaps this could be done by another generalization of
expand_symtabs_matching.  Meanwhile, this series does simplify
map_matching_symbols somewhat.



Regression tested on x86-64 Fedora 32.

Let me know what you think.

Tom



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-17 15:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 17:04 [PATCH 0/9] Simplify quick_symbol_functions Tom Tromey
2021-03-25 17:04 ` [PATCH 1/9] Add block_search_flags Tom Tromey
2021-03-25 17:04 ` [PATCH 2/9] Let expand_symtabs_matching short-circuit Tom Tromey
2021-03-25 17:04 ` [PATCH 3/9] Add search_flags to expand_symtabs_matching Tom Tromey
2021-03-25 17:04 ` [PATCH 4/9] Add 'domain' parameter " Tom Tromey
2021-03-25 17:04 ` [PATCH 5/9] Remove quick_symbol_functions::lookup_symbol Tom Tromey
2021-03-25 17:04 ` [PATCH 6/9] Remove quick_symbol_functions::map_symtabs_matching_filename Tom Tromey
2021-03-25 17:04 ` [PATCH 7/9] Remove quick_symbol_functions::expand_symtabs_for_function Tom Tromey
2021-03-25 17:04 ` [PATCH 8/9] Remove quick_symbol_functions::expand_symtabs_with_fullname Tom Tromey
2021-03-25 17:04 ` [PATCH 9/9] Simplify quick_symbol_functions::map_matching_symbols Tom Tromey
2021-04-17 15:38 ` [PATCH 0/9] Simplify quick_symbol_functions Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).