From: Tom Tromey <tom@tromey.com>
To: <gdb@sourceware.org>
Cc: Hannes Domani <ssbssa@yahoo.de>
Subject: Re: question about expand_symtabs_matching()
Date: Fri, 01 Mar 2019 18:30:00 -0000 [thread overview]
Message-ID: <87lg1yh2gx.fsf@tromey.com> (raw)
In-Reply-To: <1428427467.10799860.1551353565332@mail.yahoo.com> (Hannes Domani via gdb's message of "Thu, 28 Feb 2019 11:32:45 +0000 (UTC)")
Tom> Nope, but then again it isn't called in this scenario; at least not if
Tom> "some-file.c" exists.
Hannes> I should have clarified that I'm currently investigating why
Hannes> *pending* breakpoints slow down gdb so much.
Ok. It's been a while, but IIRC in some cases linespec can't decide how
to parse a given string until it has seen some match. So, sometimes
re-setting pending breakpoint can be more expensive.
For example I think gdb can't tell the difference between
"break filename:function" and "break function:label".
This is addressed by the "explicit locations" work, though I don't think
this work extends all the way to fine-grained breakpoint re-setting.
Personally I'd be fine with changing the syntax of the more obscure
linespecs ("function:label" is probably not used much in practice) in
order to make the parsing more sane, if it had a performance benefit
here. But that's just me.
Also, a negative result is still a parse result; so if a linespec
understood which objfiles had been searched, it could still easily skip
this work on dlopen or dlclose.
Hannes> Similar, for the case of a simple function name as pending breakpoint,
Hannes> it's cp_canonicalize_string_no_typedefs() called by find_linespec_symbols(),
Hannes> that's taking most of the time.
Hannes> And I'm wondering if this call is necessary if you only use the function name
Hannes> without arguments (like 'function' or Class::member_function).
I doubt it's needed but on the other hand it may not really save much.
Maybe one way to do the experiment is check the string for
non-identifier characters before trying to canonicalize it.
Hannes> If you are interested, I could also send you the profiling flamegraphs.
It's an area I'm interested in but I'm not actively working there right
now. If you're interested at all in gdb development ... on the one hand
tackling linespec caching is maybe a difficult project, but on the other
hand it seems fun :-)
Tom
next prev parent reply other threads:[~2019-03-01 18:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <183519794.10360727.1551304006549.ref@mail.yahoo.com>
[not found] ` <183519794.10360727.1551304006549@mail.yahoo.com>
2019-02-27 23:55 ` Tom Tromey
2019-02-28 11:32 ` Hannes Domani via gdb
2019-03-01 18:30 ` Tom Tromey [this message]
2019-03-01 18:51 ` Hannes Domani via gdb
2019-03-08 21:13 ` Tom Tromey
[not found] ` <605876742.3053854.1552089304851@mail.yahoo.com>
2019-03-09 0:18 ` Fw: " Hannes Domani via gdb
[not found] <948301287.10289911.1551297622910.ref@mail.yahoo.com>
2019-02-27 20:02 ` Hannes Domani via gdb
2019-02-27 21:26 ` 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=87lg1yh2gx.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb@sourceware.org \
--cc=ssbssa@yahoo.de \
/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