Re: [PATCH v2 00/28] Search symbols via quick API

Guinevere Larsen
2025-04-29T19:31:47Z

On 4/28/25 7:06 PM, Tom Tromey wrote:
>>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:
> Guinevere> I am having an issue with the quick_fns interface, and while it isn't
> Guinevere> affected by this series directly (as I originally thought it could
> Guinevere> be), I would appreciate if you could share your expertise on this
> Guinevere> area. The TL;DR of the issue is: the quick API seems to be caching
> Guinevere> something and searching objfile B for a symbol can return a symbol
> Guinevere> with details from objfile A (that was loaded first). I tried looking
> Guinevere> around for where the cache could be hidden, but couldn't find it. Do
> Guinevere> you know if where the cache is, if it really exists?
>
> Look for symbol_cache in symtab.c.

Drat, this isn't the culprit I was looking for.

My first test was using `maint flush symbol-cache` between printing
symbols from different namespaces. No change.

Then I tried stopping in the new lookup_symbol_in_linker_namespace, and
then setting a breakpoint in get_symbol_cache. No hits.

> Also there's a separate cache in ada-lang.c, but this one only affects
> Ada.
Yeah, I'm in C, so this shouldn't affect anything
> It's been a while since I looked to see if either of these are really
> helpful.
>
> There are also some debug settings for symbol lookup, look in symtab.c
> and symfile-debug.c.

I looked these up, but I have tried all of them, and nothing looked
suspicious... The most interesting one was symtab-create, but even then,
both of the namespaces had the exact same output, so I don't think the
second one was shortcutting by using the first one's symtab.

Thank you for the pointers, though, and if you have other ideas that may
help (even if you're not sure if they're useful), I'll be glad to hear them!

--
Cheers,
Guinevere Larsen
She/Her/Hers