LLDB  mainline
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
lldb_private::SymbolFileCommon Class Referenceabstract

Containing protected virtual methods for child classes to override. More...

#include <SymbolFile.h>

Inheritance diagram for lldb_private::SymbolFileCommon:
Inheritance graph
Collaboration diagram for lldb_private::SymbolFileCommon:
Collaboration graph

Public Member Functions

 SymbolFileCommon (lldb::ObjectFileSP objfile_sp)
 ~SymbolFileCommon () override=default
uint32_t GetAbilities () override
 Get a mask of what this symbol file supports for the object file that it was constructed with. More...
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. More...
uint32_t GetNumCompileUnits () override
lldb::CompUnitSP GetCompileUnitAtIndex (uint32_t idx) override
llvm::Expected< lldb_private::TypeSystem & > GetTypeSystemForLanguage (lldb::LanguageType language) override
void Dump (Stream &s) override
uint64_t GetDebugInfoSize () override
 Metrics gathering functions. More...
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. More...
void SetDebugInfoIndexWasLoadedFromCache () override
bool GetDebugInfoIndexWasSavedToCache () const override
void SetDebugInfoIndexWasSavedToCache () 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. More...
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. More...
virtual void InitializeObject ()
 Initialize the SymbolFile object. More...
virtual bool GetLoadDebugInfoEnabled ()
 Whether debug info will be loaded or not. More...
virtual void SetLoadDebugInfoEnabled ()
 Specify debug info should be loaded. More...
virtual lldb::LanguageType ParseLanguage (CompileUnit &comp_unit)=0
virtual XcodeSDK ParseXcodeSDK (CompileUnit &comp_unit)
 Return the Xcode SDK comp_unit was compiled against. More...
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. More...
virtual bool ParseSupportFiles (CompileUnit &comp_unit, FileSpecList &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 llvm::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. More...
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 uint32_t ResolveSymbolContext (const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
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 (ConstString name, const CompilerDeclContext &parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, SymbolContextList &sc_list)
virtual void FindFunctions (const RegularExpression &regex, bool include_inlines, SymbolContextList &sc_list)
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 FindTypes (llvm::ArrayRef< CompilerContext > pattern, LanguageSet languages, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, TypeMap &types)
 Find types specified by a CompilerContextPattern. More...
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 CompilerDeclContext FindNamespace (ConstString name, const CompilerDeclContext &parent_decl_ctx)
virtual std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction (UserID func_id)
virtual void AddSymbols (Symtab &symtab)
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. More...
virtual StatsDuration::Duration GetDebugInfoParseTime ()
 Return the time taken to parse the debug information. More...
virtual StatsDuration::Duration GetDebugInfoIndexTime ()
 Return the time it took to index the debug information in the object file. More...
virtual ModuleList GetDebugInfoModules ()
 Get the additional modules that this symbol file uses to parse debug info. More...
- 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

Protected Member Functions

virtual uint32_t CalculateNumCompileUnits ()=0
virtual lldb::CompUnitSP ParseCompileUnitAtIndex (uint32_t idx)=0
virtual TypeListGetTypeList ()
void SetCompileUnitAtIndex (uint32_t idx, const lldb::CompUnitSP &cu_sp)
- Protected Member Functions inherited from lldb_private::SymbolFile
void AssertModuleLock ()

Protected Attributes

lldb::ObjectFileSP m_objfile_sp
llvm::Optional< std::vector< lldb::CompUnitSP > > m_compile_units
TypeList m_type_list
Symtabm_symtab = nullptr
uint32_t m_abilities = 0
bool m_calculated_abilities = false
bool m_index_was_loaded_from_cache = false
bool m_index_was_saved_to_cache = false

Private Member Functions

 SymbolFileCommon (const SymbolFileCommon &)=delete
const SymbolFileCommonoperator= (const SymbolFileCommon &)=delete

Static Private Attributes

static char ID
 LLVM RTTI support. More...
bool isA (const void *ClassID) const override
 LLVM RTTI support. More...
static bool classof (const SymbolFileCommon *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)

Detailed Description

Containing protected virtual methods for child classes to override.

Most actual SymbolFile implementations should inherit from this class.

Definition at line 374 of file SymbolFile.h.

Constructor & Destructor Documentation

◆ SymbolFileCommon() [1/2]

lldb_private::SymbolFileCommon::SymbolFileCommon ( lldb::ObjectFileSP  objfile_sp)

Definition at line 388 of file SymbolFile.h.

◆ ~SymbolFileCommon()

lldb_private::SymbolFileCommon::~SymbolFileCommon ( )

◆ SymbolFileCommon() [2/2]

lldb_private::SymbolFileCommon::SymbolFileCommon ( const SymbolFileCommon )

Member Function Documentation

◆ CalculateNumCompileUnits()

virtual uint32_t lldb_private::SymbolFileCommon::CalculateNumCompileUnits ( )
protectedpure virtual

◆ classof()

static bool lldb_private::SymbolFileCommon::classof ( const SymbolFileCommon obj)

Definition at line 384 of file SymbolFile.h.

References ID, and isA().

◆ Dump()

void SymbolFileCommon::Dump ( Stream s)

◆ GetAbilities()

uint32_t lldb_private::SymbolFileCommon::GetAbilities ( )

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.

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 393 of file SymbolFile.h.

References lldb_private::SymbolFile::CalculateAbilities(), m_abilities, and m_calculated_abilities.

◆ GetCompileUnitAtIndex()

CompUnitSP SymbolFileCommon::GetCompileUnitAtIndex ( uint32_t  idx)

Implements lldb_private::SymbolFile.

Definition at line 204 of file SymbolFile.cpp.

Referenced by SymbolFileDWARF::GetDWOId().

◆ GetDebugInfoIndexWasLoadedFromCache()

bool lldb_private::SymbolFileCommon::GetDebugInfoIndexWasLoadedFromCache ( ) const

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 425 of file SymbolFile.h.

References m_index_was_loaded_from_cache.

◆ GetDebugInfoIndexWasSavedToCache()

bool lldb_private::SymbolFileCommon::GetDebugInfoIndexWasSavedToCache ( ) const

Implements lldb_private::SymbolFile.

Definition at line 431 of file SymbolFile.h.

References m_index_was_saved_to_cache.

◆ GetDebugInfoSize()

uint64_t SymbolFileCommon::GetDebugInfoSize ( )

Metrics gathering functions.

Return the size in bytes of all debug information 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.

Implements lldb_private::SymbolFile.

Reimplemented in lldb_private::breakpad::SymbolFileBreakpad, and lldb_private::npdb::SymbolFileNativePDB.

Definition at line 241 of file SymbolFile.cpp.

References lldb_private::SectionList::GetDebugInfoSize().

◆ GetMainObjectFile()

ObjectFile * SymbolFileCommon::GetMainObjectFile ( )

Implements lldb_private::SymbolFile.

Definition at line 181 of file SymbolFile.cpp.

References lldb_private::ModuleChild::GetModule().

◆ GetNumCompileUnits()

uint32_t SymbolFileCommon::GetNumCompileUnits ( )

◆ GetObjectFile() [1/2]

const ObjectFile* lldb_private::SymbolFileCommon::GetObjectFile ( ) const

Implements lldb_private::SymbolFile.

Definition at line 404 of file SymbolFile.h.

References m_objfile_sp.

◆ GetObjectFile() [2/2]

ObjectFile* lldb_private::SymbolFileCommon::GetObjectFile ( )

Implements lldb_private::SymbolFile.

Definition at line 403 of file SymbolFile.h.

References m_objfile_sp.

Referenced by SymbolFilePDB::CompleteType(), SymbolFileDWARF::CompleteType(), lldb_private::npdb::SymbolFileNativePDB::CreateConstantSymbol(), lldb_private::npdb::SymbolFileNativePDB::CreateGlobalVariable(), lldb_private::npdb::SymbolFileNativePDB::CreateLocalVariable(), SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), DWARFDebugInfoEntry::Extract(), SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(), SymbolFileDWARF::FindFunctions(), SymbolFileDWARF::FindGlobalVariables(), SymbolFileDWARF::FindNamespace(), DWARFUnit::GetByteOrder(), SymbolFileDWARFDebugMap::GetDebugInfoModules(), DWARFUnit::GetDIE(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), SymbolFileDWARF::GetDwpSymbolFile(), SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(), SymbolFileDWARF::GetGlobalAranges(), SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), SymbolFileDWARF::GetModuleMutex(), GetRangesOrReportError(), DWARFUnit::GetRnglistData(), DWARFUnit::GetRnglistTable(), SymbolFileDWARF::GetTypeForDIE(), SymbolFileDWARF::GetTypeUnitSupportFiles(), SymbolFileDWARF::InitializeObject(), SymbolFileDWARFDebugMap::LinkOSOAddress(), SymbolFileDWARF::ParseAndAppendGlobalVariable(), SymbolFileDWARF::ParseBlocksRecursive(), SymbolFileDWARF::ParseCallEdgesInFunction(), DWARFASTParserClang::ParseChildMembers(), SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(), DWARFASTParserClang::ParseObjCProperty(), DWARFASTParserClang::ParseSingleMember(), SymbolFileDWARF::ParseVariableDIE(), SymbolFilePDB::ParseVariableForPDBData(), PrepareContextToReceiveMembers(), DWARFFormValue::Reference(), SymbolFileDWARF::ResolveType(), SymbolFileDWARF::ResolveTypeUID(), DWARFUnit::SetLoclistsBase(), and SymbolFileDWARF::UpdateExternalModuleListIfNeeded().

◆ GetSymtab()

Symtab * SymbolFileCommon::GetSymtab ( )

Implements lldb_private::SymbolFile.

Definition at line 166 of file SymbolFile.cpp.

Referenced by SymbolFileDWARF::PreloadSymbols().

◆ GetTypeList()

virtual TypeList& lldb_private::SymbolFileCommon::GetTypeList ( )

◆ GetTypeSystemForLanguage()

llvm::Expected< TypeSystem & > SymbolFileCommon::GetTypeSystemForLanguage ( lldb::LanguageType  language)

◆ isA()

bool lldb_private::SymbolFileCommon::isA ( const void *  ClassID) const

◆ operator=()

const SymbolFileCommon& lldb_private::SymbolFileCommon::operator= ( const SymbolFileCommon )

◆ ParseCompileUnitAtIndex()

virtual lldb::CompUnitSP lldb_private::SymbolFileCommon::ParseCompileUnitAtIndex ( uint32_t  idx)
protectedpure virtual

◆ SectionFileAddressesChanged()

void SymbolFileCommon::SectionFileAddressesChanged ( )

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

Implements lldb_private::SymbolFile.

Definition at line 185 of file SymbolFile.cpp.

References lldb_private::ObjectFile::SectionFileAddressesChanged().

◆ SetCompileUnitAtIndex()

void SymbolFileCommon::SetCompileUnitAtIndex ( uint32_t  idx,
const lldb::CompUnitSP &  cu_sp 

◆ SetDebugInfoIndexWasLoadedFromCache()

void lldb_private::SymbolFileCommon::SetDebugInfoIndexWasLoadedFromCache ( )

Implements lldb_private::SymbolFile.

Definition at line 428 of file SymbolFile.h.

References m_index_was_loaded_from_cache.

◆ SetDebugInfoIndexWasSavedToCache()

void lldb_private::SymbolFileCommon::SetDebugInfoIndexWasSavedToCache ( )

Implements lldb_private::SymbolFile.

Definition at line 434 of file SymbolFile.h.

References m_index_was_saved_to_cache.

Member Data Documentation

◆ ID

char SymbolFileCommon::ID

LLVM RTTI support.

Definition at line 376 of file SymbolFile.h.

Referenced by classof(), and isA().

◆ m_abilities

uint32_t lldb_private::SymbolFileCommon::m_abilities = 0

Definition at line 451 of file SymbolFile.h.

Referenced by GetAbilities().

◆ m_calculated_abilities

bool lldb_private::SymbolFileCommon::m_calculated_abilities = false

Definition at line 452 of file SymbolFile.h.

Referenced by GetAbilities().

◆ m_compile_units

llvm::Optional<std::vector<lldb::CompUnitSP> > lldb_private::SymbolFileCommon::m_compile_units

Definition at line 448 of file SymbolFile.h.

◆ m_index_was_loaded_from_cache

bool lldb_private::SymbolFileCommon::m_index_was_loaded_from_cache = false

◆ m_index_was_saved_to_cache

bool lldb_private::SymbolFileCommon::m_index_was_saved_to_cache = false

◆ m_objfile_sp

lldb::ObjectFileSP lldb_private::SymbolFileCommon::m_objfile_sp

◆ m_symtab

Symtab* lldb_private::SymbolFileCommon::m_symtab = nullptr

Definition at line 450 of file SymbolFile.h.

◆ m_type_list

TypeList lldb_private::SymbolFileCommon::m_type_list

Definition at line 449 of file SymbolFile.h.

Referenced by GetTypeList().

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