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

Simon Marchi
2020-09-01T14:28:18Z

On 2020-09-01 10:23 a.m., Tom Tromey wrote:
> Simon> I think it would be a good time to get rid of the objfile
> Simon> parameter in the add_psymbol methods. This parameter shouldn't
> Simon> be there if the partial symtabs are really objfile-independent.
>
> Yeah. I have another patch to remove it from end_psymtab_common, but I
> didn't look at removing it from the add_psymbol methods.
>
> I think it's a good idea, but it might be a pain to pipe the object
> everywhere it is needed. So I'd prefer to do this as a separate patch.

I have toyed with it and I agree. It's more of a long term goal and there
are a few little annoying dependencies to remove. So, not for this patch
indeed.

> Simon> The other use of objfile in partial_symtab::add_psymbol is for
> Simon> stats. I think that could be easily implemented some other way
> Simon> that doesn't require passing the objfile.
>
> I feel like the stats are not very useful and could just be removed. I
> have never once used them; the bcache already tracks its own efficiency;
> and gdb already knows how many psymbols actually exist.

I agree.

Simon