40 std::unique_ptr<SymbolFile> best_symfile_up;
41 if (objfile_sp !=
nullptr) {
48 ObjectFile *module_obj_file = module_sp->GetObjectFile();
49 if (module_obj_file != objfile_sp.get()) {
52 objfile_sp->CreateSections(*module_sp->GetUnifiedSectionList());
59 uint32_t best_symfile_abilities = 0;
62 for (uint32_t idx = 0;
66 std::unique_ptr<SymbolFile> curr_symfile_up(create_callback(objfile_sp));
68 if (curr_symfile_up) {
69 const uint32_t sym_file_abilities = curr_symfile_up->GetAbilities();
70 if (sym_file_abilities > best_symfile_abilities) {
71 best_symfile_abilities = sym_file_abilities;
72 best_symfile_up.reset(curr_symfile_up.release());
80 if (best_symfile_up) {
92 best_symfile_abilities > 0 &&
97 std::make_unique<SymbolFileOnDemand>(std::move(best_symfile_up));
101 best_symfile_up->InitializeObject();
104 return best_symfile_up.release();
109 lldb::SymbolContextItem resolve_scope,
116 uint32_t max_matches,
120 uint32_t max_matches,
125 bool include_inlines,
129 bool include_inlines,
133 const std::string &scope_qualified_name,
134 std::vector<ConstString> &mangled_names) {}
138 uint32_t max_matches,
139 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
144 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
150#if defined(LLDB_CONFIGURATION_DEBUG)
159 "Module is not locked");
186 if (symfile_objfile != module_objfile)
189 symtab->SectionFileAddressesChanged();
217 assert(idx < num_compile_units);
218 (void)num_compile_units;
226 (*m_compile_units)[idx] = cu_sp;
229llvm::Expected<TypeSystemSP>
231 auto type_system_or_err =
232 m_objfile_sp->GetModule()->GetTypeSystemForLanguage(language);
233 if (type_system_or_err) {
234 if (
auto ts = *type_system_or_err)
235 ts->SetSymbolFile(
this);
237 return type_system_or_err;
246 const SectionList *section_list = module_sp->GetSectionList();
264 cu_sp->Dump(&s,
false);
Represents a generic declaration context in a program.
A uniqued constant string class.
lldb::ModuleSP GetModule() const
Get const accessor for the module pointer.
static ModuleListProperties & GetGlobalModuleListProperties()
A class that encapsulates name lookup information.
A plug-in interface definition class for object file parsers.
Symtab * GetSymtab()
Gets the symbol table for the currently selected architecture (and object for archives).
@ eTypeExecutable
A normal executable.
@ eTypeDebugInfo
An object file that contains only debug information.
@ eTypeSharedLibrary
A shared library that can be used during execution.
virtual void SectionFileAddressesChanged()
Notify the ObjectFile that the file addresses in the Sections for this module have been changed.
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
virtual llvm::StringRef GetPluginName()=0
static SymbolFileCreateInstance GetSymbolFileCreateCallbackAtIndex(uint32_t idx)
uint64_t GetDebugInfoSize() const
Get the debug information size from all sections that contain debug information.
"lldb/Core/SourceLocationSpec.h" A source location specifier class.
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Defines a list of symbol context objects.
lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx) override
ObjectFile * GetObjectFile() override
std::optional< std::vector< lldb::CompUnitSP > > m_compile_units
uint64_t GetDebugInfoSize() override
Metrics gathering functions.
lldb::ObjectFileSP m_objfile_sp
Symtab * GetSymtab() override
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx)=0
ObjectFile * GetMainObjectFile() override
Symtab * m_symtab
Do not use m_symtab directly, as it may be freed.
static char ID
LLVM RTTI support.
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language) override
uint32_t GetNumCompileUnits() override
void SectionFileAddressesChanged() override
Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
virtual uint32_t CalculateNumCompileUnits()=0
void Dump(Stream &s) override
Provides public interface for all SymbolFiles.
virtual void PreloadSymbols()
virtual void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables)
static SymbolFile * FindPlugin(lldb::ObjectFileSP objfile_sp)
virtual std::recursive_mutex & GetModuleMutex() const
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
virtual void FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, TypeMap &types)
virtual void AddSymbols(Symtab &symtab)
static char ID
LLVM RTTI support.
virtual void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list)
virtual ObjectFile * GetObjectFile()=0
virtual uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
void Dump(Stream *s, bool show_context)
A class that represents a running process on the host machine.
SymbolFile *(* SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp)
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Module > ModuleSP
std::shared_ptr< lldb_private::CompileUnit > CompUnitSP
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
virtual ~RegisterInfoResolver()