LLDB mainline
|
A class that describes a compilation unit. More...
#include "lldb/Symbol/CompileUnit.h"
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 |
CompileUnit * | CalculateSymbolContextCompileUnit () 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 FileSpec & | GetPrimaryFile () 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. | |
LineTable * | GetLineTable () |
Get the line table for the compile unit. | |
DebugMacros * | GetDebugMacros () |
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 SupportFileList & | GetSupportFiles () |
Get the compile unit's support file list. | |
SupportFileList & | GetSupportFileList () |
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, RealpathPrefixes *realpath_prefixes=nullptr) |
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 ModuleChild & | operator= (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 CompileUnit * | CalculateSymbolContextCompileUnit () |
virtual Function * | CalculateSymbolContextFunction () |
virtual Block * | CalculateSymbolContextBlock () |
virtual Symbol * | CalculateSymbolContextSymbol () |
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::FunctionSP > | m_functions_by_uid |
Maps UIDs to functions. | |
std::vector< SourceModule > | m_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< LineTable > | m_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 CompileUnit & | operator= (const CompileUnit &)=delete |
const char * | GetCachedLanguage () const |
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 40 of file CompileUnit.h.
|
private |
Definition at line 447 of file CompileUnit.h.
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.
[in] | module_sp | The parent module that owns this compile unit. This value must be a valid pointer value. |
[in] | user_data | User data where the SymbolFile parser can store data. |
[in] | pathname | The path to the source file for this compile unit. |
[in] | uid | The 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] | language | A language enumeration type that describes the main language of this compile unit. |
[in] | is_optimized | A 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. |
Definition at line 21 of file CompileUnit.cpp.
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.
[in] | module_sp | The parent module that owns this compile unit. This value must be a valid pointer value. |
[in] | user_data | User data where the SymbolFile parser can store data. |
[in] | support_file_sp | The file specification for the source file of this compile unit. |
[in] | uid | The 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] | language | A language enumeration type that describes the main language of this compile unit. |
[in] | is_optimized | A 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_files | An rvalue list of already parsed support files. |
Definition at line 29 of file CompileUnit.cpp.
References lldb::eLanguageTypeUnknown, flagsParsedLanguage, m_flags, and lldb_private::Flags::Set().
|
privatedelete |
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.
[in] | function_sp | A 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().
|
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.
[out] | sc | A symbol context object pointer that gets filled in. |
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().
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 51 of file CompileUnit.cpp.
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 49 of file CompileUnit.cpp.
References lldb_private::ModuleChild::GetModule().
Referenced by FindFunction().
void CompileUnit::Dump | ( | Stream * | s, |
bool | show_context | ||
) | const |
Dump the compile unit contents to the stream s.
[in] | s | The stream to which to dump the object description. |
[in] | show_context | If 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().
|
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.
[in] | s | The stream to which to dump the object's symbol context. |
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().
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.
[in] | matching_lambda | A 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. |
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().
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.
[in] | uid | The 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. |
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().
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.
[in] | start_idx | The zero based index at which to start looking for matches. |
[in] | line | The line number to search for. |
[in] | file_spec_ptr | If non-NULL search for entries that match this file spec, else if NULL, search for line entries that match the compile unit file. |
[in] | exact | If 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_entry | If non-NULL, a copy of the line entry that was found. |
Definition at line 227 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().
|
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.
visited_symbol_files | A set of SymbolFiles that were already visited to avoid visiting one file more than once. | |
[in] | lambda | The lambda that should be applied to every function. The lambda can return true if the iteration should be aborted earlier. |
Definition at line 408 of file CompileUnit.cpp.
References lldb_private::ModuleChild::GetModule().
Referenced by GetModuleConfig().
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.
[in] | lambda | The 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().
|
private |
Definition at line 105 of file CompileUnit.cpp.
References flagsParsedLanguage, lldb_private::Language::GetNameForLanguageType(), lldb_private::Flags::IsClear(), m_flags, and m_language.
Referenced by Dump(), and GetDescription().
DebugMacros * CompileUnit::GetDebugMacros | ( | ) |
Definition at line 185 of file CompileUnit.cpp.
References flagsParsedDebugMacros, lldb_private::ModuleChild::GetModule(), lldb_private::Flags::IsClear(), m_debug_macros_sp, m_flags, and lldb_private::Flags::Set().
Referenced by lldb_private::ClangExpressionSourceCode::GetText().
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().
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.
Definition at line 395 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().
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.
Definition at line 380 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().
lldb::LanguageType CompileUnit::GetLanguage | ( | ) |
Definition at line 155 of file CompileUnit.cpp.
References lldb::eLanguageTypeUnknown, flagsParsedLanguage, lldb_private::ModuleChild::GetModule(), lldb_private::Flags::IsClear(), m_flags, m_language, and lldb_private::Flags::Set().
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::BreakpointLocation::ConditionSaysStop(), lldb_private::npdb::SymbolFileNativePDB::CreateFunction(), lldb_private::FormatEntity::Format(), lldb::SBCompileUnit::GetLanguage(), lldb::SBFunction::GetLanguage(), lldb_private::StackFrame::GetLanguage(), lldb_private::Function::GetLanguage(), lldb_private::SymbolContext::GetLanguage(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::ParseAllLanguages(), and lldb_private::plugin::dwarf::SymbolFileDWARF::ParseImportedModules().
LineTable * CompileUnit::GetLineTable | ( | ) |
Get the line table for the compile unit.
Called by clients and the SymbolFile plug-in. The SymbolFile plug-ins use this function to determine if the line table has be parsed yet. Clients use this function to get the line table from a compile unit.
Definition at line 166 of file CompileUnit.cpp.
References flagsParsedLineTable, lldb_private::ModuleChild::GetModule(), lldb_private::Flags::IsClear(), m_flags, m_line_table_up, and lldb_private::Flags::Set().
Referenced by lldb_private::plugin::dwarf::DWARFCompileUnit::BuildAddressRangeTable(), CommandObjectThreadUntil::DoExecute(), FindLineEntry(), lldb_private::Function::GetEndLineSourceInfo(), lldb::SBCompileUnit::GetLineEntryAtIndex(), lldb::SBCompileUnit::GetNumLineEntries(), lldb_private::Function::GetPrologueByteSize(), lldb_private::Function::GetStartLineSourceInfo(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseLineTable(), SymbolFilePDB::ParseLineTable(), ResolveSymbolContext(), lldb_private::FileLineResolver::SearchCallback(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().
|
inline |
Returns the number of functions in this compile unit.
Definition at line 418 of file CompileUnit.h.
References m_functions_by_uid.
Referenced by lldb_private::npdb::SymbolFileNativePDB::ParseFunctions().
|
inline |
Return the primary source spec associated with this compile unit.
Definition at line 232 of file CompileUnit.h.
References m_primary_support_file_sp.
Referenced by lldb_private::SearchFilterByModuleListAndCU::AddressPasses(), lldb_private::SourceManager::File::CommonInitializer(), lldb_private::SearchFilterByModuleListAndCU::CompUnitPasses(), CommandObjectTargetVariable::DoExecute(), CommandObjectSourceList::DoExecute(), Dump(), lldb_private::SymbolContext::Dump(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectTargetVariable::DumpGlobalVariableList(), lldb_private::Module::FindCompileUnits(), FindLineEntry(), lldb::SBCompileUnit::FindLineEntryIndex(), lldb_private::FormatEntity::Format(), lldb_private::Function::GetBlock(), lldb_private::BreakpointLocation::GetDescription(), GetDescription(), lldb::SBCompileUnit::GetFileSpec(), lldb_private::breakpad::SymbolFileBreakpad::ParseLineTableAndSupportFiles(), lldb_private::npdb::SymbolFileNativePDB::ResolveSymbolContext(), ResolveSymbolContext(), lldb_private::SearchFilterByModuleListAndCU::Search(), lldb_private::BreakpointResolverFileRegex::SearchCallback(), lldb_private::FileLineResolver::SearchCallback(), lldb_private::SymbolContextSpecifier::SymbolContextMatches(), and SymbolContextsMightBeEquivalent().
|
inline |
Return the primary source file associated with this compile unit.
Definition at line 237 of file CompileUnit.h.
References m_primary_support_file_sp.
|
inline |
Used by plugins that parse the support file list.
Definition at line 283 of file CompileUnit.h.
References flagsParsedSupportFiles, m_flags, m_support_files, and lldb_private::Flags::Set().
const SupportFileList & CompileUnit::GetSupportFiles | ( | ) |
Get the compile unit's support file list.
The support file list is used by the line table, and any objects that have valid Declaration objects.
Definition at line 416 of file CompileUnit.cpp.
References flagsParsedSupportFiles, lldb_private::ModuleChild::GetModule(), lldb_private::SupportFileList::GetSize(), lldb_private::Flags::IsClear(), m_flags, m_support_files, and lldb_private::Flags::Set().
Referenced by lldb_private::LineTable::ConvertEntryAtIndexToLineEntry(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), FindLineEntry(), lldb::SBCompileUnit::FindSupportFileIndex(), lldb_private::DebugMacroEntry::GetFileSpec(), GetModuleConfig(), lldb::SBCompileUnit::GetNumSupportFiles(), lldb::SBCompileUnit::GetSupportFileAtIndex(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseBlocksRecursive(), ResolveSymbolContext(), and lldb_private::FileLineResolver::SearchCallback().
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.
Definition at line 427 of file CompileUnit.cpp.
References m_user_data.
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.
[in] | can_create | If 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). |
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().
|
privatedelete |
void CompileUnit::ResolveSymbolContext | ( | const SourceLocationSpec & | src_location_spec, |
lldb::SymbolContextItem | resolve_scope, | ||
SymbolContextList & | sc_list, | ||
RealpathPrefixes * | realpath_prefixes = nullptr |
||
) |
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.
[in] | src_location_spec | The 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.
[in] | resolve_scope | For 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_list | A SymbolContext list class that will get any matching entries appended to. |
[in] | realpath_prefixes | Paths that start with one of the prefixes in this list will be realpath'ed to resolve any symlinks. |
Definition at line 249 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().
void CompileUnit::SetDebugMacros | ( | const DebugMacrosSP & | debug_macros | ) |
Definition at line 197 of file CompileUnit.cpp.
References lldb_private::Flags::Clear(), flagsParsedDebugMacros, m_debug_macros_sp, m_flags, and lldb_private::Flags::Set().
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseDebugMacros().
|
inline |
Definition at line 150 of file CompileUnit.h.
References flagsParsedLanguage, m_flags, m_language, and lldb_private::Flags::Set().
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.
[in] | line_table | A 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().
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.
[in] | variable_list_sp | A shared pointer to a VariableList. |
Definition at line 391 of file CompileUnit.cpp.
References m_variables.
Referenced by SymbolFilePDB::ParseVariables(), lldb_private::plugin::dwarf::SymbolFileDWARF::ParseVariablesForContext(), and lldb_private::npdb::SymbolFileNativePDB::ParseVariablesForContext().
|
protected |
Debug macros that will get parsed on demand.
Definition at line 439 of file CompileUnit.h.
Referenced by GetDebugMacros(), and SetDebugMacros().
|
protected |
Compile unit flags that help with partial parsing.
Definition at line 426 of file CompileUnit.h.
Referenced by CompileUnit(), GetCachedLanguage(), GetDebugMacros(), GetImportedModules(), GetLanguage(), GetLineTable(), GetSupportFileList(), GetSupportFiles(), SetDebugMacros(), SetLanguage(), and SetLineTable().
|
protected |
Maps UIDs to functions.
Definition at line 428 of file CompileUnit.h.
Referenced by AddFunction(), Dump(), FindFunction(), FindFunctionByUID(), ForeachFunction(), and GetNumFunctions().
|
protected |
All modules, including the current module, imported by this compile unit.
Definition at line 431 of file CompileUnit.h.
Referenced by GetImportedModules().
|
protected |
eLazyBoolYes if this compile unit was compiled with optimization.
Definition at line 444 of file CompileUnit.h.
Referenced by GetIsOptimized().
|
protected |
The programming language enumeration value.
Definition at line 424 of file CompileUnit.h.
Referenced by GetCachedLanguage(), GetLanguage(), and SetLanguage().
|
protected |
Line table that will get parsed on demand.
Definition at line 437 of file CompileUnit.h.
Referenced by GetLineTable(), and SetLineTable().
|
protected |
The primary file associated with this compile unit.
Definition at line 433 of file CompileUnit.h.
Referenced by GetPrimaryFile(), and GetPrimarySupportFile().
|
protected |
Files associated with this compile unit's line table and declarations.
Definition at line 435 of file CompileUnit.h.
Referenced by GetSupportFileList(), and GetSupportFiles().
|
protected |
User data for the SymbolFile parser to store information into.
Definition at line 422 of file CompileUnit.h.
Referenced by GetUserData().
|
protected |
Global and static variable list that will get parsed on demand.
Definition at line 441 of file CompileUnit.h.
Referenced by Dump(), GetVariableList(), and SetVariableList().