LLDB mainline
Public Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
lldb_private::CompileUnit Class Reference

A class that describes a compilation unit. More...

#include "lldb/Symbol/CompileUnit.h"

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

Public Member Functions

 CompileUnit (const lldb::ModuleSP &module_sp, void *user_data, const char *pathname, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized)
 Construct with a module, path, UID and language.
 
 CompileUnit (const lldb::ModuleSP &module_sp, void *user_data, lldb::SupportFileSP support_file_sp, lldb::user_id_t uid, lldb::LanguageType language, lldb_private::LazyBool is_optimized, SupportFileList &&support_files={})
 Construct with a module, file spec, UID and language.
 
void AddFunction (lldb::FunctionSP &function_sp)
 Add a function to this compile unit.
 
void CalculateSymbolContext (SymbolContext *sc) override
 Reconstruct the object's symbol context into sc.
 
lldb::ModuleSP CalculateSymbolContextModule () override
 
CompileUnitCalculateSymbolContextCompileUnit () override
 
void DumpSymbolContext (Stream *s) override
 Dump the object's symbol context to the stream s.
 
lldb::LanguageType GetLanguage ()
 
void SetLanguage (lldb::LanguageType language)
 
void GetDescription (Stream *s, lldb::DescriptionLevel level) const
 
void ForeachFunction (llvm::function_ref< bool(const lldb::FunctionSP &)> lambda) const
 Apply a lambda to each function in this compile unit.
 
lldb::FunctionSP FindFunction (llvm::function_ref< bool(const lldb::FunctionSP &)> matching_lambda)
 Find a function in the compile unit based on the predicate matching_lambda.
 
void Dump (Stream *s, bool show_context) const
 Dump the compile unit contents to the stream s.
 
uint32_t FindLineEntry (uint32_t start_idx, uint32_t line, const FileSpec *file_spec_ptr, bool exact, LineEntry *line_entry)
 Find the line entry by line and optional inlined file spec.
 
const FileSpecGetPrimaryFile () const
 Return the primary source spec associated with this compile unit.
 
lldb::SupportFileSP GetPrimarySupportFile () const
 Return the primary source file associated with this compile unit.
 
LineTableGetLineTable ()
 Get the line table for the compile unit.
 
DebugMacrosGetDebugMacros ()
 
virtual bool ForEachExternalModule (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 compilation unit.
 
const SupportFileListGetSupportFiles ()
 Get the compile unit's support file list.
 
SupportFileListGetSupportFileList ()
 Used by plugins that parse the support file list.
 
const std::vector< SourceModule > & GetImportedModules ()
 Get the compile unit's imported module list.
 
void * GetUserData () const
 Get the SymbolFile plug-in user data.
 
lldb::VariableListSP GetVariableList (bool can_create)
 Get the variable list for a compile unit.
 
lldb::FunctionSP FindFunctionByUID (lldb::user_id_t uid)
 Finds a function by user ID.
 
void SetLineTable (LineTable *line_table)
 Set the line table for the compile unit.
 
void SetDebugMacros (const DebugMacrosSP &debug_macros)
 
void SetVariableList (lldb::VariableListSP &variable_list_sp)
 Set accessor for the variable list.
 
void ResolveSymbolContext (const SourceLocationSpec &src_location_spec, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
 Resolve symbol contexts by file and line.
 
bool GetIsOptimized ()
 Get whether compiler optimizations were enabled for this compile unit.
 
size_t GetNumFunctions () const
 Returns the number of functions in this compile unit.
 
- Public Member Functions inherited from lldb_private::ModuleChild
 ModuleChild (const lldb::ModuleSP &module_sp)
 Construct with owning module.
 
 ~ModuleChild ()
 Destructor.
 
const ModuleChildoperator= (const ModuleChild &rhs)
 Assignment operator.
 
lldb::ModuleSP GetModule () const
 Get const accessor for the module pointer.
 
void SetModule (const lldb::ModuleSP &module_sp)
 Set accessor for the module pointer.
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 
 ~UserID ()=default
 Destructor.
 
void Clear ()
 Clears the object state.
 
lldb::user_id_t GetID () const
 Get accessor for the user ID.
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.
 
- Public Member Functions inherited from lldb_private::SymbolContextScope
virtual ~SymbolContextScope ()=default
 
virtual void CalculateSymbolContext (SymbolContext *sc)=0
 Reconstruct the object's symbol context into sc.
 
virtual lldb::ModuleSP CalculateSymbolContextModule ()
 
virtual CompileUnitCalculateSymbolContextCompileUnit ()
 
virtual FunctionCalculateSymbolContextFunction ()
 
virtual BlockCalculateSymbolContextBlock ()
 
virtual SymbolCalculateSymbolContextSymbol ()
 
virtual void DumpSymbolContext (Stream *s)=0
 Dump the object's symbol context to the stream s.
 

Protected Attributes

void * m_user_data
 User data for the SymbolFile parser to store information into.
 
lldb::LanguageType m_language
 The programming language enumeration value.
 
Flags m_flags
 Compile unit flags that help with partial parsing.
 
llvm::DenseMap< lldb::user_id_t, lldb::FunctionSPm_functions_by_uid
 Maps UIDs to functions.
 
std::vector< SourceModulem_imported_modules
 All modules, including the current module, imported by this compile unit.
 
lldb::SupportFileSP m_primary_support_file_sp
 The primary file associated with this compile unit.
 
SupportFileList m_support_files
 Files associated with this compile unit's line table and declarations.
 
std::unique_ptr< LineTablem_line_table_up
 Line table that will get parsed on demand.
 
DebugMacrosSP m_debug_macros_sp
 Debug macros that will get parsed on demand.
 
lldb::VariableListSP m_variables
 Global and static variable list that will get parsed on demand.
 
lldb_private::LazyBool m_is_optimized
 eLazyBoolYes if this compile unit was compiled with optimization.
 
- Protected Attributes inherited from lldb_private::ModuleChild
lldb::ModuleWP m_module_wp
 The Module that owns the object that inherits from this class.
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.
 

Private Types

enum  {
  flagsParsedAllFunctions , flagsParsedVariables , flagsParsedSupportFiles = (1u << 2) , flagsParsedLineTable ,
  flagsParsedLanguage = (1u << 4) , flagsParsedImportedModules , flagsParsedDebugMacros
}
 

Private Member Functions

 CompileUnit (const CompileUnit &)=delete
 
const CompileUnitoperator= (const CompileUnit &)=delete
 
const char * GetCachedLanguage () const
 

Detailed Description

A class that describes a compilation unit.

A representation of a compilation unit, or compiled source file. The UserID of the compile unit is specified by the SymbolFile plug-in and can have any value as long as the value is unique within the Module that owns this compile units.

Each compile unit has a list of functions, global and static variables, support file list (include files and inlined source files), and a line table.

Definition at line 38 of file CompileUnit.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
flagsParsedAllFunctions 

Have we already parsed all our functions.

flagsParsedVariables 

Have we already parsed globals and statics?

flagsParsedSupportFiles 

Have we already parsed the support files for this compile unit?

flagsParsedLineTable 

Have we parsed the line table already?

flagsParsedLanguage 

Have we parsed the language already?

flagsParsedImportedModules 

Have we parsed the imported modules already?

flagsParsedDebugMacros 

Have we parsed the debug macros already?

Definition at line 440 of file CompileUnit.h.

Constructor & Destructor Documentation

◆ CompileUnit() [1/3]

CompileUnit::CompileUnit ( const lldb::ModuleSP module_sp,
void *  user_data,
const char *  pathname,
lldb::user_id_t  uid,
lldb::LanguageType  language,
lldb_private::LazyBool  is_optimized 
)

Construct with a module, path, UID and language.

Initialize the compile unit given the owning module, a path to convert into a FileSpec, the SymbolFile plug-in supplied uid, and the source language type.

Parameters
[in]module_spThe parent module that owns this compile unit. This value must be a valid pointer value.
[in]user_dataUser data where the SymbolFile parser can store data.
[in]pathnameThe path to the source file for this compile unit.
[in]uidThe user ID of the compile unit. This value is supplied by the SymbolFile plug-in and should be a value that allows the SymbolFile plug-in to easily locate and parse additional information for the compile unit.
[in]languageA language enumeration type that describes the main language of this compile unit.
[in]is_optimizedA value that can initialized with eLazyBoolYes, eLazyBoolNo or eLazyBoolCalculate. If set to eLazyBoolCalculate, then an extra call into SymbolVendor will be made to calculate if the compile unit is optimized will be made when CompileUnit::GetIsOptimized() is called.
See also
lldb::LanguageType

Definition at line 21 of file CompileUnit.cpp.

◆ CompileUnit() [2/3]

CompileUnit::CompileUnit ( const lldb::ModuleSP module_sp,
void *  user_data,
lldb::SupportFileSP  support_file_sp,
lldb::user_id_t  uid,
lldb::LanguageType  language,
lldb_private::LazyBool  is_optimized,
SupportFileList &&  support_files = {} 
)

Construct with a module, file spec, UID and language.

Initialize the compile unit given the owning module, a path to convert into a FileSpec, the SymbolFile plug-in supplied uid, and the source language type.

Parameters
[in]module_spThe parent module that owns this compile unit. This value must be a valid pointer value.
[in]user_dataUser data where the SymbolFile parser can store data.
[in]support_file_spThe file specification for the source file of this compile unit.
[in]uidThe user ID of the compile unit. This value is supplied by the SymbolFile plug-in and should be a value that allows the plug-in to easily locate and parse additional information for the compile unit.
[in]languageA language enumeration type that describes the main language of this compile unit.
[in]is_optimizedA value that can initialized with eLazyBoolYes, eLazyBoolNo or eLazyBoolCalculate. If set to eLazyBoolCalculate, then an extra call into SymbolVendor will be made to calculate if the compile unit is optimized will be made when CompileUnit::GetIsOptimized() is called.
[in]support_filesAn rvalue list of already parsed support files.
See also
lldb::LanguageType

Definition at line 29 of file CompileUnit.cpp.

References lldb::eLanguageTypeUnknown, flagsParsedLanguage, m_flags, and lldb_private::Flags::Set().

◆ CompileUnit() [3/3]

lldb_private::CompileUnit::CompileUnit ( const CompileUnit )
privatedelete

Member Function Documentation

◆ AddFunction()

void CompileUnit::AddFunction ( lldb::FunctionSP function_sp)

Add a function to this compile unit.

Typically called by the SymbolFile plug-ins as they partially parse the debug information.

Parameters
[in]function_spA shared pointer to the Function object.

Definition at line 144 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by lldb_private::npdb::SymbolFileNativePDB::CreateFunction(), lldb_private::breakpad::SymbolFileBreakpad::GetOrCreateFunction(), SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(), DWARFASTParserClang::ParseFunctionFromDWARF(), lldb_private::SymbolFileCTF::ParseFunctions(), and SymbolFileSymtab::ParseFunctions().

◆ CalculateSymbolContext()

void CompileUnit::CalculateSymbolContext ( SymbolContext sc)
overridevirtual

Reconstruct the object's symbol context into sc.

The object should fill in as much of the SymbolContext as it can so function calls that require a symbol context can be made for the given object.

Parameters
[out]scA symbol context object pointer that gets filled in.
See also
SymbolContextScope

Implements lldb_private::SymbolContextScope.

Definition at line 44 of file CompileUnit.cpp.

References lldb_private::SymbolContext::comp_unit, and lldb_private::ModuleChild::GetModule().

Referenced by lldb_private::Function::CalculateSymbolContext(), GetImportedModules(), and GetVariableList().

◆ CalculateSymbolContextCompileUnit()

CompileUnit * CompileUnit::CalculateSymbolContextCompileUnit ( )
overridevirtual

Reimplemented from lldb_private::SymbolContextScope.

Definition at line 51 of file CompileUnit.cpp.

◆ CalculateSymbolContextModule()

ModuleSP CompileUnit::CalculateSymbolContextModule ( )
overridevirtual

Reimplemented from lldb_private::SymbolContextScope.

Definition at line 49 of file CompileUnit.cpp.

References lldb_private::ModuleChild::GetModule().

Referenced by FindFunction().

◆ Dump()

void CompileUnit::Dump ( Stream s,
bool  show_context 
) const

Dump the compile unit contents to the stream s.

Parameters
[in]sThe stream to which to dump the object description.
[in]show_contextIf true, variables will dump their symbol context information.

Definition at line 115 of file CompileUnit.cpp.

References lldb_private::Stream::EOL(), ForeachFunction(), GetCachedLanguage(), GetPrimaryFile(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_functions_by_uid, m_variables, and lldb_private::Stream::Printf().

Referenced by lldb::SBCompileUnit::GetDescription().

◆ DumpSymbolContext()

void CompileUnit::DumpSymbolContext ( Stream s)
overridevirtual

Dump the object's symbol context to the stream s.

The object should dump its symbol context to the stream s. This function is widely used in the DumpDebug and verbose output for lldb objects.

Parameters
[in]sThe stream to which to dump the object's symbol context.
See also
SymbolContextScope

Implements lldb_private::SymbolContextScope.

Definition at line 53 of file CompileUnit.cpp.

References lldb_private::UserID::GetID(), lldb_private::ModuleChild::GetModule(), and lldb_private::Stream::Printf().

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

◆ FindFunction()

lldb::FunctionSP CompileUnit::FindFunction ( llvm::function_ref< bool(const lldb::FunctionSP &)>  matching_lambda)

Find a function in the compile unit based on the predicate matching_lambda.

Parameters
[in]matching_lambdaA predicate that will be used within FindFunction to evaluate each FunctionSP in m_functions_by_uid. When the predicate returns true FindFunction will return the corresponding FunctionSP.
Returns
The first FunctionSP that the matching_lambda prediate returns true for.

Definition at line 81 of file CompileUnit.cpp.

References CalculateSymbolContextModule(), LLDB_SCOPED_TIMER, m_functions_by_uid, and lldb_private::SymbolFile::ParseFunctions().

Referenced by lldb_private::CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo().

◆ FindFunctionByUID()

FunctionSP CompileUnit::FindFunctionByUID ( lldb::user_id_t  uid)

Finds a function by user ID.

Typically used by SymbolFile plug-ins when partially parsing the debug information to see if the function has been parsed yet.

Parameters
[in]uidThe user ID of the function to find. This value is supplied by the SymbolFile plug-in and should be a value that allows the plug-in to easily locate and parse additional information in the function.
Returns
A shared pointer to the function object that might contain a NULL Function pointer.

Definition at line 148 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetFunction(), lldb_private::breakpad::SymbolFileBreakpad::GetOrCreateFunction(), SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseFunctions(), SymbolFilePDB::ParseFunctions(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseTypes(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ResolveFunctionAndBlock().

◆ FindLineEntry()

uint32_t CompileUnit::FindLineEntry ( uint32_t  start_idx,
uint32_t  line,
const FileSpec file_spec_ptr,
bool  exact,
LineEntry line_entry 
)

Find the line entry by line and optional inlined file spec.

Finds the first line entry that has an index greater than start_idx that matches line. If file_spec_ptr is NULL, then the search matches line entries whose file matches the file for the compile unit. If file_spec_ptr is not NULL, line entries must match the specified file spec (for inlined line table entries).

Multiple calls to this function can find all entries that match a given file and line by starting with start_idx equal to zero, and calling this function back with the return value + 1.

Parameters
[in]start_idxThe zero based index at which to start looking for matches.
[in]lineThe line number to search for.
[in]file_spec_ptrIf non-NULL search for entries that match this file spec, else if NULL, search for line entries that match the compile unit file.
[in]exactIf true match only if there is a line table entry for this line number. If false, find the line table entry equal to or after this line number.
[out]line_entryIf non-NULL, a copy of the line entry that was found.
Returns
The zero based index of a matching line entry, or UINT32_MAX if no matching line entry is found.

Definition at line 226 of file CompileUnit.cpp.

References FindFileIndexes(), lldb_private::LineTable::FindLineEntryIndexByFileIndex(), GetLineTable(), GetPrimaryFile(), GetSupportFiles(), and UINT32_MAX.

Referenced by CommandObjectThreadUntil::DoExecute(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), lldb::SBCompileUnit::FindLineEntryIndex(), and lldb_private::SymbolContext::GetAddressRangeFromHereToEndLine().

◆ ForEachExternalModule()

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

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

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

Parameters
visited_symbol_filesA set of SymbolFiles that were already visited to avoid visiting one file more than once.
[in]lambdaThe lambda that should be applied to every function. The lambda can return true if the iteration should be aborted earlier.
Returns
If the lambda early-exited, this function returns true to propagate the early exit.

Definition at line 406 of file CompileUnit.cpp.

References lldb_private::ModuleChild::GetModule().

Referenced by GetModuleConfig().

◆ ForeachFunction()

void CompileUnit::ForeachFunction ( llvm::function_ref< bool(const lldb::FunctionSP &)>  lambda) const

Apply a lambda to each function in this compile unit.

This provides raw access to the function shared pointer list and will not cause the SymbolFile plug-in to parse any unparsed functions.

Note
Prefer using FindFunctionByUID over this if possible.
Parameters
[in]lambdaThe lambda that should be applied to every function. The lambda can return true if the iteration should be aborted earlier.

Definition at line 65 of file CompileUnit.cpp.

References m_functions_by_uid.

Referenced by Dump(), and lldb_private::Module::ParseAllDebugSymbols().

◆ GetCachedLanguage()

const char * CompileUnit::GetCachedLanguage ( ) const
private

◆ GetDebugMacros()

DebugMacros * CompileUnit::GetDebugMacros ( )

◆ GetDescription()

void CompileUnit::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
) const

Definition at line 58 of file CompileUnit.cpp.

References GetCachedLanguage(), and GetPrimaryFile().

Referenced by lldb_private::SymbolContext::GetDescription().

◆ GetImportedModules()

const std::vector< SourceModule > & CompileUnit::GetImportedModules ( )

Get the compile unit's imported module list.

This reports all the imports that the compile unit made, including the current module.

Returns
A list of imported modules.

Definition at line 393 of file CompileUnit.cpp.

References CalculateSymbolContext(), flagsParsedImportedModules, lldb_private::ModuleChild::GetModule(), lldb_private::Flags::IsClear(), m_flags, m_imported_modules, and lldb_private::Flags::Set().

◆ GetIsOptimized()

bool CompileUnit::GetIsOptimized ( )

Get whether compiler optimizations were enabled for this compile unit.

"optimized" means that the debug experience may be difficult for the user to understand. Variables may not be available when the developer would expect them, stepping through the source lines in the function may appear strange, etc.

Returns
Returns 'true' if this compile unit was compiled with optimization. 'false' indicates that either the optimization is unknown, or this compile unit was built without optimization.

Definition at line 378 of file CompileUnit.cpp.

References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::ModuleChild::GetModule(), and m_is_optimized.

Referenced by lldb::SBFunction::GetIsOptimized(), and lldb_private::Function::GetIsOptimized().

◆ GetLanguage()

lldb::LanguageType CompileUnit::GetLanguage ( )

◆ GetLineTable()

LineTable * CompileUnit::GetLineTable ( )

◆ GetNumFunctions()

size_t lldb_private::CompileUnit::GetNumFunctions ( ) const
inline

Returns the number of functions in this compile unit.

Definition at line 411 of file CompileUnit.h.

References m_functions_by_uid.

Referenced by lldb_private::npdb::SymbolFileNativePDB::ParseFunctions().

◆ GetPrimaryFile()

const FileSpec & lldb_private::CompileUnit::GetPrimaryFile ( ) const
inline

◆ GetPrimarySupportFile()

lldb::SupportFileSP lldb_private::CompileUnit::GetPrimarySupportFile ( ) const
inline

Return the primary source file associated with this compile unit.

Definition at line 235 of file CompileUnit.h.

References m_primary_support_file_sp.

◆ GetSupportFileList()

SupportFileList & lldb_private::CompileUnit::GetSupportFileList ( )
inline

Used by plugins that parse the support file list.

Definition at line 281 of file CompileUnit.h.

References flagsParsedSupportFiles, m_flags, m_support_files, and lldb_private::Flags::Set().

◆ GetSupportFiles()

const SupportFileList & CompileUnit::GetSupportFiles ( )

◆ GetUserData()

void * CompileUnit::GetUserData ( ) const

Get the SymbolFile plug-in user data.

SymbolFile plug-ins can store user data to internal state or objects to quickly allow them to parse more information for a given object.

Returns
The user data stored with the CompileUnit when it was constructed.

Definition at line 425 of file CompileUnit.cpp.

References m_user_data.

◆ GetVariableList()

VariableListSP CompileUnit::GetVariableList ( bool  can_create)

Get the variable list for a compile unit.

Called by clients to get the variable list for a compile unit. The variable list will contain all global and static variables that were defined at the compile unit level.

Parameters
[in]can_createIf true, the variable list will be parsed on demand. If false, the current variable list will be returned even if it contains a NULL VariableList object (typically called by dumping routines that want to display only what has currently been parsed).
Returns
A shared pointer to a variable list, that can contain NULL VariableList pointer if there are no global or static variables.

Definition at line 205 of file CompileUnit.cpp.

References CalculateSymbolContext(), m_variables, and lldb_private::SymbolContext::module_sp.

Referenced by CommandObjectTargetVariable::DoExecute(), lldb_private::StackFrame::GetInScopeVariableList(), lldb_private::StackFrame::GetVariableList(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseAndAppendGlobalVariable(), SymbolFilePDB::ParseVariables(), SymbolFilePDB::ParseVariablesForContext(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariablesForContext(), and lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext().

◆ operator=()

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

◆ ResolveSymbolContext()

void CompileUnit::ResolveSymbolContext ( const SourceLocationSpec src_location_spec,
lldb::SymbolContextItem  resolve_scope,
SymbolContextList sc_list 
)

Resolve symbol contexts by file and line.

Given a file in src_location_spec, find all instances and append them to the supplied symbol context list sc_list.

Parameters
[in]src_location_specThe src_location_spec containing the file_spec, the line and the column of the symbol to look for. Also hold the inlines and exact_match flags.

If check_inlines is true, this function will also match any inline file and line matches. If false, the compile unit's file specification must match file_spec for any matches to be returned.

If exact_match is true, only resolve the context if line and column exists in the line table. If false, resolve the context to the closest line greater than line in the line table.

Parameters
[in]resolve_scopeFor each matching line entry, this bitfield indicates what values within each SymbolContext that gets added to sc_list will be resolved. See the SymbolContext::Scope enumeration for a list of all available bits that can be resolved. Only SymbolContext entries that can be resolved using a LineEntry base address will be able to be resolved.
[out]sc_listA SymbolContext list class that will get any matching entries appended to.
See also
enum SymbolContext::Scope

Definition at line 248 of file CompileUnit.cpp.

References lldb_private::SymbolContextList::Append(), lldb_private::Address::CalculateSymbolContext(), lldb_private::LineEntry::column, lldb_private::SymbolContext::comp_unit, FindFileIndexes(), lldb_private::LineTable::FindLineEntryIndexByFileIndex(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::SourceLocationSpec::GetCheckInlines(), lldb_private::SourceLocationSpec::GetColumn(), lldb_private::LineEntry::GetFile(), lldb_private::Address::GetFileAddress(), lldb_private::SourceLocationSpec::GetFileSpec(), lldb_private::SourceLocationSpec::GetLine(), GetLineTable(), lldb_private::ModuleChild::GetModule(), GetPrimaryFile(), GetSupportFiles(), lldb_private::LineEntry::line, lldb_private::SymbolContext::line_entry, lldb_private::FileSpec::Match(), lldb_private::SymbolContext::module_sp, lldb_private::LineEntry::range, and UINT32_MAX.

Referenced by lldb_private::breakpad::SymbolFileBreakpad::ResolveSymbolContext(), lldb_private::npdb::SymbolFileNativePDB::ResolveSymbolContext(), lldb_private::BreakpointResolverFileRegex::SearchCallback(), lldb_private::AddressResolverFileLine::SearchCallback(), and lldb::SBThread::StepOverUntil().

◆ SetDebugMacros()

void CompileUnit::SetDebugMacros ( const DebugMacrosSP debug_macros)

◆ SetLanguage()

void lldb_private::CompileUnit::SetLanguage ( lldb::LanguageType  language)
inline

Definition at line 148 of file CompileUnit.h.

References flagsParsedLanguage, m_flags, m_language, and lldb_private::Flags::Set().

◆ SetLineTable()

void CompileUnit::SetLineTable ( LineTable line_table)

Set the line table for the compile unit.

Called by the SymbolFile plug-in when if first parses the line table and hands ownership of the line table to this object. The compile unit owns the line table object and will delete the object when it is deleted.

Parameters
[in]line_tableA line table object pointer that this object now owns.

Definition at line 177 of file CompileUnit.cpp.

References lldb_private::Flags::Clear(), flagsParsedLineTable, m_flags, m_line_table_up, and lldb_private::Flags::Set().

Referenced by SymbolFilePDB::ParseCompileUnitLineTable(), lldb_private::breakpad::SymbolFileBreakpad::ParseLineTable(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseLineTable(), and lldb_private::npdb::SymbolFileNativePDB::ParseLineTable().

◆ SetVariableList()

void CompileUnit::SetVariableList ( lldb::VariableListSP variable_list_sp)

Set accessor for the variable list.

Called by the SymbolFile plug-ins after they have parsed the variable lists and are ready to hand ownership of the list over to this object.

Parameters
[in]variable_list_spA shared pointer to a VariableList.

Definition at line 389 of file CompileUnit.cpp.

References m_variables.

Referenced by SymbolFilePDB::ParseVariables(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariablesForContext(), and lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext().

Member Data Documentation

◆ m_debug_macros_sp

DebugMacrosSP lldb_private::CompileUnit::m_debug_macros_sp
protected

Debug macros that will get parsed on demand.

Definition at line 432 of file CompileUnit.h.

Referenced by GetDebugMacros(), and SetDebugMacros().

◆ m_flags

Flags lldb_private::CompileUnit::m_flags
protected

◆ m_functions_by_uid

llvm::DenseMap<lldb::user_id_t, lldb::FunctionSP> lldb_private::CompileUnit::m_functions_by_uid
protected

Maps UIDs to functions.

Definition at line 421 of file CompileUnit.h.

Referenced by AddFunction(), Dump(), FindFunction(), FindFunctionByUID(), ForeachFunction(), and GetNumFunctions().

◆ m_imported_modules

std::vector<SourceModule> lldb_private::CompileUnit::m_imported_modules
protected

All modules, including the current module, imported by this compile unit.

Definition at line 424 of file CompileUnit.h.

Referenced by GetImportedModules().

◆ m_is_optimized

lldb_private::LazyBool lldb_private::CompileUnit::m_is_optimized
protected

eLazyBoolYes if this compile unit was compiled with optimization.

Definition at line 437 of file CompileUnit.h.

Referenced by GetIsOptimized().

◆ m_language

lldb::LanguageType lldb_private::CompileUnit::m_language
protected

The programming language enumeration value.

Definition at line 417 of file CompileUnit.h.

Referenced by GetCachedLanguage(), GetLanguage(), and SetLanguage().

◆ m_line_table_up

std::unique_ptr<LineTable> lldb_private::CompileUnit::m_line_table_up
protected

Line table that will get parsed on demand.

Definition at line 430 of file CompileUnit.h.

Referenced by GetLineTable(), and SetLineTable().

◆ m_primary_support_file_sp

lldb::SupportFileSP lldb_private::CompileUnit::m_primary_support_file_sp
protected

The primary file associated with this compile unit.

Definition at line 426 of file CompileUnit.h.

Referenced by GetPrimaryFile(), and GetPrimarySupportFile().

◆ m_support_files

SupportFileList lldb_private::CompileUnit::m_support_files
protected

Files associated with this compile unit's line table and declarations.

Definition at line 428 of file CompileUnit.h.

Referenced by GetSupportFileList(), and GetSupportFiles().

◆ m_user_data

void* lldb_private::CompileUnit::m_user_data
protected

User data for the SymbolFile parser to store information into.

Definition at line 415 of file CompileUnit.h.

Referenced by GetUserData().

◆ m_variables

lldb::VariableListSP lldb_private::CompileUnit::m_variables
protected

Global and static variable list that will get parsed on demand.

Definition at line 434 of file CompileUnit.h.

Referenced by Dump(), GetVariableList(), and SetVariableList().


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