[Lldb-commits] [PATCH] D53368: [Symbol] Search symbols with name and type in a symbol file
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 22 10:44:52 PDT 2018
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
All symbol tables are currently extracted from the object files via ObjectFile::GetSymtab(). Are symbols only in the PDB file? If so I would vote to add a "virtual void SymbolVendor::AddSymbols(Symtab *symtab)" and a "virtual void SymbolFile::AddSymbols(Symtab *symtab)" where we take the symbol table that comes from the object file and we can add symbols to it if the symbol file has symbols it wants to add to the object file's symbol table. All symbol queries go through the lldb_private::Symtab class anyway. Care must be taken to watch out for symbols that might already exist from an ObjectFile's symbol table to ensure don't have duplicates.
So I would:
- Add "virtual void SymbolVendor::AddSymbols(Symtab *symtab);" to SymbolVendor that just calls through to its SymbolFile to do the work
- Add "virtual void SymbolFile::AddSymbols(Symtab *symtab)" to SymbolFile with default implementation that does nothing
- Override SymbolFile::AddSymbols() for SymbolFilePDB and add symbols to the provided symbol table
- Modify *SymbolVendor::GetSymtab()" to get the object file symbol table, then pass that along to any symbol file instances it owns to allow each symbol file to augment the symbol table
- Remove all "FindPublicSymbols()" code from patch
- Revert all symbol searching code to just use the Symtab class now that it contains all needed symbols
More information about the lldb-commits