Go to the documentation of this file.
9 #ifndef LLDB_SYMBOL_SYMBOLFILE_H
10 #define LLDB_SYMBOL_SYMBOLFILE_H
27 #include "llvm/ADT/DenseSet.h"
28 #include "llvm/Support/Errc.h"
33 #if defined(LLDB_CONFIGURATION_DEBUG)
34 #define ASSERT_MODULE_LOCK(expr) (expr->AssertModuleLock())
36 #define ASSERT_MODULE_LOCK(expr) ((void)0)
54 virtual bool isA(
const void *ClassID)
const {
return ClassID == &
ID; }
181 llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
182 llvm::function_ref<
bool(
Module &)> lambda) {
186 FileSpecList &support_files) = 0;
192 std::vector<SourceModule> &imported_modules) = 0;
208 virtual std::optional<ArrayInfo>
224 lldb::SymbolContextItem resolve_scope,
272 lldb::SymbolContextItem resolve_scope,
291 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
301 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
306 std::vector<ConstString> &mangled_names);
309 lldb::TypeClass type_mask,
314 virtual llvm::Expected<lldb::TypeSystemSP>
326 virtual std::vector<std::unique_ptr<CallEdge>>
340 virtual const RegisterInfo *
ResolveName(llvm::StringRef name)
const = 0;
344 virtual lldb::UnwindPlanSP
352 return llvm::createStringError(make_error_code(llvm::errc::not_supported),
353 "Operation not supported.");
424 virtual lldb::TypeSP
CopyType(
const lldb::TypeSP &other_type) = 0;
443 bool isA(
const void *ClassID)
const override {
480 llvm::Expected<lldb::TypeSystemSP>
510 std::optional<uint64_t> byte_size,
517 uint32_t opaque_payload = 0)
override {
518 lldb::TypeSP type_sp (
new Type(
519 uid,
this, name, byte_size, context, encoding_uid,
520 encoding_uid_type, decl, compiler_qual_type,
521 compiler_type_resolve_state, opaque_payload));
526 lldb::TypeSP
CopyType(
const lldb::TypeSP &other_type)
override {
529 return lldb::TypeSP();
530 lldb::TypeSP type_sp(
new Type(*other_type));
567 #endif // LLDB_SYMBOL_SYMBOLFILE_H
virtual void SetDebugInfoIndexWasSavedToCache()=0
static SymbolFile * FindPlugin(lldb::ObjectFileSP objfile_sp)
void SetDebugInfoIndexWasLoadedFromCache() override
Provides public interface for all SymbolFiles.
virtual CompilerDecl GetDeclForUID(lldb::user_id_t uid)
virtual std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction(UserID func_id)
virtual void FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, TypeMap &types)
Symtab * GetSymtab() override
static bool classof(const SymbolFileCommon *obj)
virtual Status CalculateFrameVariableError(StackFrame &frame)
Subclasses will override this function to for GetFrameVariableError().
virtual StatsDuration::Duration GetDebugInfoIndexTime()
Return the time it took to index the debug information in the object file.
uint32_t GetAbilities() override
Get a mask of what this symbol file supports for the object file that it was constructed with.
virtual void ParseDeclsForContext(CompilerDeclContext decl_ctx)
virtual uint32_t CalculateNumCompileUnits()=0
virtual ObjectFile * GetMainObjectFile()=0
std::chrono::duration< double > Duration
virtual std::recursive_mutex & GetModuleMutex() const
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
virtual uint32_t GetAbilities()=0
Get a mask of what this symbol file supports for the object file that it was constructed with.
virtual size_t ParseFunctions(CompileUnit &comp_unit)=0
virtual size_t ParseBlocksRecursive(Function &func)=0
virtual llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language)=0
bool m_index_was_loaded_from_cache
An abstraction for Xcode-style SDKs that works like ArchSpec.
virtual void SectionFileAddressesChanged()=0
Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
LanguageType
Programming language type.
virtual uint32_t CalculateAbilities()=0
std::optional< std::vector< lldb::CompUnitSP > > m_compile_units
Represents a generic declaration such as a function declaration.
Containing protected virtual methods for child classes to override.
virtual bool ParseIsOptimized(CompileUnit &comp_unit)
virtual lldb::UnwindPlanSP GetUnwindPlan(const Address &address, const RegisterInfoResolver &resolver)
bool GetDebugInfoIndexWasSavedToCache() const override
bool m_debug_info_had_variable_errors
Set to true if any variable feteching errors have been found when calling GetFrameVariableError().
virtual lldb::TypeSP CopyType(const lldb::TypeSP &other_type)=0
virtual void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list)
void SectionFileAddressesChanged() override
Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
lldb::ObjectFileSP m_objfile_sp
virtual TypeList & GetTypeList()
virtual Type * ResolveTypeUID(lldb::user_id_t type_uid)=0
void Insert(const lldb::TypeSP &type)
void Dump(Stream &s) override
virtual bool ParseLineTable(CompileUnit &comp_unit)=0
static char ID
LLVM RTTI support.
bool Fail() const
Test for error condition.
static char ID
LLVM RTTI support.
virtual size_t ParseTypes(CompileUnit &comp_unit)=0
virtual void Dump(Stream &s)=0
virtual const RegisterInfo * ResolveNumber(lldb::RegisterKind kind, uint32_t number) const =0
virtual void SetDebugInfoHadFrameVariableErrors()=0
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
virtual void InitializeObject()
Initialize the SymbolFile object.
virtual CompilerDeclContext FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx)
virtual bool ParseImportedModules(const SymbolContext &sc, std::vector< SourceModule > &imported_modules)=0
virtual bool ForEachExternalModule(lldb_private::CompileUnit &comp_unit, llvm::DenseSet< lldb_private::SymbolFile * > &visited_symbol_files, llvm::function_ref< bool(Module &)> lambda)
Apply a lambda to each external lldb::Module referenced by this comp_unit.
virtual bool GetLoadDebugInfoEnabled()
Whether debug info will be loaded or not.
uint32_t GetNumCompileUnits() override
string(SUBSTRING ${p} 10 -1 pStripped) if($
virtual const RegisterInfo * ResolveName(llvm::StringRef name) const =0
virtual uint64_t GetDebugInfoSize()=0
Metrics gathering functions.
lldb::TypeSP MakeType(lldb::user_id_t uid, ConstString name, std::optional< uint64_t > byte_size, SymbolContextScope *context, lldb::user_id_t encoding_uid, Type::EncodingDataType encoding_uid_type, const Declaration &decl, const CompilerType &compiler_qual_type, Type::ResolveState compiler_type_resolve_state, uint32_t opaque_payload=0) override
This function is used to create types that belong to a SymbolFile.
Represents a generic declaration context in a program.
bool m_index_was_saved_to_cache
virtual bool ParseSupportFiles(CompileUnit &comp_unit, FileSpecList &support_files)=0
RegisterKind
Register numbering types.
virtual void PreloadSymbols()
Status GetFrameVariableError(StackFrame &frame)
Get an error that describes why variables might be missing for a given symbol context.
virtual bool CompleteType(CompilerType &compiler_type)=0
void SetDebugInfoIndexWasSavedToCache() override
static bool classof(const SymbolFile *obj)
llvm::Expected< lldb::TypeSystemSP > GetTypeSystemForLanguage(lldb::LanguageType language) override
ObjectFile * GetMainObjectFile() override
virtual bool GetDebugInfoIndexWasSavedToCache() const =0
virtual XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit)
Return the Xcode SDK comp_unit was compiled against.
virtual StatsDuration::Duration GetDebugInfoParseTime()
Return the time taken to parse the debug information.
~SymbolFileCommon() override=default
virtual CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid)
void SetDebugInfoHadFrameVariableErrors() override
virtual CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid)
virtual void SetLoadDebugInfoEnabled()
Specify debug info should be loaded.
virtual SymbolFile * GetBackingSymbolFile()
SymbolFileOnDemand class overrides this to return the underlying backing SymbolFile implementation th...
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx)=0
virtual void AddSymbols(Symtab &symtab)
virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit)=0
~SymbolFile() override=default
virtual llvm::Expected< lldb::addr_t > GetParameterStackSize(Symbol &symbol)
Return the number of stack bytes taken up by the parameters to this function.
Generic representation of a type in a programming language.
llvm::SmallVector< uint64_t, 1 > element_orders
lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx) override
virtual bool GetDebugInfoHadFrameVariableErrors() const =0
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
ObjectFile * GetObjectFile() override
virtual lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx)=0
A class that represents a running process on the host machine.
virtual uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
const SymbolFileCommon & operator=(const SymbolFileCommon &)=delete
bool GetDebugInfoHadFrameVariableErrors() const override
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
bool m_calculated_abilities
virtual Symtab * GetSymtab()=0
The characteristics of an array type.
virtual ~RegisterInfoResolver()
virtual bool ParseDebugMacros(CompileUnit &comp_unit)=0
virtual uint32_t GetNumCompileUnits()=0
bool GetDebugInfoIndexWasLoadedFromCache() const override
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
virtual ModuleList GetDebugInfoModules()
Get the additional modules that this symbol file uses to parse debug info.
const SymbolFile & operator=(const SymbolFile &)=delete
virtual std::optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx)=0
If type_uid points to an array type, return its characteristics.
virtual ObjectFile * GetObjectFile()=0
virtual lldb::TypeSP MakeType(lldb::user_id_t uid, ConstString name, std::optional< uint64_t > byte_size, SymbolContextScope *context, lldb::user_id_t encoding_uid, Type::EncodingDataType encoding_uid_type, const Declaration &decl, const CompilerType &compiler_qual_type, Type::ResolveState compiler_type_resolve_state, uint32_t opaque_payload=0)=0
uint64_t GetDebugInfoSize() override
Metrics gathering functions.
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
bool isA(const void *ClassID) const override
LLVM RTTI support.
virtual void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables)
lldb::TypeSP CopyType(const lldb::TypeSP &other_type) override
SymbolFileCommon(lldb::ObjectFileSP objfile_sp)
virtual bool GetDebugInfoIndexWasLoadedFromCache() const =0
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
const ObjectFile * GetObjectFile() const override
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
virtual size_t ParseVariablesForContext(const SymbolContext &sc)=0
Symtab * m_symtab
Do not use m_symtab directly, as it may be freed.
virtual void DumpClangAST(Stream &s)
virtual void SetDebugInfoIndexWasLoadedFromCache()=0