#include "lldb/Core/ModuleList.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Interpreter/OptionValueFileSpec.h"
#include "lldb/Interpreter/OptionValueFileSpecList.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Interpreter/Property.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/TypeList.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpecList.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/UUID.h"
#include "lldb/lldb-defines.h"
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h"
#endif
#include "clang/Driver/Driver.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h"
#include <chrono>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
namespace lldb_private {
class Function;
}
namespace lldb_private {
class RegularExpression;
}
namespace lldb_private {
class Stream;
}
namespace lldb_private {
class SymbolFile;
}
namespace lldb_private {
class Target;
}
usingnamespacelldb;
usingnamespacelldb_private;
namespace {
#define LLDB_PROPERTIES_modulelist
#include "CoreProperties.inc"
enum { … };
}
ModuleListProperties::ModuleListProperties() { … }
bool ModuleListProperties::GetEnableExternalLookup() const { … }
bool ModuleListProperties::SetEnableExternalLookup(bool new_value) { … }
SymbolDownload ModuleListProperties::GetSymbolAutoDownload() const { … }
FileSpec ModuleListProperties::GetClangModulesCachePath() const { … }
bool ModuleListProperties::SetClangModulesCachePath(const FileSpec &path) { … }
FileSpec ModuleListProperties::GetLLDBIndexCachePath() const { … }
bool ModuleListProperties::SetLLDBIndexCachePath(const FileSpec &path) { … }
bool ModuleListProperties::GetEnableLLDBIndexCache() const { … }
bool ModuleListProperties::SetEnableLLDBIndexCache(bool new_value) { … }
uint64_t ModuleListProperties::GetLLDBIndexCacheMaxByteSize() { … }
uint64_t ModuleListProperties::GetLLDBIndexCacheMaxPercent() { … }
uint64_t ModuleListProperties::GetLLDBIndexCacheExpirationDays() { … }
void ModuleListProperties::UpdateSymlinkMappings() { … }
PathMappingList ModuleListProperties::GetSymlinkMappings() const { … }
bool ModuleListProperties::GetLoadSymbolOnDemand() { … }
ModuleList::ModuleList() : … { … }
ModuleList::ModuleList(const ModuleList &rhs) : … { … }
ModuleList::ModuleList(ModuleList::Notifier *notifier)
: … { … }
const ModuleList &ModuleList::operator=(const ModuleList &rhs) { … }
ModuleList::~ModuleList() = default;
void ModuleList::AppendImpl(const ModuleSP &module_sp, bool use_notifier) { … }
void ModuleList::Append(const ModuleSP &module_sp, bool notify) { … }
void ModuleList::ReplaceEquivalent(
const ModuleSP &module_sp,
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules) { … }
bool ModuleList::AppendIfNeeded(const ModuleSP &new_module, bool notify) { … }
void ModuleList::Append(const ModuleList &module_list) { … }
bool ModuleList::AppendIfNeeded(const ModuleList &module_list) { … }
bool ModuleList::RemoveImpl(const ModuleSP &module_sp, bool use_notifier) { … }
ModuleList::collection::iterator
ModuleList::RemoveImpl(ModuleList::collection::iterator pos,
bool use_notifier) { … }
bool ModuleList::Remove(const ModuleSP &module_sp, bool notify) { … }
bool ModuleList::ReplaceModule(const lldb::ModuleSP &old_module_sp,
const lldb::ModuleSP &new_module_sp) { … }
bool ModuleList::RemoveIfOrphaned(const Module *module_ptr) { … }
size_t ModuleList::RemoveOrphans(bool mandatory) { … }
size_t ModuleList::Remove(ModuleList &module_list) { … }
void ModuleList::Clear() { … }
void ModuleList::Destroy() { … }
void ModuleList::ClearImpl(bool use_notifier) { … }
Module *ModuleList::GetModulePointerAtIndex(size_t idx) const { … }
ModuleSP ModuleList::GetModuleAtIndex(size_t idx) const { … }
ModuleSP ModuleList::GetModuleAtIndexUnlocked(size_t idx) const { … }
void ModuleList::FindFunctions(ConstString name,
FunctionNameType name_type_mask,
const ModuleFunctionSearchOptions &options,
SymbolContextList &sc_list) const { … }
void ModuleList::FindFunctionSymbols(ConstString name,
lldb::FunctionNameType name_type_mask,
SymbolContextList &sc_list) { … }
void ModuleList::FindFunctions(const RegularExpression &name,
const ModuleFunctionSearchOptions &options,
SymbolContextList &sc_list) { … }
void ModuleList::FindCompileUnits(const FileSpec &path,
SymbolContextList &sc_list) const { … }
void ModuleList::FindGlobalVariables(ConstString name, size_t max_matches,
VariableList &variable_list) const { … }
void ModuleList::FindGlobalVariables(const RegularExpression ®ex,
size_t max_matches,
VariableList &variable_list) const { … }
void ModuleList::FindSymbolsWithNameAndType(ConstString name,
SymbolType symbol_type,
SymbolContextList &sc_list) const { … }
void ModuleList::FindSymbolsMatchingRegExAndType(
const RegularExpression ®ex, lldb::SymbolType symbol_type,
SymbolContextList &sc_list) const { … }
void ModuleList::FindModules(const ModuleSpec &module_spec,
ModuleList &matching_module_list) const { … }
ModuleSP ModuleList::FindModule(const Module *module_ptr) const { … }
ModuleSP ModuleList::FindModule(const UUID &uuid) const { … }
void ModuleList::FindTypes(Module *search_first, const TypeQuery &query,
TypeResults &results) const { … }
bool ModuleList::FindSourceFile(const FileSpec &orig_spec,
FileSpec &new_spec) const { … }
void ModuleList::FindAddressesForLine(const lldb::TargetSP target_sp,
const FileSpec &file, uint32_t line,
Function *function,
std::vector<Address> &output_local,
std::vector<Address> &output_extern) { … }
ModuleSP ModuleList::FindFirstModule(const ModuleSpec &module_spec) const { … }
size_t ModuleList::GetSize() const { … }
void ModuleList::Dump(Stream *s) const { … }
void ModuleList::LogUUIDAndPaths(Log *log, const char *prefix_cstr) { … }
bool ModuleList::ResolveFileAddress(lldb::addr_t vm_addr,
Address &so_addr) const { … }
uint32_t
ModuleList::ResolveSymbolContextForAddress(const Address &so_addr,
SymbolContextItem resolve_scope,
SymbolContext &sc) const { … }
uint32_t ModuleList::ResolveSymbolContextForFilePath(
const char *file_path, uint32_t line, bool check_inlines,
SymbolContextItem resolve_scope, SymbolContextList &sc_list) const { … }
uint32_t ModuleList::ResolveSymbolContextsForFileSpec(
const FileSpec &file_spec, uint32_t line, bool check_inlines,
SymbolContextItem resolve_scope, SymbolContextList &sc_list) const { … }
size_t ModuleList::GetIndexForModule(const Module *module) const { … }
namespace {
struct SharedModuleListInfo { … };
}
static SharedModuleListInfo &GetSharedModuleListInfo()
{ … }
static ModuleList &GetSharedModuleList() { … }
ModuleListProperties &ModuleList::GetGlobalModuleListProperties() { … }
bool ModuleList::ModuleIsInCache(const Module *module_ptr) { … }
void ModuleList::FindSharedModules(const ModuleSpec &module_spec,
ModuleList &matching_module_list) { … }
lldb::ModuleSP ModuleList::FindSharedModule(const UUID &uuid) { … }
size_t ModuleList::RemoveOrphanSharedModules(bool mandatory) { … }
Status
ModuleList::GetSharedModule(const ModuleSpec &module_spec, ModuleSP &module_sp,
const FileSpecList *module_search_paths_ptr,
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules,
bool *did_create_ptr, bool always_create) { … }
bool ModuleList::RemoveSharedModule(lldb::ModuleSP &module_sp) { … }
bool ModuleList::RemoveSharedModuleIfOrphaned(const Module *module_ptr) { … }
bool ModuleList::LoadScriptingResourcesInTarget(Target *target,
std::list<Status> &errors,
Stream &feedback_stream,
bool continue_on_error) { … }
void ModuleList::ForEach(
std::function<bool(const ModuleSP &module_sp)> const &callback) const { … }
bool ModuleList::AnyOf(
std::function<bool(lldb_private::Module &module_sp)> const &callback)
const { … }
void ModuleList::Swap(ModuleList &other) { … }