Re: [PATCH v3 7/9] gdb: make expanded_symbols_functions hold compunit symtabs

Simon Marchi
2026-03-09T18:49:15Z

On 3/4/26 2:21 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>
> Simon> Change the expanded_symbols_functions quick functions type to hold and
> Simon> use a list of compunit symtab to search.
>
> Simon> Right now the sole user of expanded_symbols_functions is JIT. Update it
> Simon> to keep a vector of compunits as they are finalized, and pass this
> Simon> vector to the expanded_symbols_functions object.
>
> I think this is a good direction but this patch isn't quite complete.
> The issue is that there are still a handful of spots in gdb that loop
> over all compunits. But with this change, these spots will skip some
> compunits.
>
> Now, arguably some of these spots aren't really needed in the current
> setup. For instance, objfile relocation in practice is probably not
> needed by the current expanded-symbols users (though it seems a little
> less future-proof to assume this).

I don't understand this. If some code wants to iterate on all compunit
symtabs of a given objfile, it would use objfile::compunits. Why would
changing expanded_symbols_functions affect that?

Simon