41 std::unique_ptr<SymbolFile> best_symfile_up;
42 if (objfile_sp !=
nullptr) {
49 ObjectFile *module_obj_file = module_sp->GetObjectFile();
50 if (module_obj_file != objfile_sp.get()) {
53 objfile_sp->CreateSections(*module_sp->GetUnifiedSectionList());
60 uint32_t best_symfile_abilities = 0;
63 for (uint32_t idx = 0;
67 std::unique_ptr<SymbolFile> curr_symfile_up(create_callback(objfile_sp));
69 if (curr_symfile_up) {
70 const uint32_t sym_file_abilities = curr_symfile_up->GetAbilities();
71 if (sym_file_abilities > best_symfile_abilities) {
72 best_symfile_abilities = sym_file_abilities;
73 best_symfile_up.reset(curr_symfile_up.release());
81 if (best_symfile_up) {
93 best_symfile_abilities > 0 &&
98 std::make_unique<SymbolFileOnDemand>(std::move(best_symfile_up));
102 best_symfile_up->InitializeObject();
105 return best_symfile_up.release();
110 lldb::SymbolContextItem resolve_scope,
117 uint32_t max_matches,
121 uint32_t max_matches,
126 bool include_inlines,
130 bool include_inlines,
134 const std::string &scope_qualified_name,
135 std::vector<ConstString> &mangled_names) {}
140#if defined(LLDB_CONFIGURATION_DEBUG)
149 "Module is not locked");
176 if (symfile_objfile != module_objfile)
179 symtab->SectionFileAddressesChanged();
207 assert(idx < num_compile_units);
216 (*m_compile_units)[idx] = cu_sp;
219llvm::Expected<TypeSystemSP>
221 auto type_system_or_err =
222 m_objfile_sp->GetModule()->GetTypeSystemForLanguage(language);
223 if (type_system_or_err) {
224 if (
auto ts = *type_system_or_err)
225 ts->SetSymbolFile(
this);
227 return type_system_or_err;
236 const SectionList *section_list = module_sp->GetSectionList();
254 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
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
uint64_t GetDebugInfoSize(bool load_all_debug_info=false) override
Metrics gathering functions.
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 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)
#define UNUSED_IF_ASSERT_DISABLED(x)
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
virtual ~RegisterInfoResolver()