LLDB  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lldb_private::SymbolFile Class Referenceabstract

#include <SymbolFile.h>

Inheritance diagram for lldb_private::SymbolFile:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::SymbolFile:
Collaboration graph
[legend]

Classes

struct  ArrayInfo
 The characteristics of an array type. More...
 

Public Types

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)
}
 

Public Member Functions

 SymbolFile (ObjectFile *obj_file)
 
 ~SymbolFile () override
 
uint32_t GetAbilities ()
 Get a mask of what this symbol file supports for the object file that it was constructed with. 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 uint32_t GetNumCompileUnits ()=0
 
virtual lldb::CompUnitSP ParseCompileUnitAtIndex (uint32_t index)=0
 
virtual lldb::LanguageType ParseLanguage (CompileUnit &comp_unit)=0
 
virtual size_t ParseFunctions (CompileUnit &comp_unit)=0
 
virtual bool ParseLineTable (CompileUnit &comp_unit)=0
 
virtual bool ParseDebugMacros (CompileUnit &comp_unit)=0
 
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 FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
 
virtual void DumpClangAST (Stream &s)
 
virtual uint32_t FindGlobalVariables (ConstString name, const CompilerDeclContext *parent_decl_ctx, uint32_t max_matches, VariableList &variables)
 
virtual uint32_t FindGlobalVariables (const RegularExpression &regex, uint32_t max_matches, VariableList &variables)
 
virtual uint32_t FindFunctions (ConstString name, const CompilerDeclContext *parent_decl_ctx, lldb::FunctionNameType name_type_mask, bool include_inlines, bool append, SymbolContextList &sc_list)
 
virtual uint32_t FindFunctions (const RegularExpression &regex, bool include_inlines, bool append, SymbolContextList &sc_list)
 
virtual uint32_t FindTypes (ConstString name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types)
 
virtual size_t FindTypes (const std::vector< CompilerContext > &context, bool append, TypeMap &types)
 
virtual void GetMangledNamesForFunction (const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
 
virtual TypeListGetTypeList ()
 
virtual size_t GetTypes (lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
 
virtual void PreloadSymbols ()
 
virtual lldb_private::TypeSystemGetTypeSystemForLanguage (lldb::LanguageType language)
 
virtual CompilerDeclContext FindNamespace (ConstString name, const CompilerDeclContext *parent_decl_ctx)
 
ObjectFileGetObjectFile ()
 
const ObjectFileGetObjectFile () const
 
virtual std::vector< CallEdgeParseCallEdgesInFunction (UserID func_id)
 
virtual void AddSymbols (Symtab &symtab)
 
virtual void SectionFileAddressesChanged ()
 Notify the SymbolFile that the file addresses in the Sections for this module have been changed. More...
 
virtual void Dump (Stream &s)
 
- Public Member Functions inherited from lldb_private::PluginInterface
virtual ~PluginInterface ()
 
virtual ConstString GetPluginName ()=0
 
virtual uint32_t GetPluginVersion ()=0
 

Static Public Member Functions

static SymbolFileFindPlugin (ObjectFile *obj_file)
 

Protected Member Functions

void AssertModuleLock ()
 

Protected Attributes

ObjectFilem_obj_file
 
uint32_t m_abilities
 
bool m_calculated_abilities
 

Detailed Description

Definition at line 33 of file SymbolFile.h.

Member Enumeration Documentation

◆ Abilities

Enumerator
CompileUnits 
LineTables 
Functions 
Blocks 
GlobalVariables 
LocalVariables 
VariableTypes 
kAllAbilities 

Definition at line 41 of file SymbolFile.h.

Constructor & Destructor Documentation

◆ SymbolFile()

lldb_private::SymbolFile::SymbolFile ( ObjectFile obj_file)
inline

Definition at line 55 of file SymbolFile.h.

Referenced by SymbolFileDWARFDebugMap::GetOSOIndexFromUserID().

◆ ~SymbolFile()

lldb_private::SymbolFile::~SymbolFile ( )
inlineoverride

Definition at line 58 of file SymbolFile.h.

Member Function Documentation

◆ AddSymbols()

virtual void lldb_private::SymbolFile::AddSymbols ( Symtab symtab)
inlinevirtual

◆ AssertModuleLock()

void SymbolFile::AssertModuleLock ( )
protected

Definition at line 158 of file SymbolFile.cpp.

References GetModuleMutex().

Referenced by Dump().

◆ CalculateAbilities()

virtual uint32_t lldb_private::SymbolFile::CalculateAbilities ( )
pure virtual

◆ CompleteType()

virtual bool lldb_private::SymbolFile::CompleteType ( CompilerType compiler_type)
pure virtual

◆ Dump()

virtual void lldb_private::SymbolFile::Dump ( Stream s)
inlinevirtual

Reimplemented in SymbolFileDWARF.

Definition at line 226 of file SymbolFile.h.

References AssertModuleLock().

◆ DumpClangAST()

virtual void lldb_private::SymbolFile::DumpClangAST ( Stream s)
inlinevirtual

◆ FindFunctions() [1/2]

uint32_t SymbolFile::FindFunctions ( ConstString  name,
const CompilerDeclContext parent_decl_ctx,
lldb::FunctionNameType  name_type_mask,
bool  include_inlines,
bool  append,
SymbolContextList sc_list 
)
virtual

◆ FindFunctions() [2/2]

uint32_t SymbolFile::FindFunctions ( const RegularExpression regex,
bool  include_inlines,
bool  append,
SymbolContextList sc_list 
)
virtual

◆ FindGlobalVariables() [1/2]

uint32_t SymbolFile::FindGlobalVariables ( ConstString  name,
const CompilerDeclContext parent_decl_ctx,
uint32_t  max_matches,
VariableList variables 
)
virtual

◆ FindGlobalVariables() [2/2]

uint32_t SymbolFile::FindGlobalVariables ( const RegularExpression regex,
uint32_t  max_matches,
VariableList variables 
)
virtual

Reimplemented in SymbolFileDWARF, SymbolFilePDB, and SymbolFileDWARFDebugMap.

Definition at line 111 of file SymbolFile.cpp.

◆ FindNamespace()

virtual CompilerDeclContext lldb_private::SymbolFile::FindNamespace ( ConstString  name,
const CompilerDeclContext parent_decl_ctx 
)
inlinevirtual

◆ FindPlugin()

SymbolFile * SymbolFile::FindPlugin ( ObjectFile obj_file)
static

◆ FindTypes() [1/2]

uint32_t SymbolFile::FindTypes ( ConstString  name,
const CompilerDeclContext parent_decl_ctx,
bool  append,
uint32_t  max_matches,
llvm::DenseSet< lldb_private::SymbolFile *> &  searched_symbol_files,
TypeMap types 
)
virtual

Definition at line 141 of file SymbolFile.cpp.

References lldb_private::TypeMap::Clear().

Referenced by DumpClangAST().

◆ FindTypes() [2/2]

size_t SymbolFile::FindTypes ( const std::vector< CompilerContext > &  context,
bool  append,
TypeMap types 
)
virtual

◆ GetAbilities()

uint32_t lldb_private::SymbolFile::GetAbilities ( )
inline

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.

Definition at line 87 of file SymbolFile.h.

References CalculateAbilities(), GetModuleMutex(), m_abilities, and m_calculated_abilities.

◆ GetDeclContextContainingUID()

virtual CompilerDeclContext lldb_private::SymbolFile::GetDeclContextContainingUID ( lldb::user_id_t  uid)
inlinevirtual

◆ GetDeclContextForUID()

virtual CompilerDeclContext lldb_private::SymbolFile::GetDeclContextForUID ( lldb::user_id_t  uid)
inlinevirtual

◆ GetDeclForUID()

virtual CompilerDecl lldb_private::SymbolFile::GetDeclForUID ( lldb::user_id_t  uid)
inlinevirtual

◆ GetDynamicArrayInfoForUID()

virtual llvm::Optional<ArrayInfo> lldb_private::SymbolFile::GetDynamicArrayInfoForUID ( lldb::user_id_t  type_uid,
const lldb_private::ExecutionContext exe_ctx 
)
pure virtual

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

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

Implemented in SymbolFileDWARF, lldb_private::npdb::SymbolFileNativePDB, lldb_private::breakpad::SymbolFileBreakpad, SymbolFilePDB, SymbolFileDWARFDebugMap, and SymbolFileSymtab.

Referenced by GetDynamicArrayInfo().

◆ GetMangledNamesForFunction()

void SymbolFile::GetMangledNamesForFunction ( const std::string &  scope_qualified_name,
std::vector< ConstString > &  mangled_names 
)
virtual

Reimplemented in SymbolFileDWARF, and SymbolFilePDB.

Definition at line 135 of file SymbolFile.cpp.

Referenced by DumpClangAST(), and FindBestAlternateMangledName().

◆ GetModuleMutex()

std::recursive_mutex & SymbolFile::GetModuleMutex ( ) const
virtual

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

Reimplemented in SymbolFileDWARF.

Definition at line 29 of file SymbolFile.cpp.

References lldb_private::ModuleChild::GetModule(), and GetObjectFile().

Referenced by AssertModuleLock(), and GetAbilities().

◆ GetNumCompileUnits()

virtual uint32_t lldb_private::SymbolFile::GetNumCompileUnits ( )
pure virtual

◆ GetObjectFile() [1/2]

ObjectFile* lldb_private::SymbolFile::GetObjectFile ( )
inline

Definition at line 213 of file SymbolFile.h.

References m_obj_file.

Referenced by CommandObjectTargetSymbolsAdd::AddModuleSymbols(), CompleteExternalTagDeclType(), SymbolFilePDB::CompleteType(), SymbolFileDWARF::CompleteType(), DWARFASTParserClang::CompleteTypeFromDWARF(), SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::DIEInDeclContext(), DWARFDebugInfoEntry::FastExtract(), SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(), SymbolFileDWARF::FindFunctions(), SymbolFileDWARF::FindGlobalVariables(), SymbolFileDWARF::FindNamespace(), PDBASTParser::FindNamespaceDecl(), DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(), DWARFUnit::GetByteOrder(), lldb_private::Type::GetByteSize(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), SymbolFileDWARF::GetDwpSymbolFile(), SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(), SymbolFileDWARF::GetGlobalAranges(), SymbolFileDWARF::GetMangledNamesForFunction(), DWARFBaseDIE::GetModule(), lldb_private::Type::GetModule(), SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), GetModuleMutex(), SymbolFileDWARF::GetModuleMutex(), lldb_private::SymbolContext::GetParentOfInlinedScope(), GetUnqualifiedTypeName(), SymbolFileDWARF::InitializeObject(), SymbolFileDWARFDebugMap::LinkOSOAddress(), PlatformDarwin::LocateExecutableScriptingResources(), SymbolFileDWARF::ParseBlocksRecursive(), DWARFASTParserClang::ParseChildMembers(), SymbolFilePDB::ParseDeclsForContext(), SymbolFilePDB::ParseLanguage(), SymbolFileDWARF::ParseLineTable(), DWARFASTParserClang::ParseTypeFromDWARF(), lldb_private::npdb::SymbolFileNativePDB::ParseTypes(), SymbolFileDWARF::ParseVariableDIE(), SymbolFileDWARF::ParseVariables(), DWARFASTParserClang::ResolveNamespaceDIE(), lldb_private::Module::ResolveSymbolContextForAddress(), SymbolFileDWARF::ResolveType(), SymbolFileDWARF::ResolveTypeUID(), lldb_private::Module::SetSymbolFileFileSpec(), and SymbolFileDWARF::UpdateExternalModuleListIfNeeded().

◆ GetObjectFile() [2/2]

const ObjectFile* lldb_private::SymbolFile::GetObjectFile ( ) const
inline

Definition at line 214 of file SymbolFile.h.

References m_obj_file.

◆ GetTypeList()

TypeList * SymbolFile::GetTypeList ( )
virtual

◆ GetTypes()

virtual size_t lldb_private::SymbolFile::GetTypes ( lldb_private::SymbolContextScope sc_scope,
lldb::TypeClass  type_mask,
lldb_private::TypeList type_list 
)
pure virtual

◆ GetTypeSystemForLanguage()

TypeSystem * SymbolFile::GetTypeSystemForLanguage ( lldb::LanguageType  language)
virtual

◆ InitializeObject()

virtual void lldb_private::SymbolFile::InitializeObject ( )
inlinevirtual

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 in SymbolFileDWARF, lldb_private::npdb::SymbolFileNativePDB, SymbolFilePDB, lldb_private::breakpad::SymbolFileBreakpad, and SymbolFileDWARFDebugMap.

Definition at line 109 of file SymbolFile.h.

References GetNumCompileUnits(), ParseCompileUnitAtIndex(), ParseDebugMacros(), ParseFunctions(), ParseLanguage(), ParseLineTable(), ParseSupportFiles(), and ParseTypes().

◆ ParseBlocksRecursive()

virtual size_t lldb_private::SymbolFile::ParseBlocksRecursive ( Function func)
pure virtual

◆ ParseCallEdgesInFunction()

virtual std::vector<CallEdge> lldb_private::SymbolFile::ParseCallEdgesInFunction ( UserID  func_id)
inlinevirtual

Reimplemented in SymbolFileDWARFDebugMap.

Definition at line 216 of file SymbolFile.h.

Referenced by lldb_private::Function::GetCallEdges().

◆ ParseCompileUnitAtIndex()

virtual lldb::CompUnitSP lldb_private::SymbolFile::ParseCompileUnitAtIndex ( uint32_t  index)
pure virtual

◆ ParseDebugMacros()

virtual bool lldb_private::SymbolFile::ParseDebugMacros ( CompileUnit comp_unit)
pure virtual

◆ ParseDeclsForContext()

virtual void lldb_private::SymbolFile::ParseDeclsForContext ( CompilerDeclContext  decl_ctx)
inlinevirtual

◆ ParseFunctions()

virtual size_t lldb_private::SymbolFile::ParseFunctions ( CompileUnit comp_unit)
pure virtual

◆ ParseImportedModules()

virtual bool lldb_private::SymbolFile::ParseImportedModules ( const SymbolContext sc,
std::vector< SourceModule > &  imported_modules 
)
pure virtual

◆ ParseIsOptimized()

virtual bool lldb_private::SymbolFile::ParseIsOptimized ( CompileUnit comp_unit)
inlinevirtual

◆ ParseLanguage()

virtual lldb::LanguageType lldb_private::SymbolFile::ParseLanguage ( CompileUnit comp_unit)
pure virtual

◆ ParseLineTable()

virtual bool lldb_private::SymbolFile::ParseLineTable ( CompileUnit comp_unit)
pure virtual

◆ ParseSupportFiles()

virtual bool lldb_private::SymbolFile::ParseSupportFiles ( CompileUnit comp_unit,
FileSpecList &  support_files 
)
pure virtual

◆ ParseTypes()

virtual size_t lldb_private::SymbolFile::ParseTypes ( CompileUnit comp_unit)
pure virtual

◆ ParseVariablesForContext()

virtual size_t lldb_private::SymbolFile::ParseVariablesForContext ( const SymbolContext sc)
pure virtual

◆ PreloadSymbols()

void SymbolFile::PreloadSymbols ( )
virtual

Reimplemented in SymbolFileDWARF.

Definition at line 25 of file SymbolFile.cpp.

Referenced by DumpClangAST().

◆ ResolveSymbolContext() [1/2]

virtual uint32_t lldb_private::SymbolFile::ResolveSymbolContext ( const Address so_addr,
lldb::SymbolContextItem  resolve_scope,
SymbolContext sc 
)
pure virtual

◆ ResolveSymbolContext() [2/2]

uint32_t SymbolFile::ResolveSymbolContext ( const FileSpec file_spec,
uint32_t  line,
bool  check_inlines,
lldb::SymbolContextItem  resolve_scope,
SymbolContextList sc_list 
)
virtual

◆ ResolveTypeUID()

virtual Type* lldb_private::SymbolFile::ResolveTypeUID ( lldb::user_id_t  type_uid)
pure virtual

◆ SectionFileAddressesChanged()

virtual void lldb_private::SymbolFile::SectionFileAddressesChanged ( )
inlinevirtual

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

Definition at line 224 of file SymbolFile.h.

Member Data Documentation

◆ m_abilities

uint32_t lldb_private::SymbolFile::m_abilities
protected

Definition at line 232 of file SymbolFile.h.

Referenced by GetAbilities().

◆ m_calculated_abilities

bool lldb_private::SymbolFile::m_calculated_abilities
protected

Definition at line 233 of file SymbolFile.h.

Referenced by GetAbilities().

◆ m_obj_file

ObjectFile* lldb_private::SymbolFile::m_obj_file
protected

Definition at line 231 of file SymbolFile.h.

Referenced by SymbolFilePDB::AddSymbols(), SymbolFileSymtab::CalculateAbilities(), SymbolFilePDB::CalculateAbilities(), lldb_private::npdb::SymbolFileNativePDB::CalculateAbilities(), SymbolFileDWARF::CalculateAbilities(), SymbolFileDWARFDebugMap::CompleteType(), SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(), SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(), SymbolFileDWARFDebugMap::FindFunctions(), SymbolFilePDB::FindGlobalVariables(), SymbolFileDWARF::FindGlobalVariables(), SymbolFileDWARF::GetDwpSymbolFile(), SymbolFileDWARF::GetGlobalAranges(), SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(), lldb_private::npdb::SymbolFileNativePDB::GetNumCompileUnits(), SymbolFileDWARF::GetObjCClassSymbol(), GetObjectFile(), SymbolFilePDB::GetPDBSession(), SymbolFilePDB::GetTypeList(), GetTypeList(), lldb_private::npdb::SymbolFileNativePDB::GetTypeSystemForLanguage(), SymbolFilePDB::GetTypeSystemForLanguage(), SymbolFileDWARF::GetTypeSystemForLanguage(), GetTypeSystemForLanguage(), GetUnqualifiedTypeName(), SymbolFilePDB::InitializeObject(), lldb_private::npdb::SymbolFileNativePDB::InitializeObject(), SymbolFileDWARFDebugMap::InitOSO(), SymbolFileDWARFDwo::LoadSectionData(), SymbolFileDWARF::LoadSectionData(), SymbolFileDWARF::ParseCompileUnit(), SymbolFileSymtab::ParseCompileUnitAtIndex(), SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex(), SymbolFileSymtab::ParseFunctions(), lldb_private::npdb::SymbolFileNativePDB::ParseTypes(), RemoveFunctionsWithModuleNotEqualTo(), SymbolFileSymtab::ResolveSymbolContext(), SymbolFileDWARFDebugMap::SetCompileUnit(), and SymbolFileDWARF::UpdateExternalModuleListIfNeeded().


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