[RFC][gdb/symtab] Lazy expansion of full symbol table

Tom Tromey tom@tromey.com
Tue Jun 15 13:26:20 GMT 2021


>> 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...

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.  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.

Tom


More information about the Gdb-patches mailing list