From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][gdb/symtab] Lazy expansion of full symbol table
Date: Wed, 16 Jun 2021 12:20:26 +0200 [thread overview]
Message-ID: <b95c51aa-1fb6-0d8e-930d-8f58c049b5ef@suse.de> (raw)
In-Reply-To: <87im2fxnr7.fsf@tromey.com>
On 6/15/21 3:26 PM, Tom Tromey wrote:
>>> I don't have this executable
>
> Tom> Uploaded to https://ftp.suse.com/pub/people/tdevries/gdb/pr23710/cc1
>
> Thanks, I grabbed it.
>
>>> but FWIW my scanner rewrite is ~10x faster
>>> than the current psymtab reader.
>
> Tom> Interesting, that's
> Tom> https://github.com/tromey/gdb/commits/submit/no-more-psym ?
>
> Tom> I've tried that branch with the cc1 example, and ran into:
> Tom> ...
> Tom> DW_FORM_strp pointing outside of .debug_str section [in module cc1]
>
> Thank you for trying it. This was a bug in the CU importing code. I've
> fixed it and will push momentarily -- but be warned, I rebase this
> branch a lot...
>
Sure, understood.
> On my machine, with "maint time 1", /bin/gdb reports:
>
> (gdb) file ./cc1
> 2021-06-15 07:18:29.554 - command started
> Reading symbols from ./cc1...
> 2021-06-15 07:18:35.118 - command finished
> Command execution time: 5.553344 (cpu), 5.563964 (wall)
>
> The branch says:
>
> (gdb) file ./cc1
> 2021-06-15 07:18:50.688 - command started
> Reading symbols from ./cc1...
> 2021-06-15 07:18:51.074 - command finished
> Command execution time: 1.260050 (cpu), 0.386460 (wall)
>
> So a bit more than 10x in this case.
Wow, nice :)
FWIW, my measurement is:
1. branch base 739025e89c4
...
$ gdb -q -ex "set trace-commands on" -ex "maint time 1" -ex "file lto/cc1"
+maint time 1
+file lto/cc1
Reading symbols from lto/cc1...
2021-06-16 11:51:54.007 - command finished
Startup time: 2.949213 (cpu), 2.887778 (wall)
(gdb)
...
2. branch 5bc56d745fd
...
$ gdb -q -ex "set trace-commands on" -ex "maint time 1" -ex "file lto/cc1"
+maint time 1
+file lto/cc1
Reading symbols from lto/cc1...
2021-06-16 12:00:35.060 - command finished
Startup time: 0.947957 (cpu), 0.408178 (wall)
(gdb)
...
Which is a factor 7 speedup.
> I wish it were a tiny bit faster,
> so that it wasn't perceptible, but meh, DWARF wasn't designed to be fast
> to read.
>
> Currently I think the scanner is complete, I just need to make some
> changes to the lookup code, and maybe also how the new index entries are
> stored, so that completion is more efficient. Of course there may still
> be bugs, but at the moment I don't anticipate any reader slowdowns.
I did an overnight build and test with the updated branch (5bc56d745fd)
and ran into some trouble. The first internal-error I investigated
happens when parsing the libstdc++ .debug package (so, it was not
specific to the test-case). It seems the branch has some trouble with
the dwz layout where an abbrev entry is shared between different CUs:
...
src/gdb/dwarf2/abbrev-cache.c:59: internal-error: void
abbrev_cache::add(abbrev_table_up): Assertion `*slot == nullptr' failed.
...
I also could reproduce this problem with "maint set worker-threads 1".
I set a breakpoint on abbrev_cache::add and abbrev_cache::find, both
limited to section offset 0.
I see then a lot of finds, followed by two adds (and the second add
triggers the assert).
[ If you want to reproduce, download f.i.
https://download.opensuse.org/update/leap/15.2/oss_debug/x86_64/libstdc++6-debuginfo-10.2.1+git583-lp152.4.1.x86_64.rpm
. ]
Thanks,
- Tom
next prev parent reply other threads:[~2021-06-16 10:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-14 9:39 Tom de Vries
2021-06-14 20:54 ` Tom Tromey
2021-06-14 23:36 ` Tom de Vries
2021-06-15 13:26 ` Tom Tromey
2021-06-16 10:20 ` Tom de Vries [this message]
2021-06-18 2:30 ` Tom Tromey
2021-06-19 19:36 ` Tom de Vries
2021-06-20 9:41 ` Tom de Vries
2021-06-20 18:17 ` Tom Tromey
2021-06-22 9:16 ` Tom de Vries
2021-06-20 23:44 ` Tom Tromey
2021-06-21 9:18 ` Tom de Vries
2021-06-27 22:24 ` Tom Tromey
2021-06-28 0:48 ` 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=b95c51aa-1fb6-0d8e-930d-8f58c049b5ef@suse.de \
--to=tdevries@suse.de \
--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