[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)

Augusto Noronha via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 13 09:22:21 PDT 2024


augusto2112 wrote:

> > @clayborg I can see how a module could be used as a hint, but I'm not sure how we'd prioritize lookups using functions or compile unit. The code in `SymTab.cpp` does a binary search to find the symbol, how could we restrict this further by passing a function hint, for example?
> 
> For symbol lookups, we would only check the Module. If there is not module, we would just search through the target's image list. If there was a module, then we search it first, and avoid that module if we search the module list just by checking the pointer of the module when iterating over the target's module list. The full symbol context isn't required, but it would be nice to set the precedent that others can duplicate when doing lookups of other kinds.

If that's the case, personally I think that it would make more sense if `FindFunctions` and `FindSymbolsWithNameAndType` took in a module because it wouldn't be possible to pass in something that doesn't make sense to those functions (like a symbol context with only a compile unit set, for example).

https://github.com/llvm/llvm-project/pull/102835


More information about the lldb-commits mailing list