9#ifndef LLDB_CORE_MODULELIST_H
10#define LLDB_CORE_MODULELIST_H
22#include "llvm/ADT/DenseSet.h"
23#include "llvm/Support/RWMutex.h"
42class SymbolContextList;
48struct ModuleFunctionSearchOptions;
54 "Disable automatically downloading symbols.",
59 "Download symbols in the background for images as they appear in the "
65 "Download symbols in the foreground for images as they appear in the "
292 lldb::FunctionNameType name_type_mask,
405 const FileSpec &file, uint32_t line,
407 std::vector<Address> &output_local,
408 std::vector<Address> &output_extern);
437 lldb::SymbolContextItem resolve_scope,
443 const char *file_path, uint32_t line,
bool check_inlines,
449 const FileSpec &file_spec, uint32_t line,
bool check_inlines,
461 bool continue_on_error =
true);
471 bool *did_create_ptr,
bool always_create =
false);
505 typedef std::vector<lldb::ModuleSP>
513 bool use_notifier =
true);
515 void ClearImpl(
bool use_notifier =
true);
525 std::recursive_mutex>
A section + offset based address class.
A uniqued constant string class.
A class that describes a function.
bool SetClangModulesCachePath(const FileSpec &path)
lldb::SymbolDownload GetSymbolAutoDownload() const
bool GetEnableExternalLookup() const
bool SetLLDBIndexCachePath(const FileSpec &path)
bool GetEnableLLDBIndexCache() const
bool SetEnableExternalLookup(bool new_value)
FileSpec GetLLDBIndexCachePath() const
PathMappingList GetSymlinkMappings() const
uint64_t GetLLDBIndexCacheMaxByteSize()
PathMappingList m_symlink_paths
bool GetLoadSymbolOnDemand()
FileSpec GetClangModulesCachePath() const
llvm::sys::RWMutex m_symlink_paths_mutex
uint64_t GetLLDBIndexCacheMaxPercent()
void UpdateSymlinkMappings()
bool SetEnableLLDBIndexCache(bool new_value)
uint64_t GetLLDBIndexCacheExpirationDays()
virtual void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
virtual ~Notifier()=default
virtual void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)=0
virtual void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
virtual void NotifyWillClearList(const ModuleList &module_list)=0
virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list)=0
A collection class for Module objects.
bool ReplaceModule(const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)
std::vector< lldb::ModuleSP > collection
The module collection type.
collection m_modules
The collection of modules.
void ClearImpl(bool use_notifier=true)
LockingAdaptedIterable< collection, lldb::ModuleSP, vector_adapter, std::recursive_mutex > ModuleIterable
void ForEach(std::function< bool(const lldb::ModuleSP &module_sp)> const &callback) const
Applies 'callback' to each module in this ModuleList.
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&,...
static bool RemoveSharedModule(lldb::ModuleSP &module_sp)
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const
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.
ModuleIterableNoLocking ModulesNoLocking() const
static bool ModuleIsInCache(const Module *module_ptr)
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
void Swap(ModuleList &other)
Atomically swaps the contents of this module list with other.
size_t GetIndexForModule(const Module *module) const
std::recursive_mutex & GetMutex() const
bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
void Clear()
Clear the object's state.
ModuleList()
Default constructor.
void Dump(Stream *s) const
Dump the description of each module contained in this list.
collection::iterator RemoveImpl(collection::iterator pos, bool use_notifier=true)
void FindTypes(Module *search_first, const TypeQuery &query, lldb_private::TypeResults &results) const
Find types using a type-matching object that contains all search parameters.
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*,uint32_t,...
static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr)
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
const ModuleList & operator=(const ModuleList &rhs)
Assignment operator.
std::recursive_mutex m_modules_mutex
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
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)
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
AdaptedIterable< collection, lldb::ModuleSP, vector_adapter > ModuleIterableNoLocking
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
static lldb::ModuleSP FindSharedModule(const UUID &uuid)
lldb::ModuleSP FindModule(const Module *module_ptr) const
static ModuleListProperties & GetGlobalModuleListProperties()
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds the first module whose file specification matches file_spec.
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.
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address&,uint32_t,SymbolContext&)
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
size_t RemoveOrphans(bool mandatory)
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
static size_t RemoveOrphanSharedModules(bool mandatory)
void Destroy()
Clear the object's state.
bool RemoveIfOrphaned(const Module *module_ptr)
void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, Stream &feedback_stream, bool continue_on_error=true)
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.
void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list)
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
ModuleIterable Modules() const
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const
size_t GetSize() const
Gets the size of the module list.
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
A class that describes an executable image and its associated object and symbol files.
A stream class that can stream formatted output to a file.
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
A class that represents a running process on the host machine.
E vector_adapter(I &iter)
static constexpr OptionEnumValueElement g_auto_download_enum_values[]
std::shared_ptr< lldb_private::Target > TargetSP
@ eSymbolDownloadBackground
@ eSymbolDownloadForeground
std::shared_ptr< lldb_private::Module > ModuleSP
Options used by Module::FindFunctions.