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

Tom Tromey
2026-03-04T19:22:09Z

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

OTOH some of the spots should still work, e.g., is_addr_in_objfile or
the symbol-searching code (... which should be changed of course, but
currently hasn't been).

Tom