[PATCH] Have partial symbol tables own psymbol vectors

Simon Marchi simark@simark.ca
Tue Sep 1 14:41:02 GMT 2020


I went through the patch again, I think I understand it better and it looks good to me.

Even though there is slightly bigger memory usage, it's much easier to understand how
things are organized like this.

One question here:

> @@ -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);
> -    }
>  }

Did you keep this empty function on purpose?

Simon


More information about the Gdb-patches mailing list