9#ifndef LLDB_CORE_MODULELIST_H
10#define LLDB_CORE_MODULELIST_H
23#include "llvm/ADT/DenseSet.h"
24#include "llvm/Support/RWMutex.h"
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 "
74 "Get binaries from the host lldb in-memory shared cache.",
79 "Get binaries from the host shared cache.",
83 "host-and-inferior-shared-cache",
84 "Get binaries from the host and inferior's shared caches.",
88 "inferior-shared-cache-only",
89 "Get binaries from inferior's shared cache only.",
323 lldb::FunctionNameType name_type_mask,
329 lldb::FunctionNameType name_type_mask,
451 const FileSpec &file, uint32_t line,
453 std::vector<Address> &output_local,
454 std::vector<Address> &output_extern);
483 lldb::SymbolContextItem resolve_scope,
489 const char *file_path, uint32_t line,
bool check_inlines,
495 const FileSpec &file_spec, uint32_t line,
bool check_inlines,
506 bool continue_on_error =
true);
515 bool *did_create_ptr,
bool invoke_locate_callback =
true,
516 bool invoke_symbol_locators =
true);
557 typedef std::vector<lldb::ModuleSP>
565 bool use_notifier =
true);
567 void ClearImpl(
bool use_notifier =
true);
590 typedef llvm::iterator_range<collection::const_iterator>
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
A class that describes a function.
bool GetLoadSymbolOnDemand() const
bool GetEnableTypeSystemClike() const
bool GetLLDBIndexCacheForceDisable() const
bool SetClangModulesCachePath(const FileSpec &path)
lldb::SymbolDownload GetSymbolAutoDownload() const
bool GetEnableExternalLookup() const
bool GetLLDBIndexCacheTypeMemoryModuleHeaderBytes() const
bool SetEnableExternalLookup(bool new_value)
FileSpec GetLLDBIndexCachePath() const
PathMappingList GetSymlinkMappings() const
uint64_t GetDemangledNameInfoCacheSize() const
lldb::SymbolSharedCacheUse GetSharedCacheBinaryLoading() const
uint64_t GetLLDBIndexCacheMaxByteSize()
PathMappingList m_symlink_paths
lldb::OptionValuePropertiesSP m_experimental_properties_sp
void ForwardDeprecatedIndexCacheSettings()
Make the deprecated "symbols.*lldb-index-cache*" settings set their replacements in "symbols....
FileSpec GetClangModulesCachePath() const
bool GetLLDBIndexCacheTypeSymtab() const
llvm::sys::RWMutex m_symlink_paths_mutex
lldb::OptionValuePropertiesSP m_index_cache_type_sp
The "symbols.lldb-index-cache.type" settings.
bool GetLLDBIndexCacheTypeDwarfIndex() const
uint64_t GetLLDBIndexCacheMaxPercent()
void UpdateSymlinkMappings()
bool SetEnableTypeSystemClike(bool new_value)
uint64_t GetLLDBIndexCacheExpirationDays()
bool GetLLDBIndexCacheTypeMemoryModuleSymtab() const
lldb::OptionValuePropertiesSP m_index_cache_sp
The "symbols.lldb-index-cache" settings.
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.
llvm::iterator_range< collection::const_iterator > ModuleIterableNoLocking
void ClearImpl(bool use_notifier=true)
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)
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool invoke_locate_callback=true, bool invoke_symbol_locators=true)
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.
void FindGlobalVariables(llvm::StringRef name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
ModuleIterableNoLocking ModulesNoLocking() const
static constexpr long kUseCountModuleListOrphaned
An orphaned module that lives only in the ModuleList has a count of 1.
static bool ModuleIsInCache(const Module *module_ptr)
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
Finds the first module whose file specification matches module_spec.
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 LoadScriptingResourceInTargetForModule(Module &module, Target &target, Status &error)
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
static bool RemoveSharedModuleIfOrphaned(const lldb::ModuleWP module_ptr)
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
void PreloadSymbols(bool parallelize) const
For each module in this ModuleList, preload its symbols.
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.
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
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 modules whose file specification matches module_spec.
void FindFunctionSymbols(llvm::StringRef name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list)
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.
LockingAdaptedIterable< std::recursive_mutex, collection > ModuleIterable
void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
void FindSymbolsWithNameAndType(llvm::StringRef name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
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.
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, bool continue_on_error=true)
void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
void FindFunctions(llvm::StringRef name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, 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.
bool RemoveIfOrphaned(const lldb::ModuleWP module_ptr)
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
void ForEach(std::function< IterationAction(const lldb::ModuleSP &module_sp)> const &callback) const
Applies 'callback' to each module in this ModuleList.
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.
Provides public interface for all SymbolFiles.
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
Represents UUID's of various sizes.
A class that represents a running process on the host machine.
static constexpr OptionEnumValueElement g_shared_cache_use_enum_values[]
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
static constexpr OptionEnumValueElement g_auto_download_enum_values[]
std::shared_ptr< lldb_private::OptionValueProperties > OptionValuePropertiesSP
std::weak_ptr< lldb_private::Module > ModuleWP
@ eSymbolSharedCacheUseHostSharedCache
@ eSymbolSharedCacheUseInferiorSharedCacheOnly
@ eSymbolSharedCacheUseHostLLDBMemory
@ eSymbolSharedCacheUseHostAndInferiorSharedCache
std::shared_ptr< lldb_private::Target > TargetSP
@ eSymbolDownloadBackground
@ eSymbolDownloadForeground
std::shared_ptr< lldb_private::Module > ModuleSP
Options used by Module::FindFunctions.