From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Simplify psymbol_functions::expand_symtabs_matching
Date: Thu, 25 Mar 2021 15:31:25 -0400 [thread overview]
Message-ID: <9fde4c25-96b0-ac58-e453-41b0214572d9@polymtl.ca> (raw)
In-Reply-To: <20210324201510.23655-3-tom@tromey.com>
On 2021-03-24 4:15 p.m., Tom Tromey wrote:
> I noticed that psymbol_functions::expand_symtabs_matching calls
> make_ignore_params once per psymtab that is matched. This seems
> possibly expensive, so this patch hoists the call out of the loop.
>
> gdb/ChangeLog
> 2021-03-24 Tom Tromey <tom@tromey.com>
>
> * psymtab.c (psymbol_functions::expand_symtabs_matching): Only
> call make_ignore_params once.
> ---
> gdb/ChangeLog | 5 +++++
> gdb/psymtab.c | 6 +++++-
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/psymtab.c b/gdb/psymtab.c
> index 5a64166d983..1ea7376a8c8 100644
> --- a/gdb/psymtab.c
> +++ b/gdb/psymtab.c
> @@ -1306,6 +1306,10 @@ psymbol_functions::expand_symtabs_matching
> for (partial_symtab *ps : require_partial_symbols (objfile))
> ps->searched_flag = PST_NOT_SEARCHED;
>
> + gdb::optional<lookup_name_info> psym_lookup_name;
> + if (lookup_name != nullptr)
> + psym_lookup_name = lookup_name->make_ignore_params ();
> +
> for (partial_symtab *ps : m_partial_symtabs->range ())
> {
> QUIT;
> @@ -1335,7 +1339,7 @@ psymbol_functions::expand_symtabs_matching
>
> if ((symbol_matcher == NULL && lookup_name == NULL)
> || recursively_search_psymtabs (ps, objfile, domain,
> - lookup_name->make_ignore_params (),
> + *psym_lookup_name,
> symbol_matcher))
> {
> struct compunit_symtab *symtab =
>
This LGTM, thanks.
Simon
prev parent reply other threads:[~2021-03-25 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-24 20:15 [PATCH 0/2] Two minor partial symtab cleanups Tom Tromey
2021-03-24 20:15 ` [PATCH 1/2] Allow expand_symtabs_matching to examine imported psymtabs Tom Tromey
2021-03-25 19:29 ` Simon Marchi
2021-03-26 18:17 ` Tom Tromey
2021-03-26 18:27 ` Simon Marchi
2021-03-24 20:15 ` [PATCH 2/2] Simplify psymbol_functions::expand_symtabs_matching Tom Tromey
2021-03-25 19:31 ` Simon Marchi [this message]
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=9fde4c25-96b0-ac58-e453-41b0214572d9@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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).