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

Provides public interface for all SymbolFiles. More...

#include <SymbolFile.h>

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

Classes

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

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 ()=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.
 
virtual bool GetDebugInfoIndexWasLoadedFromCache () const =0
 Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module index cache.
 
virtual void SetDebugInfoIndexWasLoadedFromCache ()=0
 
virtual bool GetDebugInfoIndexWasSavedToCache () const =0
 
virtual void SetDebugInfoIndexWasSavedToCache ()=0
 
- 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
 

Static Public Member Functions

static SymbolFileFindPlugin (lldb::ObjectFileSP objfile_sp)
 

Protected Member Functions

void AssertModuleLock ()
 
virtual void GetCompileOptions (std::unordered_map< lldb::CompUnitSP, lldb_private::Args > &args)
 

Private Member Functions

 SymbolFile (const SymbolFile &)=delete
 
const SymbolFileoperator= (const SymbolFile &)=delete
 

Static Private Attributes

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

Detailed Description

Provides public interface for all SymbolFiles.

Any protected virtual members should go into SymbolFileCommon; most SymbolFile implementations should inherit from SymbolFileCommon to override the behaviors except SymbolFileOnDemand which inherits public interfaces from SymbolFile and forward to underlying concrete SymbolFile implementation.

Definition at line 50 of file SymbolFile.h.

Member Enumeration Documentation

◆ Abilities

Enumerator
CompileUnits 
LineTables 
Functions 
Blocks 
GlobalVariables 
LocalVariables 
VariableTypes 
kAllAbilities 

Definition at line 67 of file SymbolFile.h.

Constructor & Destructor Documentation

◆ SymbolFile() [1/2]

lldb_private::SymbolFile::SymbolFile ( )
default

◆ ~SymbolFile()

lldb_private::SymbolFile::~SymbolFile ( )
overridedefault

◆ SymbolFile() [2/2]

lldb_private::SymbolFile::SymbolFile ( const SymbolFile )
privatedelete

Member Function Documentation

◆ AddSymbols()

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

◆ AssertModuleLock()

void SymbolFile::AssertModuleLock ( )
protected

Definition at line 137 of file SymbolFile.cpp.

References GetModuleMutex().

◆ CalculateAbilities()

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

◆ CalculateFrameVariableError()

virtual Status lldb_private::SymbolFile::CalculateFrameVariableError ( StackFrame frame)
inlinevirtual

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 in lldb_private::SymbolFileOnDemand, lldb_private::plugin::dwarf::SymbolFileDWARF, and lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap.

Definition at line 283 of file SymbolFile.h.

Referenced by GetFrameVariableError().

◆ classof()

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

Definition at line 58 of file SymbolFile.h.

References ID, and isA().

◆ CompleteType()

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

◆ CopyType()

virtual lldb::TypeSP lldb_private::SymbolFile::CopyType ( const lldb::TypeSP other_type)
pure virtual

◆ Dump()

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

◆ DumpClangAST()

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

◆ FindFunctions() [1/2]

void SymbolFile::FindFunctions ( const Module::LookupInfo lookup_info,
const CompilerDeclContext parent_decl_ctx,
bool  include_inlines,
SymbolContextList sc_list 
)
virtual

◆ FindFunctions() [2/2]

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

◆ FindGlobalVariables() [1/2]

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

◆ FindGlobalVariables() [2/2]

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

◆ FindNamespace()

virtual CompilerDeclContext lldb_private::SymbolFile::FindNamespace ( ConstString  name,
const CompilerDeclContext parent_decl_ctx,
bool  only_root_namespaces = false 
)
inlinevirtual

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

Definition at line 341 of file SymbolFile.h.

Referenced by lldb_private::ClangASTSource::CompleteNamespaceMap(), lldb_private::ClangASTSource::FillNamespaceMap(), and lldb_private::SymbolFileOnDemand::FindNamespace().

◆ FindPlugin()

SymbolFile * SymbolFile::FindPlugin ( lldb::ObjectFileSP  objfile_sp)
static

◆ FindTypes()

virtual void lldb_private::SymbolFile::FindTypes ( const TypeQuery query,
TypeResults results 
)
inlinevirtual

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 in lldb_private::SymbolFileCTF, lldb_private::plugin::dwarf::SymbolFileDWARF, lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap, lldb_private::npdb::SymbolFileNativePDB, SymbolFilePDB, and lldb_private::SymbolFileOnDemand.

Definition at line 317 of file SymbolFile.h.

◆ ForEachExternalModule()

virtual bool lldb_private::SymbolFile::ForEachExternalModule ( lldb_private::CompileUnit comp_unit,
llvm::DenseSet< lldb_private::SymbolFile * > &  visited_symbol_files,
llvm::function_ref< bool(Module &)>  lambda 
)
inlinevirtual

Apply a lambda to each external lldb::Module referenced by this comp_unit.

Recursively also descends into the referenced external modules of any encountered compilation unit.

This function can be used to traverse Clang -gmodules debug information, which is stored in DWARF files separate from the object files.

Parameters
comp_unitWhen this SymbolFile consists of multiple auxilliary SymbolFiles, for example, a Darwin debug map that references multiple .o files, comp_unit helps choose the auxilliary file. In most other cases comp_unit's symbol file is identical with *this.
[in]lambdaThe lambda that should be applied to every function. The lambda can return true if the iteration should be aborted earlier.
visited_symbol_filesA set of SymbolFiles that were already visited to avoid visiting one file more than once.
Returns
If the lambda early-exited, this function returns true to propagate the early exit.

Definition at line 193 of file SymbolFile.h.

◆ GetAbilities()

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

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.

Implemented in lldb_private::SymbolFileCommon, and lldb_private::SymbolFileOnDemand.

◆ GetBackingSymbolFile()

virtual SymbolFile * lldb_private::SymbolFile::GetBackingSymbolFile ( )
inlinevirtual

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

Reimplemented in lldb_private::SymbolFileOnDemand.

Definition at line 87 of file SymbolFile.h.

Referenced by lldb_private::npdb::PdbAstBuilder::CompleteTagDecl(), PDBASTParser::CompleteTypeFromPDB(), lldb_private::SymbolFileCommon::CopyType(), lldb_private::npdb::PdbAstBuilder::CreateArrayType(), lldb_private::npdb::PdbAstBuilder::CreateDeclInfoForType(), lldb_private::npdb::PdbAstBuilder::CreateDeclInfoForUndecoratedName(), lldb_private::npdb::PdbAstBuilder::CreateFunctionDecl(), lldb_private::npdb::PdbAstBuilder::CreateFunctionDeclFromId(), lldb_private::npdb::PdbAstBuilder::CreateFunctionParameters(), lldb_private::npdb::PdbAstBuilder::CreateFunctionType(), lldb_private::npdb::PdbAstBuilder::CreateType(), PDBASTParser::GetDeclContextContainingSymbol(), PDBASTParser::GetDeclContextForSymbol(), PDBASTParser::GetDeclForSymbol(), lldb_private::npdb::PdbAstBuilder::GetOrCreateFunctionDecl(), lldb_private::npdb::PdbAstBuilder::GetOrCreateInlinedFunctionDecl(), lldb_private::npdb::PdbAstBuilder::GetOrCreateSymbolForId(), lldb_private::npdb::PdbAstBuilder::GetOrCreateType(), lldb_private::npdb::PdbAstBuilder::GetOrCreateTypedefDecl(), lldb_private::npdb::PdbAstBuilder::GetOrCreateVariableDecl(), lldb_private::npdb::PdbAstBuilder::GetParentDeclContext(), lldb_private::npdb::PdbAstBuilder::ParseBlockChildren(), PDBASTParser::ParseDeclsForDeclContext(), lldb_private::npdb::PdbAstBuilder::ParseNamespace(), and lldb_private::plugin::dwarf::DebugNamesDWARFIndex::ProcessEntry().

◆ GetCompileOptions() [1/2]

std::unordered_map< lldb::CompUnitSP, Args > lldb_private::SymbolFile::GetCompileOptions ( )
inline

Returns a map of compilation unit to the compile option arguments associated with that compilation unit.

Definition at line 477 of file SymbolFile.h.

References GetCompileOptions().

Referenced by GetCompileOptions().

◆ GetCompileOptions() [2/2]

virtual void lldb_private::SymbolFile::GetCompileOptions ( std::unordered_map< lldb::CompUnitSP, lldb_private::Args > &  args)
inlineprotectedvirtual

Definition at line 486 of file SymbolFile.h.

◆ GetCompilerContextForUID()

virtual std::vector< CompilerContext > lldb_private::SymbolFile::GetCompilerContextForUID ( lldb::user_id_t  uid)
inlinevirtual

◆ GetCompileUnitAtIndex()

virtual lldb::CompUnitSP lldb_private::SymbolFile::GetCompileUnitAtIndex ( uint32_t  idx)
pure virtual

◆ GetDebugInfoHadFrameVariableErrors()

virtual bool lldb_private::SymbolFile::GetDebugInfoHadFrameVariableErrors ( ) const
pure virtual

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.

Implemented in lldb_private::SymbolFileCommon, lldb_private::SymbolFileOnDemand, and lldb_private::plugin::dwarf::SymbolFileDWARFDwo.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetDebugInfoIndexTime()

virtual StatsDuration::Duration lldb_private::SymbolFile::GetDebugInfoIndexTime ( )
inlinevirtual

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 in lldb_private::SymbolFileOnDemand, and lldb_private::plugin::dwarf::SymbolFileDWARF.

Definition at line 415 of file SymbolFile.h.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetDebugInfoIndexWasLoadedFromCache()

virtual bool lldb_private::SymbolFile::GetDebugInfoIndexWasLoadedFromCache ( ) const
pure virtual

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.

Implemented in lldb_private::SymbolFileCommon, lldb_private::SymbolFileOnDemand, and lldb_private::plugin::dwarf::SymbolFileDWARFDwo.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetDebugInfoIndexWasSavedToCache()

virtual bool lldb_private::SymbolFile::GetDebugInfoIndexWasSavedToCache ( ) const
pure virtual

◆ GetDebugInfoModules()

virtual ModuleList lldb_private::SymbolFile::GetDebugInfoModules ( )
inlinevirtual

Get the additional modules that this symbol file uses to parse debug info.

Some debug info is stored in stand alone object files that are represented by unique modules that will show up in the statistics module list. Return a list of modules that are not in the target module list that this symbol file is currently using so that they can be tracked and assoicated with the module in the statistics.

Reimplemented in lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap.

Definition at line 424 of file SymbolFile.h.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetDebugInfoParseTime()

virtual StatsDuration::Duration lldb_private::SymbolFile::GetDebugInfoParseTime ( )
inlinevirtual

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 in lldb_private::SymbolFileOnDemand, and lldb_private::plugin::dwarf::SymbolFileDWARF.

Definition at line 408 of file SymbolFile.h.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetDebugInfoSize()

virtual uint64_t lldb_private::SymbolFile::GetDebugInfoSize ( bool  load_all_debug_info = false)
pure virtual

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

Implemented in lldb_private::SymbolFileCommon, lldb_private::SymbolFileOnDemand, lldb_private::breakpad::SymbolFileBreakpad, lldb_private::plugin::dwarf::SymbolFileDWARF, lldb_private::plugin::dwarf::SymbolFileDWARFDwo, and lldb_private::npdb::SymbolFileNativePDB.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ 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 std::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 ExecutionContext. If exe_ctx is non-null, the dynamic characteristics for that context are returned.

Implemented in lldb_private::plugin::dwarf::SymbolFileDWARF, lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap, lldb_private::SymbolFileOnDemand, lldb_private::breakpad::SymbolFileBreakpad, lldb_private::SymbolFileCTF, lldb_private::SymbolFileJSON, lldb_private::npdb::SymbolFileNativePDB, SymbolFilePDB, and SymbolFileSymtab.

Referenced by GetDynamicArrayInfo().

◆ GetFrameVariableError()

Status lldb_private::SymbolFile::GetFrameVariableError ( StackFrame frame)
inline

Get an error that describes why variables might be missing for a given symbol context.

If there is an error in the debug information that prevents variables from being fetched, this error will get filled in. If there is no debug informaiton, no error should be returned. But if there is debug information and something prevents the variables from being available a valid error should be returned. Valid cases include:

  • compiler option that removes variables (-gline-tables-only)
  • missing external files
    • .dwo files in fission are not accessible or missing
    • .o files on darwin when not using dSYM files that are not accessible or missing
  • mismatched exteral files
    • .dwo files in fission where the DWO ID doesn't match
    • .o files on darwin when modification timestamp doesn't match
  • corrupted debug info
Parameters
[in]frameThe stack frame to use as a basis for the context to check. The frame address can be used if there is not debug info due to it not being able to be loaded, or if there is a debug info context, like a compile unit, or function, it can be used to track down more information on why variables are missing.
Returns
An error specifying why there should have been debug info with variable information but the variables were not able to be resolved.

Definition at line 271 of file SymbolFile.h.

References CalculateFrameVariableError(), lldb_private::Status::Fail(), and SetDebugInfoHadFrameVariableErrors().

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), and lldb_private::StackFrame::GetVariableList().

◆ GetLoadDebugInfoEnabled()

virtual bool lldb_private::SymbolFile::GetLoadDebugInfoEnabled ( )
inlinevirtual

Whether debug info will be loaded or not.

It will be true for most implementations except SymbolFileOnDemand.

Reimplemented in lldb_private::SymbolFileOnDemand.

Definition at line 135 of file SymbolFile.h.

Referenced by lldb_private::DebuggerStats::ReportStatistics().

◆ GetMainObjectFile()

virtual ObjectFile * lldb_private::SymbolFile::GetMainObjectFile ( )
pure virtual

◆ GetMangledNamesForFunction()

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

◆ 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 lldb_private::SymbolFileOnDemand, and lldb_private::plugin::dwarf::SymbolFileDWARF.

Definition at line 36 of file SymbolFile.cpp.

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

Referenced by AssertModuleLock(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), lldb_private::npdb::SymbolFileNativePDB::CompleteType(), SymbolFilePDB::FindFunctions(), lldb_private::breakpad::SymbolFileBreakpad::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindFunctions(), lldb_private::npdb::SymbolFileNativePDB::FindFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindGlobalVariables(), lldb_private::npdb::SymbolFileNativePDB::FindGlobalVariables(), SymbolFilePDB::FindGlobalVariables(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindNamespace(), SymbolFilePDB::FindNamespace(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindTypes(), lldb_private::npdb::SymbolFileNativePDB::FindTypes(), SymbolFilePDB::FindTypes(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ForEachExternalModule(), lldb_private::SymbolFileCommon::GetCompileUnitAtIndex(), lldb_private::SymbolFileCommon::GetNumCompileUnits(), lldb_private::SymbolFileCommon::GetSymtab(), SymbolFilePDB::GetTypes(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetTypes(), lldb_private::breakpad::SymbolFileBreakpad::ParseBlocksRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseBlocksRecursive(), lldb_private::npdb::SymbolFileNativePDB::ParseBlocksRecursive(), SymbolFilePDB::ParseBlocksRecursive(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseDebugMacros(), lldb_private::breakpad::SymbolFileBreakpad::ParseFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseFunctions(), lldb_private::npdb::SymbolFileNativePDB::ParseFunctions(), SymbolFilePDB::ParseFunctions(), SymbolFileSymtab::ParseFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseImportedModules(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseIsOptimized(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseLanguage(), lldb_private::npdb::SymbolFileNativePDB::ParseLanguage(), SymbolFilePDB::ParseLanguage(), lldb_private::breakpad::SymbolFileBreakpad::ParseLineTable(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseLineTable(), lldb_private::npdb::SymbolFileNativePDB::ParseLineTable(), SymbolFilePDB::ParseLineTable(), lldb_private::breakpad::SymbolFileBreakpad::ParseSupportFiles(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseSupportFiles(), SymbolFilePDB::ParseSupportFiles(), lldb_private::npdb::SymbolFileNativePDB::ParseSupportFiles(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseTypes(), lldb_private::npdb::SymbolFileNativePDB::ParseTypes(), SymbolFilePDB::ParseTypes(), SymbolFilePDB::ParseVariablesForContext(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseVariablesForContext(), lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseXcodeSDK(), lldb_private::SymbolFileCTF::ResolveSymbolContext(), lldb_private::SymbolFileJSON::ResolveSymbolContext(), SymbolFileSymtab::ResolveSymbolContext(), lldb_private::breakpad::SymbolFileBreakpad::ResolveSymbolContext(), lldb_private::npdb::SymbolFileNativePDB::ResolveSymbolContext(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ResolveTypeUID(), lldb_private::npdb::SymbolFileNativePDB::ResolveTypeUID(), SymbolFilePDB::ResolveTypeUID(), and lldb_private::SymbolFileCommon::SetCompileUnitAtIndex().

◆ GetNumCompileUnits()

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

◆ GetObjectFile() [1/2]

virtual const ObjectFile * lldb_private::SymbolFile::GetObjectFile ( ) const
pure virtual

◆ GetObjectFile() [2/2]

virtual ObjectFile * lldb_private::SymbolFile::GetObjectFile ( )
pure virtual

◆ GetParameterStackSize()

virtual llvm::Expected< lldb::addr_t > lldb_private::SymbolFile::GetParameterStackSize ( Symbol symbol)
inlinevirtual

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

Reimplemented in lldb_private::SymbolFileOnDemand, and lldb_private::breakpad::SymbolFileBreakpad.

Definition at line 375 of file SymbolFile.h.

Referenced by lldb_private::SymbolFileOnDemand::GetParameterStackSize().

◆ GetSeparateDebugInfo()

virtual bool lldb_private::SymbolFile::GetSeparateDebugInfo ( StructuredData::Dictionary d,
bool  errors_only 
)
inlinevirtual

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 in lldb_private::SymbolFileOnDemand, lldb_private::plugin::dwarf::SymbolFileDWARF, and lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap.

Definition at line 459 of file SymbolFile.h.

◆ GetSymtab()

virtual Symtab * lldb_private::SymbolFile::GetSymtab ( )
pure virtual

◆ GetTypes()

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

◆ GetTypeSystemForLanguage()

virtual llvm::Expected< lldb::TypeSystemSP > lldb_private::SymbolFile::GetTypeSystemForLanguage ( lldb::LanguageType  language)
pure virtual

◆ GetUnwindPlan()

virtual lldb::UnwindPlanSP lldb_private::SymbolFile::GetUnwindPlan ( const Address address,
const RegisterInfoResolver resolver 
)
inlinevirtual

◆ 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 lldb_private::SymbolFileOnDemand, lldb_private::breakpad::SymbolFileBreakpad, lldb_private::SymbolFileCTF, lldb_private::plugin::dwarf::SymbolFileDWARF, lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap, lldb_private::npdb::SymbolFileNativePDB, and SymbolFilePDB.

Definition at line 130 of file SymbolFile.h.

◆ isA()

virtual bool lldb_private::SymbolFile::isA ( const void *  ClassID) const
inlinevirtual

◆ MakeType()

virtual lldb::TypeSP lldb_private::SymbolFile::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 
)
pure virtual

◆ operator=()

const SymbolFile & lldb_private::SymbolFile::operator= ( const SymbolFile )
privatedelete

◆ ParseAllLanguages()

virtual llvm::SmallSet< lldb::LanguageType, 4 > lldb_private::SymbolFile::ParseAllLanguages ( CompileUnit comp_unit)
inlinevirtual

This function exists because SymbolFileDWARFDebugMap may extra compile units which aren't exposed as "real" compile units.

In every other case this function should behave identically as ParseLanguage.

Reimplemented in lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap.

Definition at line 157 of file SymbolFile.h.

References ParseLanguage().

◆ ParseBlocksRecursive()

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

◆ ParseCallEdgesInFunction()

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

◆ 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,
SupportFileList 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

◆ ParseXcodeSDK()

virtual XcodeSDK lldb_private::SymbolFile::ParseXcodeSDK ( CompileUnit comp_unit)
inlinevirtual

◆ PreloadSymbols()

void SymbolFile::PreloadSymbols ( )
virtual

◆ 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 SourceLocationSpec src_location_spec,
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 ( )
pure virtual

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

Implemented in lldb_private::SymbolFileCommon, and lldb_private::SymbolFileOnDemand.

◆ SetDebugInfoHadFrameVariableErrors()

virtual void lldb_private::SymbolFile::SetDebugInfoHadFrameVariableErrors ( )
pure virtual

◆ SetDebugInfoIndexWasLoadedFromCache()

virtual void lldb_private::SymbolFile::SetDebugInfoIndexWasLoadedFromCache ( )
pure virtual

◆ SetDebugInfoIndexWasSavedToCache()

virtual void lldb_private::SymbolFile::SetDebugInfoIndexWasSavedToCache ( )
pure virtual

◆ SetLoadDebugInfoEnabled()

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

Specify debug info should be loaded.

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

Reimplemented in lldb_private::SymbolFileOnDemand.

Definition at line 140 of file SymbolFile.h.

Referenced by lldb_private::Module::ResolveSymbolContextForAddress().

Member Data Documentation

◆ ID

char SymbolFile::ID
staticprivate

LLVM RTTI support.

Definition at line 52 of file SymbolFile.h.

Referenced by classof(), and isA().


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