LLDB mainline
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lldb_private::SymbolFileOnDemand Class Reference

SymbolFileOnDemand wraps an actual SymbolFile by providing on demand symbol parsing/indexing to improve performance. More...

#include <SymbolFileOnDemand.h>

Inheritance diagram for lldb_private::SymbolFileOnDemand:
Inheritance graph
[legend]

Public Member Functions

 SymbolFileOnDemand (std::unique_ptr< SymbolFile > &&symbol_file)
 
 ~SymbolFileOnDemand () override
 
llvm::StringRef GetPluginName () override
 
bool GetLoadDebugInfoEnabled () override
 Whether debug info will be loaded or not.
 
void SetLoadDebugInfoEnabled () override
 Specify debug info should be loaded.
 
uint32_t GetNumCompileUnits () override
 
lldb::CompUnitSP GetCompileUnitAtIndex (uint32_t idx) override
 
SymbolFileGetBackingSymbolFile () override
 SymbolFileOnDemand class overrides this to return the underlying backing SymbolFile implementation that loads on-demand.
 
uint32_t CalculateAbilities () override
 
std::recursive_mutex & GetModuleMutex () const override
 Symbols file subclasses should override this to return the Module that owns the TypeSystem that this symbol file modifies type information in.
 
lldb::LanguageType ParseLanguage (lldb_private::CompileUnit &comp_unit) override
 
lldb_private::XcodeSDK ParseXcodeSDK (lldb_private::CompileUnit &comp_unit) override
 Return the Xcode SDK comp_unit was compiled against.
 
void InitializeObject () override
 Initialize the SymbolFile object.
 
size_t ParseFunctions (lldb_private::CompileUnit &comp_unit) override
 
bool ParseLineTable (lldb_private::CompileUnit &comp_unit) override
 
bool ParseDebugMacros (lldb_private::CompileUnit &comp_unit) override
 
bool ForEachExternalModule (lldb_private::CompileUnit &, llvm::DenseSet< lldb_private::SymbolFile * > &, llvm::function_ref< bool(lldb_private::Module &)>) override
 
bool ParseSupportFiles (lldb_private::CompileUnit &comp_unit, lldb_private::SupportFileList &support_files) override
 
bool ParseIsOptimized (lldb_private::CompileUnit &comp_unit) override
 
size_t ParseTypes (lldb_private::CompileUnit &comp_unit) override
 
bool ParseImportedModules (const lldb_private::SymbolContext &sc, std::vector< lldb_private::SourceModule > &imported_modules) override
 
size_t ParseBlocksRecursive (lldb_private::Function &func) override
 
size_t ParseVariablesForContext (const lldb_private::SymbolContext &sc) override
 
lldb_private::TypeResolveTypeUID (lldb::user_id_t type_uid) override
 
std::optional< ArrayInfoGetDynamicArrayInfoForUID (lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx) override
 If type_uid points to an array type, return its characteristics.
 
bool CompleteType (lldb_private::CompilerType &compiler_type) override
 
lldb_private::CompilerDecl GetDeclForUID (lldb::user_id_t uid) override
 
lldb_private::CompilerDeclContext GetDeclContextForUID (lldb::user_id_t uid) override
 
lldb_private::CompilerDeclContext GetDeclContextContainingUID (lldb::user_id_t uid) override
 
void ParseDeclsForContext (lldb_private::CompilerDeclContext decl_ctx) override
 
uint32_t ResolveSymbolContext (const lldb_private::Address &so_addr, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContext &sc) override
 
lldb_private::Status CalculateFrameVariableError (lldb_private::StackFrame &frame) override
 Subclasses will override this function to for GetFrameVariableError().
 
uint32_t ResolveSymbolContext (const lldb_private::SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, lldb_private::SymbolContextList &sc_list) override
 
void Dump (lldb_private::Stream &s) override
 
void DumpClangAST (lldb_private::Stream &s) override
 
void FindGlobalVariables (lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, lldb_private::VariableList &variables) override
 
void FindGlobalVariables (const lldb_private::RegularExpression &regex, uint32_t max_matches, lldb_private::VariableList &variables) override
 
void FindFunctions (const lldb_private::Module::LookupInfo &lookup_info, const lldb_private::CompilerDeclContext &parent_decl_ctx, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
 
void FindFunctions (const lldb_private::RegularExpression &regex, bool include_inlines, lldb_private::SymbolContextList &sc_list) override
 
void GetMangledNamesForFunction (const std::string &scope_qualified_name, std::vector< lldb_private::ConstString > &mangled_names) override
 
void FindTypes (const lldb_private::TypeQuery &query, lldb_private::TypeResults &results) override
 Find types using a type-matching object that contains all search parameters.
 
void GetTypes (lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override
 
llvm::Expected< lldb::TypeSystemSPGetTypeSystemForLanguage (lldb::LanguageType language) override
 
lldb_private::CompilerDeclContext FindNamespace (lldb_private::ConstString name, const lldb_private::CompilerDeclContext &parent_decl_ctx, bool only_root_namespaces) override
 Finds a namespace of name name and whose parent context is parent_decl_ctx.
 
std::vector< std::unique_ptr< lldb_private::CallEdge > > ParseCallEdgesInFunction (UserID func_id) override
 
lldb::UnwindPlanSP GetUnwindPlan (const Address &address, const RegisterInfoResolver &resolver) override
 
llvm::Expected< lldb::addr_tGetParameterStackSize (Symbol &symbol) override
 Return the number of stack bytes taken up by the parameters to this function.
 
void PreloadSymbols () override
 
uint64_t GetDebugInfoSize (bool load_all_debug_info=false) override
 Metrics gathering functions.
 
lldb_private::StatsDuration::Duration GetDebugInfoParseTime () override
 Return the time taken to parse the debug information.
 
lldb_private::StatsDuration::Duration GetDebugInfoIndexTime () override
 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.
 
SymtabGetSymtab () override
 
ObjectFileGetObjectFile () override
 
const ObjectFileGetObjectFile () const override
 
ObjectFileGetMainObjectFile () override
 
void SectionFileAddressesChanged () override
 Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
 
bool GetDebugInfoIndexWasLoadedFromCache () const override
 Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module index cache.
 
void SetDebugInfoIndexWasLoadedFromCache () override
 
bool GetDebugInfoIndexWasSavedToCache () const override
 
void SetDebugInfoIndexWasSavedToCache () override
 
bool GetDebugInfoHadFrameVariableErrors () const override
 Accessors for the bool that indicates if there was debug info, but errors stopped variables from being able to be displayed correctly.
 
void SetDebugInfoHadFrameVariableErrors () override
 
bool GetSeparateDebugInfo (StructuredData::Dictionary &d, bool errors_only) override
 Return true if separate debug info files are supported and this function succeeded, false otherwise.
 
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
 
lldb::TypeSP CopyType (const lldb::TypeSP &other_type) override
 
- Public Member Functions inherited from lldb_private::SymbolFile
 SymbolFile ()=default
 
 ~SymbolFile () override=default
 
virtual SymbolFileGetBackingSymbolFile ()
 SymbolFileOnDemand class overrides this to return the underlying backing SymbolFile implementation that loads on-demand.
 
virtual uint32_t GetAbilities ()=0
 Get a mask of what this symbol file supports for the object file that it was constructed with.
 
virtual uint32_t CalculateAbilities ()=0
 
virtual std::recursive_mutex & GetModuleMutex () const
 Symbols file subclasses should override this to return the Module that owns the TypeSystem that this symbol file modifies type information in.
 
virtual void InitializeObject ()
 Initialize the SymbolFile object.
 
virtual bool GetLoadDebugInfoEnabled ()
 Whether debug info will be loaded or not.
 
virtual void SetLoadDebugInfoEnabled ()
 Specify debug info should be loaded.
 
virtual uint32_t GetNumCompileUnits ()=0
 
virtual lldb::CompUnitSP GetCompileUnitAtIndex (uint32_t idx)=0
 
virtual SymtabGetSymtab ()=0
 
virtual lldb::LanguageType ParseLanguage (CompileUnit &comp_unit)=0
 
virtual XcodeSDK ParseXcodeSDK (CompileUnit &comp_unit)
 Return the Xcode SDK comp_unit was compiled against.
 
virtual llvm::SmallSet< lldb::LanguageType, 4 > ParseAllLanguages (CompileUnit &comp_unit)
 This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as "real" compile units.
 
virtual size_t ParseFunctions (CompileUnit &comp_unit)=0
 
virtual bool ParseLineTable (CompileUnit &comp_unit)=0
 
virtual bool ParseDebugMacros (CompileUnit &comp_unit)=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 ParseSupportFiles (CompileUnit &comp_unit, SupportFileList &support_files)=0
 
virtual size_t ParseTypes (CompileUnit &comp_unit)=0
 
virtual bool ParseIsOptimized (CompileUnit &comp_unit)
 
virtual bool ParseImportedModules (const SymbolContext &sc, std::vector< SourceModule > &imported_modules)=0
 
virtual size_t ParseBlocksRecursive (Function &func)=0
 
virtual size_t ParseVariablesForContext (const SymbolContext &sc)=0
 
virtual TypeResolveTypeUID (lldb::user_id_t type_uid)=0
 
virtual std::optional< ArrayInfoGetDynamicArrayInfoForUID (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 bool CompleteType (CompilerType &compiler_type)=0
 
virtual void ParseDeclsForContext (CompilerDeclContext decl_ctx)
 
virtual CompilerDecl GetDeclForUID (lldb::user_id_t uid)
 
virtual CompilerDeclContext GetDeclContextForUID (lldb::user_id_t uid)
 
virtual CompilerDeclContext GetDeclContextContainingUID (lldb::user_id_t uid)
 
virtual std::vector< CompilerContextGetCompilerContextForUID (lldb::user_id_t uid)
 
virtual uint32_t ResolveSymbolContext (const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
 
Status GetFrameVariableError (StackFrame &frame)
 Get an error that describes why variables might be missing for a given symbol context.
 
virtual Status CalculateFrameVariableError (StackFrame &frame)
 Subclasses will override this function to for GetFrameVariableError().
 
virtual uint32_t ResolveSymbolContext (const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
 
virtual void DumpClangAST (Stream &s)
 
virtual void FindGlobalVariables (ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables)
 
virtual void FindGlobalVariables (const RegularExpression &regex, uint32_t max_matches, VariableList &variables)
 
virtual void FindFunctions (const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list)
 
virtual void FindFunctions (const RegularExpression &regex, bool include_inlines, SymbolContextList &sc_list)
 
virtual void FindTypes (const TypeQuery &query, TypeResults &results)
 Find types using a type-matching object that contains all search parameters.
 
virtual void GetMangledNamesForFunction (const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
 
virtual void GetTypes (lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
 
virtual void PreloadSymbols ()
 
virtual llvm::Expected< lldb::TypeSystemSPGetTypeSystemForLanguage (lldb::LanguageType language)=0
 
virtual CompilerDeclContext FindNamespace (ConstString name, const CompilerDeclContext &parent_decl_ctx, bool only_root_namespaces=false)
 Finds a namespace of name name and whose parent context is parent_decl_ctx.
 
virtual ObjectFileGetObjectFile ()=0
 
virtual const ObjectFileGetObjectFile () const =0
 
virtual ObjectFileGetMainObjectFile ()=0
 
virtual std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction (UserID func_id)
 
virtual void AddSymbols (Symtab &symtab)
 
virtual void SectionFileAddressesChanged ()=0
 Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
 
virtual lldb::UnwindPlanSP GetUnwindPlan (const Address &address, const RegisterInfoResolver &resolver)
 
virtual llvm::Expected< lldb::addr_tGetParameterStackSize (Symbol &symbol)
 Return the number of stack bytes taken up by the parameters to this function.
 
virtual void Dump (Stream &s)=0
 
virtual uint64_t GetDebugInfoSize (bool load_all_debug_info=false)=0
 Metrics gathering functions.
 
virtual StatsDuration::Duration GetDebugInfoParseTime ()
 Return the time taken to parse the debug information.
 
virtual StatsDuration::Duration GetDebugInfoIndexTime ()
 Return the time it took to index the debug information in the object file.
 
virtual ModuleList GetDebugInfoModules ()
 Get the additional modules that this symbol file uses to parse debug info.
 
virtual bool GetDebugInfoHadFrameVariableErrors () const =0
 Accessors for the bool that indicates if there was debug info, but errors stopped variables from being able to be displayed correctly.
 
virtual void SetDebugInfoHadFrameVariableErrors ()=0
 
virtual bool GetSeparateDebugInfo (StructuredData::Dictionary &d, bool errors_only)
 Return true if separate debug info files are supported and this function succeeded, false otherwise.
 
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
 
virtual lldb::TypeSP CopyType (const lldb::TypeSP &other_type)=0
 
std::unordered_map< lldb::CompUnitSP, ArgsGetCompileOptions ()
 Returns a map of compilation unit to the compile option arguments associated with that compilation unit.
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Private Member Functions

LogGetLog () const
 
ConstString GetSymbolFileName ()
 

Private Attributes

bool m_debug_info_enabled = false
 
bool m_preload_symbols = false
 
std::unique_ptr< SymbolFilem_sym_file_impl
 

Static Private Attributes

static char ID
 LLVM RTTI support.
 
bool isA (const void *ClassID) const override
 LLVM RTTI support.
 
static bool classof (const SymbolFile *obj)
 

Additional Inherited Members

- Public Types inherited from lldb_private::SymbolFile
enum  Abilities {
  CompileUnits = (1u << 0) , LineTables = (1u << 1) , Functions = (1u << 2) , Blocks = (1u << 3) ,
  GlobalVariables = (1u << 4) , LocalVariables = (1u << 5) , VariableTypes = (1u << 6) , kAllAbilities = ((1u << 7) - 1u)
}
 
- Static Public Member Functions inherited from lldb_private::SymbolFile
static SymbolFileFindPlugin (lldb::ObjectFileSP objfile_sp)
 
static bool classof (const SymbolFile *obj)
 
- Protected Member Functions inherited from lldb_private::SymbolFile
void AssertModuleLock ()
 
virtual void GetCompileOptions (std::unordered_map< lldb::CompUnitSP, lldb_private::Args > &args)
 

Detailed Description

SymbolFileOnDemand wraps an actual SymbolFile by providing on demand symbol parsing/indexing to improve performance.

By default SymbolFileOnDemand will skip load the underlying symbols. Any client can on demand hydrate the underlying SymbolFile via SymbolFile::SetLoadDebugInfoEnabled().

Definition at line 33 of file SymbolFileOnDemand.h.

Constructor & Destructor Documentation

◆ SymbolFileOnDemand()

SymbolFileOnDemand::SymbolFileOnDemand ( std::unique_ptr< SymbolFile > &&  symbol_file)

Definition at line 22 of file SymbolFileOnDemand.cpp.

◆ ~SymbolFileOnDemand()

SymbolFileOnDemand::~SymbolFileOnDemand ( )
overridedefault

Member Function Documentation

◆ CalculateAbilities()

uint32_t SymbolFileOnDemand::CalculateAbilities ( )
overridevirtual

Implements lldb_private::SymbolFile.

Definition at line 28 of file SymbolFileOnDemand.cpp.

References m_sym_file_impl.

◆ CalculateFrameVariableError()

Status SymbolFileOnDemand::CalculateFrameVariableError ( lldb_private::StackFrame frame)
overridevirtual

Subclasses will override this function to for GetFrameVariableError().

This allows GetFrameVariableError() to set the member variable m_debug_info_had_variable_errors correctly without users having to do it manually which is error prone.

Reimplemented from lldb_private::SymbolFile.

Definition at line 278 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ classof()

static bool lldb_private::SymbolFileOnDemand::classof ( const SymbolFile obj)
inlinestatic

Definition at line 43 of file SymbolFileOnDemand.h.

References ID, and lldb_private::SymbolFile::isA().

◆ CompleteType()

bool SymbolFileOnDemand::CompleteType ( lldb_private::CompilerType compiler_type)
overridevirtual

◆ CopyType()

lldb::TypeSP lldb_private::SymbolFileOnDemand::CopyType ( const lldb::TypeSP other_type)
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 241 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ Dump()

void SymbolFileOnDemand::Dump ( lldb_private::Stream s)
overridevirtual

◆ DumpClangAST()

void SymbolFileOnDemand::DumpClangAST ( lldb_private::Stream s)
overridevirtual

◆ FindFunctions() [1/2]

void SymbolFileOnDemand::FindFunctions ( const lldb_private::Module::LookupInfo lookup_info,
const lldb_private::CompilerDeclContext parent_decl_ctx,
bool  include_inlines,
lldb_private::SymbolContextList sc_list 
)
overridevirtual

◆ FindFunctions() [2/2]

void SymbolFileOnDemand::FindFunctions ( const lldb_private::RegularExpression regex,
bool  include_inlines,
lldb_private::SymbolContextList sc_list 
)
overridevirtual

◆ FindGlobalVariables() [1/2]

void SymbolFileOnDemand::FindGlobalVariables ( const lldb_private::RegularExpression regex,
uint32_t  max_matches,
lldb_private::VariableList variables 
)
overridevirtual

◆ FindGlobalVariables() [2/2]

void SymbolFileOnDemand::FindGlobalVariables ( lldb_private::ConstString  name,
const lldb_private::CompilerDeclContext parent_decl_ctx,
uint32_t  max_matches,
lldb_private::VariableList variables 
)
overridevirtual

◆ FindNamespace()

CompilerDeclContext SymbolFileOnDemand::FindNamespace ( lldb_private::ConstString  name,
const lldb_private::CompilerDeclContext parent_decl_ctx,
bool  only_root_namespaces 
)
overridevirtual

Finds a namespace of name name and whose parent context is parent_decl_ctx.

If

!parent_decl_ctx.IsValid()

then this function will consider all namespaces that match the name. If only_root_namespaces is true, only consider in the search those DIEs that represent top-level namespaces.

Reimplemented from lldb_private::SymbolFile.

Definition at line 467 of file SymbolFileOnDemand.cpp.

References lldb_private::SymbolFile::FindNamespace(), GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ FindTypes()

void SymbolFileOnDemand::FindTypes ( const lldb_private::TypeQuery query,
lldb_private::TypeResults results 
)
overridevirtual

Find types using a type-matching object that contains all search parameters.

See also
lldb_private::TypeQuery
Parameters
[in]queryA type matching object that contains all of the details of the type search.
[in]resultsAny matching types will be populated into the results object using TypeMap::InsertUnique(...).

Reimplemented from lldb_private::SymbolFile.

Definition at line 434 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ ForEachExternalModule()

bool SymbolFileOnDemand::ForEachExternalModule ( lldb_private::CompileUnit ,
llvm::DenseSet< lldb_private::SymbolFile * > &  ,
llvm::function_ref< bool(lldb_private::Module &)>   
)
override

◆ GetAbilities()

uint32_t SymbolFileOnDemand::GetAbilities ( )
overridevirtual

Get a mask of what this symbol file supports for the object file that it was constructed with.

Each symbol file gets to respond with a mask of abilities that it supports for each object file. This happens when we are trying to figure out which symbol file plug-in will get used for a given object file. The plug-in that responds with the best mix of "SymbolFile::Abilities" bits set, will get chosen to be the symbol file parser. This allows each plug-in to check for sections that contain data a symbol file plug-in would need. For example the DWARF plug-in requires DWARF sections in a file that contain debug information. If the DWARF plug-in doesn't find these sections, it won't respond with many ability bits set, and we will probably fall back to the symbol table SymbolFile plug-in which uses any information in the symbol table. Also, plug-ins might check for some specific symbols in a symbol table in the case where the symbol table contains debug information (STABS and COFF). Not a lot of work should happen in these functions as the plug-in might not get selected due to another plug-in having more abilities. Any initialization work should be saved for "void SymbolFile::InitializeObject()" which will get called on the SymbolFile object with the best set of abilities.

Returns
A uint32_t mask containing bits from the SymbolFile::Abilities enumeration. Any bits that are set represent an ability that this symbol plug-in can parse from the object file.

Implements lldb_private::SymbolFile.

Definition at line 580 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ GetBackingSymbolFile()

SymbolFile * lldb_private::SymbolFileOnDemand::GetBackingSymbolFile ( )
inlineoverridevirtual

SymbolFileOnDemand class overrides this to return the underlying backing SymbolFile implementation that loads on-demand.

Reimplemented from lldb_private::SymbolFile.

Definition at line 59 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetCompileUnitAtIndex()

CompUnitSP SymbolFileOnDemand::GetCompileUnitAtIndex ( uint32_t  idx)
overridevirtual

Implements lldb_private::SymbolFile.

Definition at line 574 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ GetDebugInfoHadFrameVariableErrors()

bool lldb_private::SymbolFileOnDemand::GetDebugInfoHadFrameVariableErrors ( ) const
inlineoverridevirtual

Accessors for the bool that indicates if there was debug info, but errors stopped variables from being able to be displayed correctly.

See GetFrameVariableError() for details on what are considered errors.

Implements lldb_private::SymbolFile.

Definition at line 215 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetDebugInfoIndexTime()

StatsDuration::Duration SymbolFileOnDemand::GetDebugInfoIndexTime ( )
overridevirtual

Return the time it took to index the debug information in the object file.

Returns
0.0 if the file doesn't need to be indexed or if it hasn't been indexed yet, or a valid duration if it has.

Reimplemented from lldb_private::SymbolFile.

Definition at line 551 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ GetDebugInfoIndexWasLoadedFromCache()

bool lldb_private::SymbolFileOnDemand::GetDebugInfoIndexWasLoadedFromCache ( ) const
inlineoverridevirtual

Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module index cache.

In statistics it is handy to know if a module's debug info was loaded from or saved to the cache. When the debug info index is loaded from the cache startup times can be faster. When the cache is enabled and the debug info index is saved to the cache, debug sessions can be slower. These accessors can be accessed by the statistics and emitted to help track these costs.

Implements lldb_private::SymbolFile.

Definition at line 203 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetDebugInfoIndexWasSavedToCache()

bool lldb_private::SymbolFileOnDemand::GetDebugInfoIndexWasSavedToCache ( ) const
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 209 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetDebugInfoParseTime()

StatsDuration::Duration SymbolFileOnDemand::GetDebugInfoParseTime ( )
overridevirtual

Return the time taken to parse the debug information.

Returns
0.0 if no information has been parsed or if there is no computational cost to parsing the debug information.

Reimplemented from lldb_private::SymbolFile.

Definition at line 544 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ GetDebugInfoSize()

uint64_t SymbolFileOnDemand::GetDebugInfoSize ( bool  load_all_debug_info = false)
overridevirtual

Metrics gathering functions.

Return the size in bytes of all loaded debug information or total possible debug info in the symbol file.

If the debug information is contained in sections of an ObjectFile, then this call should add the size of all sections that contain debug information. Symbols the symbol tables are not considered debug information for this call to make it easy and quick for this number to be calculated. If the symbol file is all debug information, the size of the entire file should be returned. The default implementation of this function will iterate over all sections in a module and add up their debug info only section byte sizes.

Parameters
load_all_debug_infoIf true, force loading any symbol files if they are not yet loaded and add to the total size. Default to false.
Returns
Total currently loaded debug info size in bytes

Implements lldb_private::SymbolFile.

Definition at line 537 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ GetDeclContextContainingUID()

CompilerDeclContext SymbolFileOnDemand::GetDeclContextContainingUID ( lldb::user_id_t  uid)
overridevirtual

◆ GetDeclContextForUID()

CompilerDeclContext SymbolFileOnDemand::GetDeclContextForUID ( lldb::user_id_t  uid)
overridevirtual

◆ GetDeclForUID()

CompilerDecl SymbolFileOnDemand::GetDeclForUID ( lldb::user_id_t  uid)
overridevirtual

◆ GetDynamicArrayInfoForUID()

std::optional< SymbolFile::ArrayInfo > SymbolFileOnDemand::GetDynamicArrayInfoForUID ( lldb::user_id_t  type_uid,
const lldb_private::ExecutionContext exe_ctx 
)
overridevirtual

If type_uid points to an array type, return its characteristics.

To support variable-length array types, this function takes an optional ExecutionContext. If exe_ctx is non-null, the dynamic characteristics for that context are returned.

Implements lldb_private::SymbolFile.

Definition at line 202 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ GetLoadDebugInfoEnabled()

bool lldb_private::SymbolFileOnDemand::GetLoadDebugInfoEnabled ( )
inlineoverridevirtual

Whether debug info will be loaded or not.

It will be true for most implementations except SymbolFileOnDemand.

Reimplemented from lldb_private::SymbolFile.

Definition at line 52 of file SymbolFileOnDemand.h.

References m_debug_info_enabled.

◆ GetLog()

Log * lldb_private::SymbolFileOnDemand::GetLog ( ) const
inlineprivate

◆ GetMainObjectFile()

ObjectFile * lldb_private::SymbolFileOnDemand::GetMainObjectFile ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 195 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetMangledNamesForFunction()

void SymbolFileOnDemand::GetMangledNamesForFunction ( const std::string &  scope_qualified_name,
std::vector< lldb_private::ConstString > &  mangled_names 
)
overridevirtual

◆ GetModuleMutex()

std::recursive_mutex & SymbolFileOnDemand::GetModuleMutex ( ) const
overridevirtual

Symbols file subclasses should override this to return the Module that owns the TypeSystem that this symbol file modifies type information in.

Reimplemented from lldb_private::SymbolFile.

Definition at line 34 of file SymbolFileOnDemand.cpp.

References m_sym_file_impl.

◆ GetNumCompileUnits()

uint32_t SymbolFileOnDemand::GetNumCompileUnits ( )
overridevirtual

Implements lldb_private::SymbolFile.

Definition at line 568 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ GetObjectFile() [1/2]

const ObjectFile * lldb_private::SymbolFileOnDemand::GetObjectFile ( ) const
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 192 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetObjectFile() [2/2]

ObjectFile * lldb_private::SymbolFileOnDemand::GetObjectFile ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 189 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

Referenced by GetSymbolFileName().

◆ GetParameterStackSize()

llvm::Expected< lldb::addr_t > SymbolFileOnDemand::GetParameterStackSize ( Symbol symbol)
overridevirtual

Return the number of stack bytes taken up by the parameters to this function.

Reimplemented from lldb_private::SymbolFile.

Definition at line 510 of file SymbolFileOnDemand.cpp.

References GetLog(), lldb_private::Symbol::GetName(), lldb_private::SymbolFile::GetParameterStackSize(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ GetPluginName()

llvm::StringRef lldb_private::SymbolFileOnDemand::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 50 of file SymbolFileOnDemand.h.

◆ GetSeparateDebugInfo()

bool lldb_private::SymbolFileOnDemand::GetSeparateDebugInfo ( StructuredData::Dictionary d,
bool  errors_only 
)
inlineoverridevirtual

Return true if separate debug info files are supported and this function succeeded, false otherwise.

Parameters
[out]dIf this function succeeded, then this will be a dictionary that contains the keys "type", "symfile", and "separate-debug-info-files". "type" can be used to assume the structure of each object in "separate-debug-info-files".
errors_onlyIf true, then only return separate debug info files that encountered errors during loading. If false, then return all expected separate debug info files, regardless of whether they were successfully loaded.

Reimplemented from lldb_private::SymbolFile.

Definition at line 222 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ GetSymbolFileName()

ConstString lldb_private::SymbolFileOnDemand::GetSymbolFileName ( )
inlineprivate

◆ GetSymtab()

Symtab * lldb_private::SymbolFileOnDemand::GetSymtab ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 187 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

Referenced by FindFunctions(), and FindGlobalVariables().

◆ GetTypes()

void SymbolFileOnDemand::GetTypes ( lldb_private::SymbolContextScope sc_scope,
lldb::TypeClass  type_mask,
lldb_private::TypeList type_list 
)
overridevirtual

◆ GetTypeSystemForLanguage()

llvm::Expected< lldb::TypeSystemSP > SymbolFileOnDemand::GetTypeSystemForLanguage ( lldb::LanguageType  language)
overridevirtual

◆ GetUnwindPlan()

lldb::UnwindPlanSP SymbolFileOnDemand::GetUnwindPlan ( const Address address,
const RegisterInfoResolver resolver 
)
overridevirtual

◆ InitializeObject()

void SymbolFileOnDemand::InitializeObject ( )
overridevirtual

Initialize the SymbolFile object.

The SymbolFile object with the best set of abilities (detected in "uint32_t SymbolFile::GetAbilities()) will have this function called if it is chosen to parse an object file. More complete initialization can happen in this function which will get called prior to any other functions in the SymbolFile protocol.

Reimplemented from lldb_private::SymbolFile.

Definition at line 38 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

Referenced by SetLoadDebugInfoEnabled().

◆ isA()

bool lldb_private::SymbolFileOnDemand::isA ( const void *  ClassID) const
inlineoverridevirtual

LLVM RTTI support.

Reimplemented from lldb_private::SymbolFile.

Definition at line 40 of file SymbolFileOnDemand.h.

References ID, and lldb_private::SymbolFile::isA().

◆ MakeType()

lldb::TypeSP lldb_private::SymbolFileOnDemand::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 
)
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 227 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ ParseBlocksRecursive()

size_t SymbolFileOnDemand::ParseBlocksRecursive ( lldb_private::Function func)
overridevirtual

◆ ParseCallEdgesInFunction()

std::vector< std::unique_ptr< lldb_private::CallEdge > > SymbolFileOnDemand::ParseCallEdgesInFunction ( UserID  func_id)
overridevirtual

◆ ParseDebugMacros()

bool SymbolFileOnDemand::ParseDebugMacros ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseDeclsForContext()

void SymbolFileOnDemand::ParseDeclsForContext ( lldb_private::CompilerDeclContext  decl_ctx)
overridevirtual

◆ ParseFunctions()

size_t SymbolFileOnDemand::ParseFunctions ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseImportedModules()

bool SymbolFileOnDemand::ParseImportedModules ( const lldb_private::SymbolContext sc,
std::vector< lldb_private::SourceModule > &  imported_modules 
)
overridevirtual

◆ ParseIsOptimized()

bool SymbolFileOnDemand::ParseIsOptimized ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseLanguage()

lldb::LanguageType SymbolFileOnDemand::ParseLanguage ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseLineTable()

bool SymbolFileOnDemand::ParseLineTable ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseSupportFiles()

bool SymbolFileOnDemand::ParseSupportFiles ( lldb_private::CompileUnit comp_unit,
lldb_private::SupportFileList support_files 
)
overridevirtual

Implements lldb_private::SymbolFile.

Definition at line 117 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), LLDB_LOG, and m_sym_file_impl.

◆ ParseTypes()

size_t SymbolFileOnDemand::ParseTypes ( lldb_private::CompileUnit comp_unit)
overridevirtual

◆ ParseVariablesForContext()

size_t SymbolFileOnDemand::ParseVariablesForContext ( const lldb_private::SymbolContext sc)
overridevirtual

◆ ParseXcodeSDK()

XcodeSDK SymbolFileOnDemand::ParseXcodeSDK ( lldb_private::CompileUnit comp_unit)
overridevirtual

Return the Xcode SDK comp_unit was compiled against.

Reimplemented from lldb_private::SymbolFile.

Definition at line 61 of file SymbolFileOnDemand.cpp.

References GetLog(), lldb_private::XcodeSDK::GetString(), GetSymbolFileName(), LLDB_LOG, m_debug_info_enabled, and m_sym_file_impl.

◆ PreloadSymbols()

void SymbolFileOnDemand::PreloadSymbols ( )
overridevirtual

◆ ResolveSymbolContext() [1/2]

uint32_t lldb_private::SymbolFileOnDemand::ResolveSymbolContext ( const lldb_private::Address so_addr,
lldb::SymbolContextItem  resolve_scope,
lldb_private::SymbolContext sc 
)
overridevirtual

◆ ResolveSymbolContext() [2/2]

uint32_t lldb_private::SymbolFileOnDemand::ResolveSymbolContext ( const lldb_private::SourceLocationSpec src_location_spec,
lldb::SymbolContextItem  resolve_scope,
lldb_private::SymbolContextList sc_list 
)
overridevirtual

Reimplemented from lldb_private::SymbolFile.

◆ ResolveTypeUID()

Type * SymbolFileOnDemand::ResolveTypeUID ( lldb::user_id_t  type_uid)
overridevirtual

◆ SectionFileAddressesChanged()

void lldb_private::SymbolFileOnDemand::SectionFileAddressesChanged ( )
inlineoverridevirtual

Notify the SymbolFile that the file addresses in the Sections for this module have been changed.

Implements lldb_private::SymbolFile.

Definition at line 199 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ SetDebugInfoHadFrameVariableErrors()

void lldb_private::SymbolFileOnDemand::SetDebugInfoHadFrameVariableErrors ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 218 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ SetDebugInfoIndexWasLoadedFromCache()

void lldb_private::SymbolFileOnDemand::SetDebugInfoIndexWasLoadedFromCache ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 206 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ SetDebugInfoIndexWasSavedToCache()

void lldb_private::SymbolFileOnDemand::SetDebugInfoIndexWasSavedToCache ( )
inlineoverridevirtual

Implements lldb_private::SymbolFile.

Definition at line 212 of file SymbolFileOnDemand.h.

References m_sym_file_impl.

◆ SetLoadDebugInfoEnabled()

void SymbolFileOnDemand::SetLoadDebugInfoEnabled ( )
overridevirtual

Specify debug info should be loaded.

It will be no-op for most implementations except SymbolFileOnDemand.

Reimplemented from lldb_private::SymbolFile.

Definition at line 558 of file SymbolFileOnDemand.cpp.

References GetLog(), GetSymbolFileName(), InitializeObject(), LLDB_LOG, m_debug_info_enabled, m_preload_symbols, and PreloadSymbols().

Referenced by FindFunctions(), and FindGlobalVariables().

Member Data Documentation

◆ ID

char SymbolFileOnDemand::ID
staticprivate

LLVM RTTI support.

Definition at line 35 of file SymbolFileOnDemand.h.

Referenced by classof(), and isA().

◆ m_debug_info_enabled

bool lldb_private::SymbolFileOnDemand::m_debug_info_enabled = false
private

◆ m_preload_symbols

bool lldb_private::SymbolFileOnDemand::m_preload_symbols = false
private

Definition at line 254 of file SymbolFileOnDemand.h.

Referenced by PreloadSymbols(), and SetLoadDebugInfoEnabled().

◆ m_sym_file_impl

std::unique_ptr<SymbolFile> lldb_private::SymbolFileOnDemand::m_sym_file_impl
private

The documentation for this class was generated from the following files: