public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/9] Simplify quick_symbol_functions
Date: Thu, 25 Mar 2021 11:04:49 -0600	[thread overview]
Message-ID: <20210325170458.2351251-1-tom@tromey.com> (raw)

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



             reply	other threads:[~2021-03-25 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 17:04 Tom Tromey [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210325170458.2351251-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).