Go to the documentation of this file.
9 #ifndef LLDB_CORE_MODULELIST_H
10 #define LLDB_CORE_MODULELIST_H
22 #include "llvm/ADT/DenseSet.h"
23 #include "llvm/Support/RWMutex.h"
42 class SymbolContextList;
48 struct ModuleFunctionSearchOptions;
89 const lldb::ModuleSP &module_sp) = 0;
91 const lldb::ModuleSP &module_sp) = 0;
93 const lldb::ModuleSP &old_module_sp,
94 const lldb::ModuleSP &new_module_sp) = 0;
143 void Append(
const lldb::ModuleSP &module_sp,
bool notify =
true);
158 const lldb::ModuleSP &module_sp,
172 bool AppendIfNeeded(
const lldb::ModuleSP &new_module,
bool notify =
true);
179 const lldb::ModuleSP &new_module_sp);
271 lldb::FunctionNameType name_type_mask,
360 bool name_is_fully_qualified,
size_t max_matches,
361 llvm::DenseSet<SymbolFile *> &searched_symbol_files,
390 std::vector<Address> &output_local,
391 std::vector<Address> &output_extern);
407 bool Remove(
const lldb::ModuleSP &module_sp,
bool notify =
true);
420 lldb::SymbolContextItem resolve_scope,
426 const char *file_path,
uint32_t line,
bool check_inlines,
443 Stream *feedback_stream =
nullptr,
444 bool continue_on_error =
true);
452 const FileSpecList *module_search_paths_ptr,
454 bool *did_create_ptr,
bool always_create =
false);
473 void ForEach(std::function<
bool(
const lldb::ModuleSP &module_sp)>
const
485 typedef std::vector<lldb::ModuleSP>
488 void AppendImpl(
const lldb::ModuleSP &module_sp,
bool use_notifier =
true);
490 bool RemoveImpl(
const lldb::ModuleSP &module_sp,
bool use_notifier =
true);
492 collection::iterator
RemoveImpl(collection::iterator pos,
493 bool use_notifier =
true);
495 void ClearImpl(
bool use_notifier =
true);
505 std::recursive_mutex>
520 #endif // LLDB_CORE_MODULELIST_H
virtual ~Notifier()=default
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, Stream *feedback_stream=nullptr, bool continue_on_error=true)
static ModuleListProperties & GetGlobalModuleListProperties()
size_t RemoveOrphans(bool mandatory)
ModuleIterable Modules() const
PathMappingList GetSymlinkMappings() const
static lldb::ModuleSP FindSharedModule(const UUID &uuid)
size_t GetIndexForModule(const Module *module) const
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
bool SetLLDBIndexCachePath(const FileSpec &path)
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
std::recursive_mutex & GetMutex() const
E vector_adapter(I &iter)
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
bool GetEnableLLDBIndexCache() const
uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const
Resolve items in the symbol context for a given file and line. (const FileSpec
void Clear()
Clear the object's state.
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr)
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
bool SetEnableLLDBIndexCache(bool new_value)
bool SetEnableExternalLookup(bool new_value)
void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
size_t GetSize() const
Gets the size of the module list.
bool AnyOf(std::function< bool(lldb_private::Module &module)> const &callback) const
Returns true if 'callback' returns true for one of the modules in this ModuleList.
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
const ModuleList & operator=(const ModuleList &rhs)
Assignment operator.
ModuleIterableNoLocking ModulesNoLocking() const
uint32_t ResolveSymbolContextForFilePath(const char *file_path, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const
Resolve items in the symbol context for a given file and line. (const char
static bool ModuleIsInCache(const Module *module_ptr)
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
static size_t RemoveOrphanSharedModules(bool mandatory)
uint64_t GetLLDBIndexCacheMaxPercent()
bool ReplaceModule(const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)
void ForEach(std::function< bool(const lldb::ModuleSP &module_sp)> const &callback) const
Applies 'callback' to each module in this ModuleList.
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const
bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address
bool RemoveIfOrphaned(const Module *module_ptr)
Options used by Module::FindFunctions.
std::recursive_mutex m_modules_mutex
ModuleList()
Default constructor.
static bool RemoveSharedModule(lldb::ModuleSP &module_sp)
lldb::ModuleSP FindModule(const Module *module_ptr) const
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
virtual void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
collection m_modules
The collection of modules.
void UpdateSymlinkMappings()
std::vector< lldb::ModuleSP > collection
The module collection type.
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
PathMappingList m_symlink_paths
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 AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
LockingAdaptedIterable< collection, lldb::ModuleSP, vector_adapter, std::recursive_mutex > ModuleIterable
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
llvm::sys::RWMutex m_symlink_paths_mutex
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
FileSpec GetLLDBIndexCachePath() const
A class that represents a running process on the host machine.
uint64_t GetLLDBIndexCacheMaxByteSize()
void Destroy()
Clear the object's state.
virtual void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
bool GetEnableBackgroundLookup() const
void Dump(Stream *s) const
Dump the description of each module contained in this list.
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds the first module whose file specification matches file_spec.
void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list)
bool GetEnableExternalLookup() const
void FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet< SymbolFile * > &searched_symbol_files, TypeList &types) const
Find types by name.
virtual void NotifyWillClearList(const ModuleList &module_list)=0
uint64_t GetLLDBIndexCacheExpirationDays()
void ReplaceEquivalent(const lldb::ModuleSP &module_sp, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules=nullptr)
Append a module to the module list and remove any equivalent modules.
virtual void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)=0
void ClearImpl(bool use_notifier=true)
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool always_create=false)
bool GetLoadSymbolOnDemand()
AdaptedIterable< collection, lldb::ModuleSP, vector_adapter > ModuleIterableNoLocking
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
bool SetClangModulesCachePath(const FileSpec &path)
virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list)=0
bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const
FileSpec GetClangModulesCachePath() const