LLDB mainline
|
A class that describes an executable image and its associated object and symbol files. More...
#include "lldb/Core/Module.h"
Classes | |
class | LookupInfo |
A class that encapsulates name lookup information. More... | |
Public Member Functions | |
Module (const FileSpec &file_spec, const ArchSpec &arch, ConstString object_name=ConstString(), lldb::offset_t object_offset=0, const llvm::sys::TimePoint<> &object_mod_time=llvm::sys::TimePoint<>()) | |
Construct with file specification and architecture. | |
Module (const ModuleSpec &module_spec) | |
~Module () override | |
Destructor. | |
bool | MatchesModuleSpec (const ModuleSpec &module_ref) |
bool | SetLoadAddress (Target &target, lldb::addr_t value, bool value_is_offset, bool &changed) |
Set the load address for all sections in a module to be the file address plus slide. | |
void | CalculateSymbolContext (SymbolContext *sc) override |
Reconstruct the object's symbol context into sc. | |
lldb::ModuleSP | CalculateSymbolContextModule () override |
void | GetDescription (llvm::raw_ostream &s, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull) |
std::string | GetSpecificationDescription () const |
Get the module path and object name. | |
void | Dump (Stream *s) |
Dump a description of this object to a Stream. | |
void | DumpSymbolContext (Stream *s) override |
Dump the object's symbol context to the stream s. | |
const Symbol * | FindFirstSymbolWithNameAndType (ConstString name, lldb::SymbolType symbol_type=lldb::eSymbolTypeAny) |
Find a symbol in the object file's symbol table. | |
void | FindSymbolsWithNameAndType (ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) |
void | FindSymbolsMatchingRegExAndType (const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list, Mangled::NamePreference mangling_preference=Mangled::ePreferDemangled) |
void | FindFunctionSymbols (ConstString name, uint32_t name_type_mask, SymbolContextList &sc_list) |
Find a function symbols in the object file's symbol table. | |
void | FindCompileUnits (const FileSpec &path, SymbolContextList &sc_list) |
Find compile units by partial or full path. | |
void | FindFunctions (const LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) |
Find functions by lookup info. | |
void | FindFunctions (ConstString name, const CompilerDeclContext &parent_decl_ctx, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) |
Find functions by name. | |
void | FindFunctions (llvm::ArrayRef< CompilerContext > compiler_ctx, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) |
Find functions by compiler context. | |
void | FindFunctions (const RegularExpression ®ex, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) |
Find functions by name. | |
void | FindAddressesForLine (const lldb::TargetSP target_sp, const FileSpec &file, uint32_t line, Function *function, std::vector< Address > &output_local, std::vector< Address > &output_extern) |
Find addresses by file/line. | |
void | FindGlobalVariables (ConstString name, const CompilerDeclContext &parent_decl_ctx, size_t max_matches, VariableList &variable_list) |
Find global and static variables by name. | |
void | FindGlobalVariables (const RegularExpression ®ex, size_t max_matches, VariableList &variable_list) |
Find global and static variables by regular expression. | |
void | FindTypes (const TypeQuery &query, TypeResults &results) |
Find types using a type-matching object that contains all search parameters. | |
const ArchSpec & | GetArchitecture () const |
Get const accessor for the module architecture. | |
const FileSpec & | GetFileSpec () const |
Get const accessor for the module file specification. | |
const FileSpec & | GetPlatformFileSpec () const |
Get accessor for the module platform file specification. | |
void | SetPlatformFileSpec (const FileSpec &file) |
const FileSpec & | GetRemoteInstallFileSpec () const |
void | SetRemoteInstallFileSpec (const FileSpec &file) |
const FileSpec & | GetSymbolFileFileSpec () const |
void | PreloadSymbols () |
void | SetSymbolFileFileSpec (const FileSpec &file) |
const llvm::sys::TimePoint & | GetModificationTime () const |
const llvm::sys::TimePoint & | GetObjectModificationTime () const |
void | RegisterXcodeSDK (llvm::StringRef sdk, llvm::StringRef sysroot) |
This callback will be called by SymbolFile implementations when parsing a compile unit that contains SDK information. | |
bool | IsExecutable () |
Tells whether this module is capable of being the main executable for a process. | |
bool | IsLoadedInTarget (Target *target) |
Tells whether this module has been loaded in the target passed in. | |
bool | LoadScriptingResourceInTarget (Target *target, Status &error, Stream &feedback_stream) |
size_t | GetNumCompileUnits () |
Get the number of compile units for this module. | |
lldb::CompUnitSP | GetCompileUnitAtIndex (size_t idx) |
ConstString | GetObjectName () const |
uint64_t | GetObjectOffset () const |
virtual ObjectFile * | GetObjectFile () |
Get the object file representation for the current architecture. | |
virtual SectionList * | GetSectionList () |
Get the unified section list for the module. | |
virtual void | SectionFileAddressesChanged () |
Notify the module that the file addresses for the Sections have been updated. | |
UnwindTable & | GetUnwindTable () |
Returns a reference to the UnwindTable for this Module. | |
llvm::VersionTuple | GetVersion () |
ObjectFile * | GetMemoryObjectFile (const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, Status &error, size_t size_to_read=512) |
Load an object file from memory. | |
virtual SymbolFile * | GetSymbolFile (bool can_create=true, Stream *feedback_strm=nullptr) |
Get the module's symbol file. | |
Symtab * | GetSymtab () |
const lldb_private::UUID & | GetUUID () |
Get a reference to the UUID value contained in this object. | |
void | ParseAllDebugSymbols () |
A debugging function that will cause everything in a module to be parsed. | |
bool | ResolveFileAddress (lldb::addr_t vm_addr, Address &so_addr) |
uint32_t | ResolveSymbolContextForAddress (const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc, bool resolve_tail_call_address=false) |
Resolve the symbol context for the given address. | |
uint32_t | ResolveSymbolContextForFilePath (const char *file_path, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) |
Resolve items in the symbol context for a given file and line. | |
uint32_t | ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) |
Resolve items in the symbol context for a given file and line. | |
void | SetFileSpecAndObjectName (const FileSpec &file, ConstString object_name) |
bool | GetIsDynamicLinkEditor () |
llvm::Expected< lldb::TypeSystemSP > | GetTypeSystemForLanguage (lldb::LanguageType language) |
void | ForEachTypeSystem (llvm::function_ref< bool(lldb::TypeSystemSP)> callback) |
Call callback for each TypeSystem in this Module . | |
template<typename... Args> | |
void | LogMessage (Log *log, const char *format, Args &&...args) |
template<typename... Args> | |
void | LogMessageVerboseBacktrace (Log *log, const char *format, Args &&...args) |
template<typename... Args> | |
void | ReportWarning (const char *format, Args &&...args) |
template<typename... Args> | |
void | ReportError (const char *format, Args &&...args) |
template<typename... Args> | |
void | ReportErrorIfModifyDetected (const char *format, Args &&...args) |
void | ReportWarningOptimization (std::optional< lldb::user_id_t > debugger_id) |
void | ReportWarningUnsupportedLanguage (lldb::LanguageType language, std::optional< lldb::user_id_t > debugger_id) |
bool | FileHasChanged () const |
std::recursive_mutex & | GetMutex () const |
PathMappingList & | GetSourceMappingList () |
const PathMappingList & | GetSourceMappingList () const |
bool | FindSourceFile (const FileSpec &orig_spec, FileSpec &new_spec) const |
Finds a source file given a file spec using the module source path remappings (if any). | |
std::optional< std::string > | RemapSourceFile (llvm::StringRef path) const |
Remaps a source file given path into new_path. | |
bool | RemapSourceFile (const char *, std::string &) const =delete |
bool | MergeArchitecture (const ArchSpec &arch_spec) |
Update the ArchSpec to a more specific variant. | |
StatsDuration & | GetSymtabParseTime () |
Accessor for the symbol table parse time metric. | |
StatsDuration & | GetSymtabIndexTime () |
Accessor for the symbol table index time metric. | |
uint32_t | Hash () |
Get a unique hash for this module. | |
std::string | GetCacheKey () |
Get a unique cache key for the current module. | |
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. | |
Static Public Member Functions | |
static size_t | GetNumberAllocatedModules () |
static Module * | GetAllocatedModuleAtIndex (size_t idx) |
static std::recursive_mutex & | GetAllocationModuleCollectionMutex () |
template<typename ObjFilePlugin , typename... Args> | |
static lldb::ModuleSP | CreateModuleFromObjectFile (Args &&...args) |
static DataFileCache * | GetIndexCache () |
Get the global index file cache. | |
Protected Member Functions | |
void | SymbolIndicesToSymbolContextList (Symtab *symtab, std::vector< uint32_t > &symbol_indexes, SymbolContextList &sc_list) |
bool | SetArchitecture (const ArchSpec &new_arch) |
void | SetUUID (const lldb_private::UUID &uuid) |
SectionList * | GetUnifiedSectionList () |
Protected Attributes | |
std::recursive_mutex | m_mutex |
A mutex to keep this object happy in multi-threaded environments. | |
llvm::sys::TimePoint | m_mod_time |
The modification time for this module when it was created. | |
ArchSpec | m_arch |
The architecture for this module. | |
UUID | m_uuid |
Each module is assumed to have a unique identifier to help match it up to debug symbols. | |
FileSpec | m_file |
The file representation on disk for this module (if there is one). | |
FileSpec | m_platform_file |
The path to the module on the platform on which it is being debugged. | |
FileSpec | m_remote_install_file |
If set when debugging on remote platforms, this module will be installed at this location. | |
FileSpec | m_symfile_spec |
If this path is valid, then this is the file that will be used as the symbol file for this module. | |
ConstString | m_object_name |
The name an object within this module that is selected, or empty of the module is represented by m_file. | |
uint64_t | m_object_offset = 0 |
llvm::sys::TimePoint | m_object_mod_time |
lldb::DataBufferSP | m_data_sp |
DataBuffer containing the module image, if it was provided at construction time. | |
lldb::ObjectFileSP | m_objfile_sp |
A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile. | |
UnwindTable | m_unwind_table |
Table of FuncUnwinders objects created for this Module's functions. | |
lldb::SymbolVendorUP | m_symfile_up |
A pointer to the symbol vendor for this module. | |
std::vector< lldb::SymbolVendorUP > | m_old_symfiles |
If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file,. | |
TypeSystemMap | m_type_system_map |
A map of any type systems associated with this module. | |
PathMappingList | m_source_mappings |
Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are. | |
lldb::SectionListUP | m_sections_up |
Unified section list for module that is used by the ObjectFile and ObjectFile instances for the debug info. | |
std::atomic< bool > | m_did_load_objfile {false} |
std::atomic< bool > | m_did_load_symfile {false} |
std::atomic< bool > | m_did_set_uuid {false} |
bool | m_file_has_changed: 1 |
bool | m_first_file_changed_log: 1 |
StatsDuration | m_symtab_parse_time |
See if the module was modified after it was initially opened. | |
StatsDuration | m_symtab_index_time |
We store a symbol named index time duration here because we might have an object file and a symbol file which both have symbol tables. | |
std::once_flag | m_optimization_warning |
std::once_flag | m_language_warning |
Private Member Functions | |
Module () | |
Module (const Module &)=delete | |
const Module & | operator= (const Module &)=delete |
void | LogMessage (Log *log, const llvm::formatv_object_base &payload) |
void | LogMessageVerboseBacktrace (Log *log, const llvm::formatv_object_base &payload) |
void | ReportWarning (const llvm::formatv_object_base &payload) |
void | ReportError (const llvm::formatv_object_base &payload) |
void | ReportErrorIfModifyDetected (const llvm::formatv_object_base &payload) |
Friends | |
class | ModuleList |
class | ObjectFile |
class | SymbolFile |
A class that describes an executable image and its associated object and symbol files.
The module is designed to be able to select a single slice of an executable image as it would appear on disk and during program execution.
Modules control when and if information is parsed according to which accessors are called. For example the object file (ObjectFile) representation will only be parsed if the object file is requested using the Module::GetObjectFile() is called. The debug symbols will only be parsed if the symbol file (SymbolFile) is requested using the Module::GetSymbolFile() method.
The module will parse more detailed information as more queries are made.
Module::Module | ( | const FileSpec & | file_spec, |
const ArchSpec & | arch, | ||
ConstString | object_name = ConstString() , |
||
lldb::offset_t | object_offset = 0 , |
||
const llvm::sys::TimePoint<> & | object_mod_time = llvm::sys::TimePoint<>() |
||
) |
Construct with file specification and architecture.
Clients that wish to share modules with other targets should use ModuleList::GetSharedModule().
[in] | file_spec | The file specification for the on disk representation of this executable image. |
[in] | arch | The architecture to set as the current architecture in this module. |
[in] | object_name | The name of an object in a module used to extract a module within a module (.a files and modules that contain multiple architectures). |
[in] | object_offset | The offset within an existing module used to extract a module within a module (.a files and modules that contain multiple architectures). |
Definition at line 236 of file Module.cpp.
References lldb_private::ConstString::AsCString(), GetAllocationModuleCollectionMutex(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::GetLog(), GetModuleCollection(), lldb_private::FileSpec::GetPath(), lldb_private::ConstString::IsEmpty(), LLDB_LOGF, m_arch, m_file, m_object_name, lldb_private::Modules, and lldb_private::Object.
Module::Module | ( | const ModuleSpec & | module_spec | ) |
Definition at line 133 of file Module.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::ModuleSpecList::FindMatchingModuleSpec(), GetAllocationModuleCollectionMutex(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::ModuleSpec::GetData(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::GetLog(), lldb_private::FileSystem::GetModificationTime(), GetModuleCollection(), lldb_private::ObjectFile::GetModuleSpecifications(), lldb_private::ModuleSpec::GetObjectModificationTime(), lldb_private::ModuleSpec::GetObjectName(), lldb_private::ModuleSpec::GetObjectOffset(), lldb_private::FileSpec::GetPath(), lldb_private::ModuleSpec::GetPlatformFileSpec(), lldb_private::ModuleSpec::GetSymbolFileSpec(), lldb_private::FileSystem::Instance(), lldb_private::ConstString::IsEmpty(), lldb_private::ArchSpec::IsValid(), LLDB_LOGF, m_arch, m_data_sp, m_file, m_mod_time, m_object_mod_time, m_object_name, m_object_offset, m_platform_file, m_symfile_spec, lldb_private::Modules, and lldb_private::Object.
|
override |
Destructor.
Definition at line 267 of file Module.cpp.
References lldb_private::ConstString::AsCString(), GetAllocationModuleCollectionMutex(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::GetLog(), GetModuleCollection(), lldb_private::FileSpec::GetPath(), lldb_private::ConstString::IsEmpty(), LLDB_LOGF, m_arch, m_file, m_mutex, m_object_name, m_objfile_sp, m_sections_up, m_symfile_up, lldb_private::Modules, and lldb_private::Object.
|
private |
Definition at line 259 of file Module.cpp.
References GetAllocationModuleCollectionMutex(), and GetModuleCollection().
Referenced by CreateModuleFromObjectFile().
|
privatedelete |
|
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 414 of file Module.cpp.
References lldb_private::SymbolContext::module_sp.
Referenced by SymbolIndicesToSymbolContextList().
|
overridevirtual |
Reimplemented from lldb_private::SymbolContextScope.
Definition at line 418 of file Module.cpp.
|
inlinestatic |
void Module::Dump | ( | Stream * | s | ) |
Dump a description of this object to a Stream.
Dump a description of the contents of this object to the supplied stream s. The dumped content will be only what has been loaded or parsed up to this point at which this function is called, so this is a good way to see what has been parsed in a module.
[in] | s | The stream to which to dump the object description. |
Definition at line 1166 of file Module.cpp.
References lldb_private::ObjectFile::Dump(), lldb_private::ConstString::GetCString(), GetObjectFile(), lldb_private::FileSpec::GetPath(), GetSymbolFile(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), m_file, m_mutex, m_object_name, and lldb_private::Stream::Printf().
|
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 420 of file Module.cpp.
References lldb_private::Stream::Printf().
bool Module::FileHasChanged | ( | ) | const |
Definition at line 1074 of file Module.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_data_sp, m_file, m_file_has_changed, and m_mod_time.
Referenced by lldb_private::Target::ModulesDidUnload(), and ReportErrorIfModifyDetected().
void Module::FindAddressesForLine | ( | const lldb::TargetSP | target_sp, |
const FileSpec & | file, | ||
uint32_t | line, | ||
Function * | function, | ||
std::vector< Address > & | output_local, | ||
std::vector< Address > & | output_extern | ||
) |
Find addresses by file/line.
[in] | target_sp | The target the addresses are desired for. |
[in] | file | Source file to locate. |
[in] | line | Source line to locate. |
[in] | function | Optional filter function. Addresses within this function will be added to the 'local' list. All others will be added to the 'extern' list. |
[out] | output_local | All matching addresses within 'function' |
[out] | output_extern | All matching addresses not within 'function' |
Definition at line 951 of file Module.cpp.
References lldb_private::Address::CalculateSymbolContextFunction(), lldb_private::AddressResolver::GetAddressRangeAtIndex(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressResolver::GetNumberOfAddresses(), m_file, and lldb_private::AddressResolver::ResolveAddress().
void Module::FindCompileUnits | ( | const FileSpec & | path, |
SymbolContextList & | sc_list | ||
) |
Find compile units by partial or full path.
Finds all compile units that match path in all of the modules and returns the results in sc_list.
[in] | path | The name of the function we are looking for. |
[out] | sc_list | A symbol context list that gets filled in with all of the matches. |
Definition at line 626 of file Module.cpp.
References lldb_private::SymbolContextList::Append(), lldb_private::SymbolContext::comp_unit, GetCompileUnitAtIndex(), GetNumCompileUnits(), lldb_private::CompileUnit::GetPrimaryFile(), lldb_private::FileSpec::Match(), and lldb_private::SymbolContext::module_sp.
const Symbol * Module::FindFirstSymbolWithNameAndType | ( | ConstString | name, |
lldb::SymbolType | symbol_type = lldb::eSymbolTypeAny |
||
) |
Find a symbol in the object file's symbol table.
[in] | name | The name of the symbol that we are looking for. |
[in] | symbol_type | If set to eSymbolTypeAny, find a symbol of any type that has a name that matches name. If set to any other valid SymbolType enumeration value, then search only for symbols that match symbol_type. |
Definition at line 1261 of file Module.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::Symtab::eDebugAny, lldb_private::Symtab::eVisibilityAny, GetSymtab(), and LLDB_SCOPED_TIMERF.
void Module::FindFunctions | ( | const LookupInfo & | lookup_info, |
const CompilerDeclContext & | parent_decl_ctx, | ||
const ModuleFunctionSearchOptions & | options, | ||
SymbolContextList & | sc_list | ||
) |
Find functions by lookup info.
If the function is an inlined function, it will have a block, representing the inlined function, and the function will be the containing function. If it is not inlined, then the block will be NULL.
[in] | lookup_info | The lookup info of the function we are looking for. |
[out] | sc_list | A symbol context list that gets filled in with all of the matches. |
Definition at line 830 of file Module.cpp.
References lldb_private::Module::LookupInfo::GetLookupName(), lldb_private::Module::LookupInfo::GetNameTypeMask(), GetSymbolFile(), lldb_private::ModuleFunctionSearchOptions::include_inlines, and lldb_private::ModuleFunctionSearchOptions::include_symbols.
Referenced by lldb_private::SourceManager::GetDefaultFileAndLine(), and LookupFunctionInModule().
void Module::FindFunctions | ( | const RegularExpression & | regex, |
const ModuleFunctionSearchOptions & | options, | ||
SymbolContextList & | sc_list | ||
) |
Find functions by name.
If the function is an inlined function, it will have a block, representing the inlined function, and the function will be the containing function. If it is not inlined, then the block will be NULL.
[in] | regex | A regular expression to use when matching the name. |
[out] | sc_list | A symbol context list that gets filled in with all of the matches. |
Definition at line 881 of file Module.cpp.
References lldb_private::SymbolContextList::Append(), lldb_private::Symtab::AppendSymbolIndexesMatchingRegExAndType(), lldb_private::SymbolContext::block, lldb_private::Symtab::eDebugAny, lldb_private::SymbolContextList::end(), lldb::eSymbolTypeAny, lldb::eSymbolTypeCode, lldb::eSymbolTypeResolver, lldb_private::Symtab::eVisibilityAny, lldb_private::SymbolContext::function, lldb_private::Function::GetAddressRange(), lldb_private::Symbol::GetAddressRef(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetFileAddress(), lldb_private::SymbolContextList::GetSize(), GetSymbolFile(), lldb_private::Symbol::GetType(), lldb_private::ModuleFunctionSearchOptions::include_inlines, lldb_private::ModuleFunctionSearchOptions::include_symbols, lldb_private::SymbolContext::symbol, lldb_private::Symtab::SymbolAtIndex(), and lldb_private::Symbol::ValueIsAddress().
void lldb_private::Module::FindFunctions | ( | ConstString | name, |
const CompilerDeclContext & | parent_decl_ctx, | ||
lldb::FunctionNameType | name_type_mask, | ||
const ModuleFunctionSearchOptions & | options, | ||
SymbolContextList & | sc_list | ||
) |
Find functions by name.
If the function is an inlined function, it will have a block, representing the inlined function, and the function will be the containing function. If it is not inlined, then the block will be NULL.
[in] | name | The name of the function we are looking for. |
[in] | name_type_mask | A bit mask of bits that indicate what kind of names should be used when doing the lookup. Bits include fully qualified names, base names, C++ methods, or ObjC selectors. See FunctionNameType for more details. |
[out] | sc_list | A symbol context list that gets filled in with all of the matches. |
void lldb_private::Module::FindFunctions | ( | llvm::ArrayRef< CompilerContext > | compiler_ctx, |
lldb::FunctionNameType | name_type_mask, | ||
const ModuleFunctionSearchOptions & | options, | ||
SymbolContextList & | sc_list | ||
) |
Find functions by compiler context.
void Module::FindFunctionSymbols | ( | ConstString | name, |
uint32_t | name_type_mask, | ||
SymbolContextList & | sc_list | ||
) |
Find a function symbols in the object file's symbol table.
[in] | name | The name of the symbol that we are looking for. |
[in] | name_type_mask | A mask that has one or more bitwise OR'ed values from the lldb::FunctionNameType enumeration type that indicate what kind of names we are looking for. |
[out] | sc_list | A list to append any matching symbol contexts to. |
Definition at line 1289 of file Module.cpp.
References lldb_private::ConstString::AsCString(), GetSymtab(), and LLDB_SCOPED_TIMERF.
void Module::FindGlobalVariables | ( | const RegularExpression & | regex, |
size_t | max_matches, | ||
VariableList & | variable_list | ||
) |
Find global and static variables by regular expression.
[in] | regex | A regular expression to use when matching the name. |
[in] | max_matches | Allow the number of matches to be limited to max_matches. Specify UINT32_MAX to get all possible matches. |
[in] | variable_list | A list of variables that gets the matches appended to. |
Definition at line 619 of file Module.cpp.
References lldb_private::SymbolFile::FindGlobalVariables(), and GetSymbolFile().
void Module::FindGlobalVariables | ( | ConstString | name, |
const CompilerDeclContext & | parent_decl_ctx, | ||
size_t | max_matches, | ||
VariableList & | variable_list | ||
) |
Find global and static variables by name.
[in] | name | The name of the global or static variable we are looking for. |
[in] | parent_decl_ctx | If valid, a decl context that results must exist within |
[in] | max_matches | Allow the number of matches to be limited to max_matches. Specify UINT32_MAX to get all possible matches. |
[in] | variable_list | A list of variables that gets the matches appended to. |
Definition at line 612 of file Module.cpp.
References GetSymbolFile().
Finds a source file given a file spec using the module source path remappings (if any).
Tries to resolve orig_spec by checking the module source path remappings. It makes sure the file exists, so this call can be expensive if the remappings are on a network file system, so use this function sparingly (not in a tight debug info parsing loop).
[in] | orig_spec | The original source file path to try and remap. |
[out] | new_spec | The newly remapped filespec that is guaranteed to exist. |
Definition at line 1544 of file Module.cpp.
References lldb_private::PathMappingList::FindFile(), m_mutex, and m_source_mappings.
void Module::FindSymbolsMatchingRegExAndType | ( | const RegularExpression & | regex, |
lldb::SymbolType | symbol_type, | ||
SymbolContextList & | sc_list, | ||
Mangled::NamePreference | mangling_preference = Mangled::ePreferDemangled |
||
) |
Definition at line 1309 of file Module.cpp.
References lldb_private::Symtab::eDebugAny, lldb_private::Symtab::eVisibilityAny, GetSymtab(), lldb_private::RegularExpression::GetText(), LLDB_SCOPED_TIMERF, and SymbolIndicesToSymbolContextList().
void Module::FindSymbolsWithNameAndType | ( | ConstString | name, |
lldb::SymbolType | symbol_type, | ||
SymbolContextList & | sc_list | ||
) |
Definition at line 1297 of file Module.cpp.
References GetSymtab(), and SymbolIndicesToSymbolContextList().
Referenced by lldb_private::SymbolContext::FindBestGlobalDataSymbol(), and lldb_private::ClangExpressionDeclMap::GetSymbolAddress().
void Module::FindTypes | ( | const TypeQuery & | query, |
TypeResults & | results | ||
) |
Find types using a type-matching object that contains all search parameters.
[in] | query | A type matching object that contains all of the details of the type search. |
[in] | results | Any matching types will be populated into the results object using TypeMap::InsertUnique(...). |
Definition at line 975 of file Module.cpp.
References GetSymbolFile().
Referenced by lldb_private::ModuleList::FindTypes(), LookupTypeHere(), and LookupTypeInModule().
void Module::ForEachTypeSystem | ( | llvm::function_ref< bool(lldb::TypeSystemSP)> | callback | ) |
Call callback
for each TypeSystem
in this Module
.
Return true from callback to keep iterating, false to stop iterating.
Definition at line 376 of file Module.cpp.
References lldb_private::TypeSystemMap::ForEach(), and m_type_system_map.
Referenced by lldb_private::DebuggerStats::ReportStatistics().
|
static |
Definition at line 124 of file Module.cpp.
References GetAllocationModuleCollectionMutex(), and GetModuleCollection().
Referenced by CommandObjectTargetModulesList::DoExecute(), FindModulesByName(), and lldb_private::DebuggerStats::ReportStatistics().
|
static |
Definition at line 106 of file Module.cpp.
Referenced by CommandObjectTargetModulesDumpSections::DoExecute(), CommandObjectTargetModulesDumpClangAST::DoExecute(), CommandObjectTargetModulesList::DoExecute(), FindModulesByName(), GetAllocatedModuleAtIndex(), GetNumberAllocatedModules(), Module(), lldb_private::DebuggerStats::ReportStatistics(), and ~Module().
const ArchSpec & Module::GetArchitecture | ( | ) | const |
Get const accessor for the module architecture.
Definition at line 1040 of file Module.cpp.
References m_arch.
Referenced by ProcessKDP::CanDebug(), lldb_private::TypeSystemClang::CreateInstance(), CommandObjectPlatformProcessLaunch::DoExecute(), DynamicLoaderMacOSXDYLD::DoInitialImageFetch(), lldb_private::plugin::dwarf::ManualDWARFIndex::Dump(), DumpModuleArchitecture(), DumpModuleSections(), lldb_private::UnwindTable::GetArchitecture(), lldb_private::ModuleList::LogUUIDAndPaths(), and lldb_private::DebuggerStats::ReportStatistics().
std::string Module::GetCacheKey | ( | ) |
Get a unique cache key for the current module.
The cache key must be unique for a file on disk and not change if the file is updated. This allows cache data to use this key as a prefix and as files are modified in disk, we will overwrite the cache files. If one file can contain multiple files, like a universal mach-o file or like a BSD archive, the cache key must contain enough information to differentiate these different files.
Definition at line 1631 of file Module.cpp.
References lldb_private::FileSpec::GetFilename(), lldb_private::ArchSpec::GetTriple(), Hash(), m_arch, m_file, and m_object_name.
CompUnitSP Module::GetCompileUnitAtIndex | ( | size_t | idx | ) |
Definition at line 431 of file Module.cpp.
References GetNumCompileUnits(), GetSymbolFile(), and m_mutex.
Referenced by CommandObjectSourceInfo::DumpFileLinesInModule(), FindCompileUnits(), and GetModuleConfig().
void Module::GetDescription | ( | llvm::raw_ostream & | s, |
lldb::DescriptionLevel | level = lldb::eDescriptionLevelFull |
||
) |
Definition at line 1052 of file Module.cpp.
References lldb::eDescriptionLevelBrief, lldb::eDescriptionLevelFull, lldb_private::ArchSpec::GetArchitectureName(), lldb_private::ConstString::GetCString(), lldb_private::FileSpec::GetFilename(), lldb_private::FileSpec::GetPath(), lldb_private::ArchSpec::IsValid(), m_arch, m_file, m_object_name, and PATH_MAX.
Referenced by lldb_private::plugin::dwarf::ManualDWARFIndex::Index(), LogMessage(), LogMessageVerboseBacktrace(), ReportError(), ReportErrorIfModifyDetected(), and ReportWarning().
|
inline |
Get const accessor for the module file specification.
This function returns the file for the module on the host system that is running LLDB. This can differ from the path on the platform since we might be doing remote debugging.
Definition at line 452 of file Module.h.
References m_file.
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::CanDebug(), lldb_private::TypeSystemClang::CreateInstance(), CommandObjectPlatformProcessLaunch::DoExecute(), CommandObjectTargetModulesLoad::DoExecute(), lldb_private::UnwindTable::Dump(), lldb_private::Target::Dump(), DumpCompileUnitLineTable(), CommandObjectSourceInfo::DumpFileLinesInCompUnit(), CommandObjectSourceInfo::DumpLinesInSymbolContexts(), DumpTargetInfo(), lldb_private::FormatEntity::Format(), lldb::SBProcess::GetDescription(), lldb_private::Target::GetEntryPointAddress(), lldb::SBTarget::GetExecutable(), GetObjectFile(), lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(), GetSpecificationDescription(), lldb_private::Value::GetValueAsData(), HexagonDYLDRendezvous::HexagonDYLDRendezvous(), lldb_private::Process::LaunchPrivate(), LoadScriptingResourceInTarget(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), lldb_private::ModuleList::LogUUIDAndPaths(), LookupFileAndLineInModule(), LookupFunctionInModule(), LookupSymbolInModule(), LookupTypeHere(), LookupTypeInModule(), CommandObjectTargetModulesList::PrintModule(), lldb_private::DebuggerStats::ReportStatistics(), ReportWarningOptimization(), DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint(), and UUIDsMatch().
|
static |
Get the global index file cache.
LLDB can cache data for a module between runs. This cache directory can be used to stored data that previously was manually created each time you debug. Examples include debug information indexes, symbol tables, symbol table indexes, and more.
Definition at line 1641 of file Module.cpp.
References lldb_private::ModuleList::GetGlobalModuleListProperties().
Referenced by lldb_private::Symtab::LoadFromCache(), lldb_private::plugin::dwarf::ManualDWARFIndex::LoadFromCache(), lldb_private::Symtab::SaveToCache(), and lldb_private::plugin::dwarf::ManualDWARFIndex::SaveToCache().
bool Module::GetIsDynamicLinkEditor | ( | ) |
Definition at line 1608 of file Module.cpp.
References lldb_private::ObjectFile::GetIsDynamicLinkEditor(), and GetObjectFile().
ObjectFile * Module::GetMemoryObjectFile | ( | const lldb::ProcessSP & | process_sp, |
lldb::addr_t | header_addr, | ||
Status & | error, | ||
size_t | size_to_read = 512 |
||
) |
Load an object file from memory.
If available, the size of the object file in memory may be passed to avoid additional round trips to process memory. If the size is not provided, a default value is used. This value should be large enough to enable the ObjectFile plugins to read the header of the object file without going back to the process.
error
for more information in that case). Definition at line 297 of file Module.cpp.
References lldb_private::Status::AsCString(), error(), lldb_private::ObjectFile::FindPlugin(), lldb_private::StreamString::GetString(), m_arch, m_did_load_objfile, m_mutex, m_object_name, m_objfile_sp, m_unwind_table, lldb_private::ArchSpec::MergeFrom(), lldb_private::UnwindTable::ModuleWasUpdated(), lldb_private::Stream::Printf(), and lldb_private::ConstString::SetString().
|
inline |
Definition at line 488 of file Module.h.
References m_mod_time.
Referenced by lldb_private::CacheSignature::CacheSignature(), and CommandObjectTargetModulesList::PrintModule().
|
inline |
|
static |
Definition at line 118 of file Module.cpp.
References GetAllocationModuleCollectionMutex(), and GetModuleCollection().
Referenced by CommandObjectTargetModulesList::DoExecute(), FindModulesByName(), lldb::SBModule::GetNumberAllocatedModules(), and lldb_private::DebuggerStats::ReportStatistics().
size_t Module::GetNumCompileUnits | ( | ) |
Get the number of compile units for this module.
Definition at line 424 of file Module.cpp.
References GetSymbolFile(), and m_mutex.
Referenced by CommandObjectSourceInfo::DumpFileLinesInModule(), FindCompileUnits(), GetCompileUnitAtIndex(), GetModuleConfig(), and ParseAllDebugSymbols().
|
virtual |
Get the object file representation for the current architecture.
If the object file has not been located or parsed yet, this function will find the best ObjectFile plug-in that can parse Module::m_file.
Definition at line 1189 of file Module.cpp.
References lldb_private::ObjectFile::FindPlugin(), lldb_private::FileSystem::GetByteSize(), GetFileSpec(), lldb_private::FileSystem::Instance(), LLDB_SCOPED_TIMERF, m_arch, m_data_sp, m_did_load_objfile, m_file, m_mutex, m_object_offset, m_objfile_sp, m_unwind_table, lldb_private::ArchSpec::MergeFrom(), lldb_private::UnwindTable::ModuleWasUpdated(), and ReportError().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::CanDebug(), ProcessKDP::CanDebug(), SystemRuntimeMacOSX::CreateInstance(), DynamicLoaderMacOS::CreateInstance(), DynamicLoaderMacOSXDYLD::CreateInstance(), DynamicLoaderStatic::CreateInstance(), CommandObjectTargetModulesLoad::DoExecute(), lldb_private::plugin::dwarf::ManualDWARFIndex::Dump(), Dump(), DynamicLoaderFreeBSDKernel::FindKernelAtLoadAddress(), lldb_private::UnwindTable::GetAllowAssemblyEmulationUnwindPlans(), DynamicLoaderHexagonDYLD::GetEntryPoint(), lldb_private::Target::GetEntryPointAddress(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(), GetIsDynamicLinkEditor(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex(), GetSectionList(), GetSymbolFile(), GetUUID(), lldb_private::Value::GetValueAsData(), GetVersion(), lldb_private::UnwindTable::Initialize(), is_kernel(), is_kmod(), is_reloc(), IsExecutable(), IsLoadedInTarget(), lldb_private::Target::ModulesDidUnload(), CommandObjectTargetModulesList::PrintModule(), lldb_private::DebuggerStats::ReportStatistics(), DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(), SectionFileAddressesChanged(), SetLoadAddress(), lldb_private::DynamicLoaderDarwin::UnloadModuleSections(), and lldb_private::DynamicLoaderDarwin::UpdateImageLoadAddress().
|
inline |
Definition at line 492 of file Module.h.
References m_object_mod_time.
Referenced by lldb_private::CacheSignature::CacheSignature().
ConstString Module::GetObjectName | ( | ) | const |
Definition at line 1187 of file Module.cpp.
References m_object_name.
Referenced by DynamicLoaderHexagonDYLD::GetThreadLocalData(), MatchesModuleSpec(), CommandObjectTargetModulesList::PrintModule(), and lldb_private::DebuggerStats::ReportStatistics().
|
inline |
Definition at line 533 of file Module.h.
References m_object_offset.
|
inline |
Get accessor for the module platform file specification.
Platform file refers to the path of the module as it is known on the remote system on which it is being debugged. For local debugging this is always the same as Module::GetFileSpec(). But remote debugging might mention a file "/usr/lib/liba.dylib" which might be locally downloaded and cached. In this case the platform file could be something like: "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib" The file could also be cached in a local developer kit directory.
Definition at line 466 of file Module.h.
References m_file, and m_platform_file.
Referenced by lldb::SBTarget::Launch(), MatchesModuleSpec(), lldb::SBProcess::RemoteLaunch(), and DYLDRendezvous::UpdateExecutablePath().
|
inline |
Definition at line 474 of file Module.h.
References m_remote_install_file.
|
virtual |
Get the unified section list for the module.
This is the section list created by the module's object file and any debug info and symbol files created by the symbol vendor.
If the symbol vendor has not been loaded yet, this function will return the section list for the object file.
Definition at line 1231 of file Module.cpp.
References lldb_private::ObjectFile::CreateSections(), GetObjectFile(), GetUnifiedSectionList(), and m_sections_up.
Referenced by lldb_private::breakpad::SymbolFileBreakpad::AddSymbols(), CommandObjectTargetModulesLoad::DoExecute(), DumpModuleSections(), lldb_private::UnwindTable::Initialize(), IsLoadedInTarget(), ResolveFileAddress(), and SetSymbolFileFileSpec().
|
inline |
Definition at line 827 of file Module.h.
References m_source_mappings.
|
inline |
Definition at line 829 of file Module.h.
References m_source_mappings.
std::string Module::GetSpecificationDescription | ( | ) | const |
Get the module path and object name.
Modules can refer to object files. In this case the specification is simple and would return the path to the file:
"/usr/lib/foo.dylib"
Modules can be .o files inside of a BSD archive (.a file). In this case, the object specification will look like:
"/usr/lib/foo.a(bar.o)"
There are many places where logging wants to log this fully qualified specification, so we centralize this functionality here.
Definition at line 1042 of file Module.cpp.
References lldb_private::ConstString::GetCString(), GetFileSpec(), and m_object_name.
Referenced by DumpModuleSections(), and lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap().
|
virtual |
Get the module's symbol file.
If the symbol file has already been loaded, this function returns it. All arguments are ignored. If the symbol file has not been located yet, and the can_create argument is false, the function returns nullptr. If can_create is true, this function will find the best SymbolFile plug-in that can use the current object file. feedback_strm, if not null, is used to report the details of the search process.
Reimplemented in lldb_private::plugin::dwarf::DebugMapModule.
Definition at line 998 of file Module.cpp.
References DebuggersOwningModuleRequestingInterruption(), lldb_private::SymbolVendor::FindPlugin(), GetObjectFile(), LLDB_SCOPED_TIMER, m_did_load_symfile, m_mutex, m_symfile_up, m_unwind_table, lldb_private::UnwindTable::ModuleWasUpdated(), and REPORT_INTERRUPTION.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::CalculateFrameVariableError(), CommandObjectTargetModulesDumpClangAST::DoExecute(), Dump(), DumpModuleSymbolFile(), FindFunctions(), FindGlobalVariables(), FindTypes(), GetCompileUnitAtIndex(), GetNumCompileUnits(), lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(), GetSeparateDebugInfoList(), lldb_private::UnwindTable::GetSymbolFile(), lldb_private::plugin::dwarf::DebugMapModule::GetSymbolFile(), GetSymtab(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::LinkOSOAddress(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), ParseAllDebugSymbols(), PreloadSymbols(), CommandObjectTargetModulesList::PrintModule(), lldb_private::DebuggerStats::ReportStatistics(), ResolveSymbolContextForAddress(), ResolveSymbolContextsForFileSpec(), SectionFileAddressesChanged(), and SetSymbolFileFileSpec().
|
inline |
Definition at line 482 of file Module.h.
References m_symfile_spec.
Symtab * Module::GetSymtab | ( | ) |
Definition at line 1025 of file Module.cpp.
References GetSymbolFile().
Referenced by DumpModuleSymtab(), FindFirstSymbolWithNameAndType(), FindFunctionSymbols(), FindSymbolsMatchingRegExAndType(), FindSymbolsWithNameAndType(), DynamicLoaderMacOS::GetDyldLockVariableAddressFromModule(), LookupSymbolInModule(), and lldb_private::DebuggerStats::ReportStatistics().
|
inline |
Accessor for the symbol table index time metric.
The value is returned as a reference to allow it to be updated by the ElapsedTime RAII object.
Definition at line 881 of file Module.h.
References m_symtab_index_time.
Referenced by lldb_private::DebuggerStats::ReportStatistics().
|
inline |
Accessor for the symbol table parse time metric.
The value is returned as a reference to allow it to be updated by the ElapsedTime RAII object.
Definition at line 875 of file Module.h.
References m_symtab_parse_time.
Referenced by lldb_private::DebuggerStats::ReportStatistics().
llvm::Expected< TypeSystemSP > Module::GetTypeSystemForLanguage | ( | lldb::LanguageType | language | ) |
Definition at line 372 of file Module.cpp.
References lldb_private::TypeSystemMap::GetTypeSystemForLanguage(), and m_type_system_map.
|
protected |
Definition at line 1255 of file Module.cpp.
References m_sections_up.
Referenced by GetSectionList().
UnwindTable & Module::GetUnwindTable | ( | ) |
Returns a reference to the UnwindTable for this Module.
The UnwindTable contains FuncUnwinders objects for any function in this Module. If a FuncUnwinders object hasn't been created yet (i.e. the function has yet to be unwound in a stack walk), it will be created when requested. Specifically, we do not create FuncUnwinders objects for functions until they are needed.
Definition at line 1249 of file Module.cpp.
References lldb_private::SymbolLocator::DownloadSymbolFileAsync(), GetUUID(), m_symfile_spec, and m_unwind_table.
const lldb_private::UUID & Module::GetUUID | ( | ) |
Get a reference to the UUID value contained in this object.
If the executable image file doesn't not have a UUID value built into the file format, an MD5 checksum of the entire file, or slice of the file for the current architecture should be used.
Definition at line 346 of file Module.cpp.
References GetObjectFile(), lldb_private::ObjectFile::GetUUID(), m_did_set_uuid, m_mutex, and m_uuid.
Referenced by lldb_private::CacheSignature::CacheSignature(), DumpModuleUUID(), GetUnwindTable(), lldb_private::ModuleList::LogUUIDAndPaths(), MatchesModuleSpec(), lldb_private::DebuggerStats::ReportStatistics(), DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(), and UUIDsMatch().
llvm::VersionTuple Module::GetVersion | ( | ) |
Definition at line 1602 of file Module.cpp.
References GetObjectFile().
uint32_t Module::Hash | ( | ) |
Get a unique hash for this module.
The hash should be enough to identify the file on disk and the architecture of the file. If the module represents an object inside of a file, then the hash should include the object name and object offset to ensure a unique hash. Some examples:
Definition at line 1617 of file Module.cpp.
References lldb_private::FileSpec::GetPath(), lldb_private::ArchSpec::GetTriple(), m_arch, m_file, m_object_mod_time, m_object_name, and m_object_offset.
Referenced by GetCacheKey().
bool Module::IsExecutable | ( | ) |
Tells whether this module is capable of being the main executable for a process.
Definition at line 1403 of file Module.cpp.
References GetObjectFile(), and lldb_private::ObjectFile::IsExecutable().
bool Module::IsLoadedInTarget | ( | Target * | target | ) |
Tells whether this module has been loaded in the target passed in.
This call doesn't distinguish between whether the module is loaded by the dynamic loader, or by a "target module add" type call.
[in] | target | The target to check whether this is loaded in. |
Definition at line 1410 of file Module.cpp.
References GetObjectFile(), lldb_private::SectionList::GetSectionAtIndex(), GetSectionList(), lldb_private::SectionList::GetSize(), and LLDB_INVALID_ADDRESS.
bool Module::LoadScriptingResourceInTarget | ( | Target * | target, |
Status & | error, | ||
Stream & | feedback_stream | ||
) |
Definition at line 1427 of file Module.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::FileSpec::Dump(), lldb_private::eLoadScriptFromSymFileFalse, lldb_private::eLoadScriptFromSymFileWarn, error(), lldb::eScriptLanguageNone, lldb_private::StreamString::GetData(), lldb_private::Target::GetDebugger(), GetFileSpec(), lldb_private::FileSpecList::GetFileSpecAtIndex(), lldb_private::FileSpec::GetPath(), lldb_private::Target::GetPlatform(), lldb_private::Debugger::GetScriptInterpreter(), lldb_private::Debugger::GetScriptLanguage(), lldb_private::FileSpecList::GetSize(), lldb_private::FileSystem::Instance(), lldb_private::ScriptInterpreter::LoadScriptingModule(), and lldb_private::Stream::Printf().
|
inline |
Definition at line 783 of file Module.h.
References LogMessage().
Referenced by lldb_private::plugin::dwarf::AppleDWARFIndex::GetTypes(), lldb_private::plugin::dwarf::ManualDWARFIndex::IndexUnit(), and LogMessage().
|
private |
Definition at line 1143 of file Module.cpp.
References lldb_private::Stream::AsRawOstream(), lldb::eDescriptionLevelFull, lldb_private::StreamString::GetData(), GetDescription(), lldb_private::Log::PutCString(), and lldb_private::Stream::PutCString().
|
inline |
Definition at line 788 of file Module.h.
References LogMessageVerboseBacktrace().
Referenced by LogMessageVerboseBacktrace().
|
private |
Definition at line 1151 of file Module.cpp.
References lldb_private::Stream::AsRawOstream(), lldb::eDescriptionLevelFull, lldb_private::StreamString::GetData(), GetDescription(), lldb_private::Log::GetVerbose(), lldb_private::Log::PutCString(), and lldb_private::Stream::PutCString().
bool Module::MatchesModuleSpec | ( | const ModuleSpec & | module_ref | ) |
Definition at line 1513 of file Module.cpp.
References lldb_private::ModuleSpec::GetArchitecture(), lldb_private::ModuleSpec::GetFileSpec(), lldb_private::ModuleSpec::GetObjectName(), GetObjectName(), lldb_private::ModuleSpec::GetPlatformFileSpec(), GetPlatformFileSpec(), GetUUID(), lldb_private::ModuleSpec::GetUUID(), lldb_private::ArchSpec::IsCompatibleMatch(), lldb_private::ArchSpec::IsValid(), lldb_private::UUID::IsValid(), m_arch, m_file, m_platform_file, and lldb_private::FileSpec::Match().
Referenced by FindModulesByName().
bool Module::MergeArchitecture | ( | const ArchSpec & | arch_spec | ) |
Update the ArchSpec to a more specific variant.
Definition at line 1582 of file Module.cpp.
References lldb_private::GetLog(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArchSpec::IsCompatibleMatch(), lldb_private::ArchSpec::IsValid(), LLDB_LOGF, m_arch, lldb_private::ArchSpec::MergeFrom(), lldb_private::Modules, lldb_private::Object, and SetArchitecture().
void Module::ParseAllDebugSymbols | ( | ) |
A debugging function that will cause everything in a module to be parsed.
All compile units will be parsed, along with all globals and static variables and all functions for those compile units. All types, scopes, local variables, static variables, global variables, and line tables will be parsed. This can be used prior to dumping a module to see a complete list of the resulting debug information that gets parsed, or as a debug function to ensure that the module can consume all of the debug data the symbol vendor provides.
Definition at line 381 of file Module.cpp.
References lldb_private::SymbolContext::comp_unit, lldb_private::CompileUnit::ForeachFunction(), lldb_private::SymbolContext::function, lldb_private::SymbolFile::GetCompileUnitAtIndex(), GetNumCompileUnits(), GetSymbolFile(), m_mutex, lldb_private::SymbolContext::module_sp, lldb_private::SymbolFile::ParseBlocksRecursive(), lldb_private::SymbolFile::ParseFunctions(), lldb_private::SymbolFile::ParseTypes(), and lldb_private::SymbolFile::ParseVariablesForContext().
void Module::PreloadSymbols | ( | ) |
Definition at line 1326 of file Module.cpp.
References GetSymbolFile(), lldb_private::SymbolFile::GetSymtab(), m_mutex, and lldb_private::SymbolFile::PreloadSymbols().
void Module::RegisterXcodeSDK | ( | llvm::StringRef | sdk, |
llvm::StringRef | sysroot | ||
) |
This callback will be called by SymbolFile implementations when parsing a compile unit that contains SDK information.
sysroot | will be added to the path remapping dictionary. |
Definition at line 1561 of file Module.cpp.
References lldb_private::PathMappingList::Append(), m_source_mappings, lldb_private::PathMappingList::Replace(), lldb_private::Debugger::ReportError(), and lldb_private::toString().
|
delete |
std::optional< std::string > Module::RemapSourceFile | ( | llvm::StringRef | path | ) | const |
Remaps a source file given path into new_path.
Remaps path if any source remappings match. This function does NOT stat the file system so it can be used in tight loops where debug info is being parsed.
[in] | path | The original source file path to try and remap. |
Definition at line 1554 of file Module.cpp.
References m_mutex, m_source_mappings, and lldb_private::PathMappingList::RemapPath().
|
inline |
Definition at line 800 of file Module.h.
References ReportError().
Referenced by GetObjectFile(), and ReportError().
|
private |
|
inline |
Definition at line 807 of file Module.h.
References ReportErrorIfModifyDetected().
Referenced by lldb_private::plugin::dwarf::DebugNamesDWARFIndex::GetDIE(), ReportErrorIfModifyDetected(), and lldb_private::plugin::dwarf::DWARFIndex::ReportInvalidDIERef().
|
private |
Definition at line 1110 of file Module.cpp.
References lldb_private::Stream::AsRawOstream(), lldb::eDescriptionLevelFull, FileHasChanged(), GetDescription(), lldb_private::StreamString::GetString(), m_first_file_changed_log, lldb_private::Stream::PutCString(), and lldb_private::Debugger::ReportError().
|
inline |
|
private |
void Module::ReportWarningOptimization | ( | std::optional< lldb::user_id_t > | debugger_id | ) |
Definition at line 1085 of file Module.cpp.
References lldb_private::FileSpec::GetFilename(), GetFileSpec(), lldb_private::StreamString::GetString(), lldb_private::ConstString::IsEmpty(), m_optimization_warning, and lldb_private::Debugger::ReportWarning().
void Module::ReportWarningUnsupportedLanguage | ( | lldb::LanguageType | language, |
std::optional< lldb::user_id_t > | debugger_id | ||
) |
Definition at line 1099 of file Module.cpp.
References lldb_private::Language::GetNameForLanguageType(), lldb_private::StreamString::GetString(), m_language_warning, and lldb_private::Debugger::ReportWarning().
bool Module::ResolveFileAddress | ( | lldb::addr_t | vm_addr, |
Address & | so_addr | ||
) |
Definition at line 443 of file Module.cpp.
References GetSectionList(), m_mutex, and lldb_private::Address::ResolveAddressUsingFileSections().
Referenced by lldb_private::Value::ConvertToLoadAddress(), lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::LinkOSOAddress(), and LookupAddressInModule().
uint32_t Module::ResolveSymbolContextForAddress | ( | const Address & | so_addr, |
lldb::SymbolContextItem | resolve_scope, | ||
SymbolContext & | sc, | ||
bool | resolve_tail_call_address = false |
||
) |
Resolve the symbol context for the given address.
Tries to resolve the matching symbol context based on a lookup from the current symbol vendor. If the lazy lookup fails, an attempt is made to parse the eh_frame section to handle stripped symbols. If this fails, an attempt is made to resolve the symbol to the previous address to handle the case of a function with a tail call.
Use properties of the modified SymbolContext to inspect any resolved target, module, compilation unit, symbol, function, function block or line entry. Use the return value to determine which of these properties have been modified.
[in] | so_addr | A load address to resolve. |
[in] | resolve_scope | The scope that should be resolved (see SymbolContext::Scope). A combination of flags from the enumeration SymbolContextItem requesting a resolution depth. Note that the flags that are actually resolved may be a superset of the requested flags. For instance, eSymbolContextSymbol requires resolution of eSymbolContextModule, and eSymbolContextFunction requires eSymbolContextSymbol. |
[out] | sc | The SymbolContext that is modified based on symbol resolution. |
[in] | resolve_tail_call_address | Determines if so_addr should resolve to a symbol in the case of a function whose last instruction is a call. In this case, the PC can be one past the address range of the function. |
Definition at line 451 of file Module.cpp.
References lldb_private::SymbolContext::Clear(), lldb_private::Symtab::FindSymbolContainingFileAddress(), lldb_private::Symtab::ForEachSymbolContainingFileAddress(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), lldb_private::Address::GetFileAddress(), lldb_private::Symtab::GetObjectFile(), lldb_private::SymbolFile::GetObjectFile(), lldb_private::Address::GetOffset(), lldb_private::Address::GetSection(), GetSymbolFile(), lldb_private::ObjectFile::GetSymtab(), lldb_private::SymbolFile::GetSymtab(), lldb_private::Address::IsSectionOffset(), lldb_private::ObjectFile::IsStripped(), lldb_private::Symbol::IsSynthetic(), m_mutex, lldb_private::SymbolContext::module_sp, lldb_private::SymbolFile::ResolveSymbolContext(), ResolveSymbolContextForAddress(), lldb_private::SymbolFile::SetLoadDebugInfoEnabled(), lldb_private::Address::Slide(), and lldb_private::SymbolContext::symbol.
Referenced by ResolveSymbolContextForAddress().
uint32_t Module::ResolveSymbolContextForFilePath | ( | const char * | file_path, |
uint32_t | line, | ||
bool | check_inlines, | ||
lldb::SymbolContextItem | resolve_scope, | ||
SymbolContextList & | sc_list | ||
) |
Resolve items in the symbol context for a given file and line.
Tries to resolve file_path and line to a list of matching symbol contexts.
The line table entries contains addresses that can be used to further resolve the values in each match: the function, block, symbol. Care should be taken to minimize the amount of information that is requested to only what is needed – typically the module, compile unit, line table and line table entry are sufficient.
[in] | file_path | A path to a source file to match. If file_path does not specify a directory, then this query will match all files whose base filename matches. If file_path does specify a directory, the fullpath to the file must match. |
[in] | line | The source line to match, or zero if just the compile unit should be resolved. |
[in] | check_inlines | Check for inline file and line number matches. This option should be used sparingly as it will cause all line tables for every compile unit to be parsed and searched for matching inline file entries. |
[in] | resolve_scope | The scope that should be resolved (see SymbolContext::Scope). |
[out] | sc_list | A symbol context list that gets matching symbols contexts appended to. |
Definition at line 582 of file Module.cpp.
References ResolveSymbolContextsForFileSpec().
uint32_t Module::ResolveSymbolContextsForFileSpec | ( | const FileSpec & | file_spec, |
uint32_t | line, | ||
bool | check_inlines, | ||
lldb::SymbolContextItem | resolve_scope, | ||
SymbolContextList & | sc_list | ||
) |
Resolve items in the symbol context for a given file and line.
Tries to resolve file_spec and line to a list of matching symbol contexts.
The line table entries contains addresses that can be used to further resolve the values in each match: the function, block, symbol. Care should be taken to minimize the amount of information that is requested to only what is needed – typically the module, compile unit, line table and line table entry are sufficient.
[in] | file_spec | A file spec to a source file to match. If file_path does not specify a directory, then this query will match all files whose base filename matches. If file_path does specify a directory, the fullpath to the file must match. |
[in] | line | The source line to match, or zero if just the compile unit should be resolved. |
[in] | check_inlines | Check for inline file and line number matches. This option should be used sparingly as it will cause all line tables for every compile unit to be parsed and searched for matching inline file entries. |
[in] | resolve_scope | The scope that should be resolved (see SymbolContext::Scope). |
[out] | sc_list | A symbol context list that gets filled in with all of the matches. |
Definition at line 590 of file Module.cpp.
References lldb_private::FileSpec::GetPath(), lldb_private::SymbolContextList::GetSize(), GetSymbolFile(), LLDB_SCOPED_TIMERF, and m_mutex.
Referenced by DumpCompileUnitLineTable(), LookupFileAndLineInModule(), and ResolveSymbolContextForFilePath().
|
virtual |
Notify the module that the file addresses for the Sections have been updated.
If the Section file addresses for a module are updated, this method should be called. Any parts of the module, object file, or symbol file that has cached those file addresses must invalidate or update its cache.
Definition at line 1241 of file Module.cpp.
References GetObjectFile(), GetSymbolFile(), and lldb_private::ObjectFile::SectionFileAddressesChanged().
|
protected |
Definition at line 1493 of file Module.cpp.
References lldb_private::ArchSpec::IsCompatibleMatch(), lldb_private::ArchSpec::IsValid(), and m_arch.
Referenced by MergeArchitecture().
void Module::SetFileSpecAndObjectName | ( | const FileSpec & | file, |
ConstString | object_name | ||
) |
Definition at line 1031 of file Module.cpp.
References lldb_private::FileSystem::GetModificationTime(), lldb_private::FileSystem::Instance(), m_file, m_mod_time, and m_object_name.
bool Module::SetLoadAddress | ( | Target & | target, |
lldb::addr_t | value, | ||
bool | value_is_offset, | ||
bool & | changed | ||
) |
Set the load address for all sections in a module to be the file address plus slide.
Many times a module will be loaded in a target with a constant offset applied to all top level sections. This function can set the load address for all top level sections to be the section file address + offset.
[in] | target | The target in which to apply the section load addresses. |
[in] | value | if value_is_offset is true, then value is the offset to apply to all file addresses for all top level sections in the object file as each section load address is being set. If value_is_offset is false, then "value" is the new absolute base address for the image. |
[in] | value_is_offset | If true, then value is an offset to apply to each file address of each top level section. If false, then value is the image base address that will be used to rigidly slide all loadable sections. |
[out] | changed | If any section load addresses were changed in target, then changed will be set to true. Else changed will be set to false. This allows this function to be called multiple times on the same module for the same target. If the module hasn't moved, then changed will be false and no module updated notification will need to be sent out. |
Definition at line 1501 of file Module.cpp.
References GetObjectFile(), and lldb_private::ObjectFile::SetLoadAddress().
Referenced by CommandObjectTargetModulesLoad::DoExecute().
|
inline |
Definition at line 472 of file Module.h.
References m_platform_file.
|
inline |
Definition at line 478 of file Module.h.
References m_remote_install_file.
void Module::SetSymbolFileFileSpec | ( | const FileSpec & | file | ) |
Definition at line 1342 of file Module.cpp.
References lldb_private::ObjectFile::ClearSymtab(), lldb_private::SectionList::DeleteSection(), lldb_private::ObjectFile::GetFileSpec(), lldb_private::SectionList::GetNumSections(), lldb_private::SymbolFile::GetObjectFile(), lldb_private::FileSpec::GetPath(), lldb_private::SectionList::GetSectionAtIndex(), GetSectionList(), GetSymbolFile(), lldb_private::FileSystem::Instance(), m_did_load_symfile, m_objfile_sp, m_old_symfiles, m_symfile_spec, and m_symfile_up.
|
protected |
Definition at line 361 of file Module.cpp.
References lldbassert, m_did_set_uuid, m_mutex, and m_uuid.
|
protected |
Definition at line 1271 of file Module.cpp.
References lldb_private::SymbolContextList::Append(), CalculateSymbolContext(), lldb_private::SymbolContext::symbol, and lldb_private::Symtab::SymbolAtIndex().
Referenced by FindSymbolsMatchingRegExAndType(), and FindSymbolsWithNameAndType().
|
friend |
|
friend |
|
friend |
|
protected |
The architecture for this module.
Definition at line 997 of file Module.h.
Referenced by GetArchitecture(), GetCacheKey(), GetDescription(), GetMemoryObjectFile(), GetObjectFile(), Hash(), MatchesModuleSpec(), MergeArchitecture(), Module(), SetArchitecture(), and ~Module().
|
protected |
DataBuffer containing the module image, if it was provided at construction time.
Otherwise the data will be retrieved by mapping one of the FileSpec members above.
Definition at line 1019 of file Module.h.
Referenced by FileHasChanged(), GetObjectFile(), and Module().
|
protected |
Definition at line 1045 of file Module.h.
Referenced by GetMemoryObjectFile(), and GetObjectFile().
|
protected |
Definition at line 1046 of file Module.h.
Referenced by GetSymbolFile(), and SetSymbolFileFileSpec().
|
protected |
|
protected |
The file representation on disk for this module (if there is one).
Definition at line 1000 of file Module.h.
Referenced by Dump(), FileHasChanged(), FindAddressesForLine(), GetCacheKey(), GetDescription(), GetFileSpec(), GetObjectFile(), GetPlatformFileSpec(), Hash(), MatchesModuleSpec(), Module(), SetFileSpecAndObjectName(), and ~Module().
|
mutableprotected |
Definition at line 1048 of file Module.h.
Referenced by FileHasChanged().
|
protected |
Definition at line 1049 of file Module.h.
Referenced by ReportErrorIfModifyDetected().
|
protected |
Definition at line 1061 of file Module.h.
Referenced by ReportWarningUnsupportedLanguage().
|
protected |
The modification time for this module when it was created.
Definition at line 995 of file Module.h.
Referenced by FileHasChanged(), GetModificationTime(), Module(), and SetFileSpecAndObjectName().
|
mutableprotected |
A mutex to keep this object happy in multi-threaded environments.
Definition at line 991 of file Module.h.
Referenced by Dump(), FindSourceFile(), GetCompileUnitAtIndex(), GetMemoryObjectFile(), GetMutex(), GetNumCompileUnits(), GetObjectFile(), GetSymbolFile(), GetUUID(), ParseAllDebugSymbols(), PreloadSymbols(), RemapSourceFile(), ResolveFileAddress(), ResolveSymbolContextForAddress(), ResolveSymbolContextsForFileSpec(), SetUUID(), and ~Module().
|
protected |
Definition at line 1014 of file Module.h.
Referenced by GetObjectModificationTime(), Hash(), and Module().
|
protected |
The name an object within this module that is selected, or empty of the module is represented by m_file.
Definition at line 1010 of file Module.h.
Referenced by Dump(), GetCacheKey(), GetDescription(), GetMemoryObjectFile(), GetObjectName(), GetSpecificationDescription(), Hash(), Module(), SetFileSpecAndObjectName(), and ~Module().
|
protected |
Definition at line 1013 of file Module.h.
Referenced by GetObjectFile(), GetObjectOffset(), Hash(), and Module().
|
protected |
A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile.
Definition at line 1021 of file Module.h.
Referenced by GetMemoryObjectFile(), GetObjectFile(), SetSymbolFileFileSpec(), and ~Module().
|
protected |
If anyone calls Module::SetSymbolFileFileSpec() and changes the symbol file,.
we need to keep all old symbol files around in case anyone has type references to them
Definition at line 1030 of file Module.h.
Referenced by SetSymbolFileFileSpec().
|
protected |
Definition at line 1060 of file Module.h.
Referenced by ReportWarningOptimization().
|
protected |
The path to the module on the platform on which it is being debugged.
Definition at line 1002 of file Module.h.
Referenced by GetPlatformFileSpec(), MatchesModuleSpec(), Module(), and SetPlatformFileSpec().
|
protected |
If set when debugging on remote platforms, this module will be installed at this location.
Definition at line 1004 of file Module.h.
Referenced by GetRemoteInstallFileSpec(), and SetRemoteInstallFileSpec().
|
protected |
Unified section list for module that is used by the ObjectFile and ObjectFile instances for the debug info.
Definition at line 1041 of file Module.h.
Referenced by GetSectionList(), GetUnifiedSectionList(), and ~Module().
|
protected |
Module specific source remappings for when you have debug info for a module that doesn't match where the sources currently are.
Definition at line 1038 of file Module.h.
Referenced by FindSourceFile(), GetSourceMappingList(), RegisterXcodeSDK(), and RemapSourceFile().
|
protected |
If this path is valid, then this is the file that will be used as the symbol file for this module.
Definition at line 1007 of file Module.h.
Referenced by GetSymbolFileFileSpec(), GetUnwindTable(), Module(), and SetSymbolFileFileSpec().
|
protected |
A pointer to the symbol vendor for this module.
Definition at line 1028 of file Module.h.
Referenced by GetSymbolFile(), SetSymbolFileFileSpec(), and ~Module().
|
protected |
We store a symbol named index time duration here because we might have an object file and a symbol file which both have symbol tables.
The parse time for the symbol tables can be aggregated here.
Definition at line 1058 of file Module.h.
Referenced by GetSymtabIndexTime().
|
protected |
See if the module was modified after it was initially opened.
We store a symbol table parse time duration here because we might have an object file and a symbol file which both have symbol tables. The parse time for the symbol tables can be aggregated here.
Definition at line 1054 of file Module.h.
Referenced by GetSymtabParseTime().
|
protected |
A map of any type systems associated with this module.
Definition at line 1034 of file Module.h.
Referenced by ForEachTypeSystem(), and GetTypeSystemForLanguage().
|
protected |
Table of FuncUnwinders objects created for this Module's functions.
Definition at line 1024 of file Module.h.
Referenced by GetMemoryObjectFile(), GetObjectFile(), GetSymbolFile(), and GetUnwindTable().
|
protected |