Re: [PATCH] Have partial symbol tables own psymbol vectors

Tom Tromey
2020-09-01T17:59:15Z

>> @@ -1666,16 +1605,6 @@ add_psymbol_to_list (gdb::string_view name, bool copy_name,
>> void
>> init_psymbol_list (struct objfile *objfile, int total_symbols)
>> {
>> - if (objfile->partial_symtabs->global_psymbols.capacity () == 0
>> - && objfile->partial_symtabs->static_psymbols.capacity () == 0)
>> - {
>> - /* Current best guess is that approximately a twentieth of the
>> - total symbols (in a debugging file) are global or static
>> - oriented symbols, then multiply that by slop factor of
>> - two. */
>> - objfile->partial_symtabs->global_psymbols.reserve (total_symbols / 10);
>> - objfile->partial_symtabs->static_psymbols.reserve (total_symbols / 10);
>> - }
>> }

Simon> Did you keep this empty function on purpose?

I wasn't sure if I'd want to introduce some kind of psymtab builder RAII
thing, and the calls to this function would mark the needed spots.

That said, I do have a separate patch somewhere to remove it. I can
submit it. I don't think I ended up needing the builder thing.

I did experiment with sorting psymbols in the background, but on this
machine at least it didn't help. However I suspect maybe it would help
on a more capable machine -- I plan to try it on my work computer soon.
(I've also got a bigger series to try reading each CU in parallel, but
that is unfinished due to some complexity with cross-CU references.)

Tom