diff options
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 9176c9dbb357..48412137546d 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -85,6 +85,14 @@ ModuleListProperties::ModuleListProperties() { if (clang::driver::Driver::getDefaultModuleCachePath(path)) { lldbassert(SetClangModulesCachePath(FileSpec(path))); } + + path.clear(); + if (llvm::sys::path::cache_directory(path)) { + llvm::sys::path::append(path, "lldb"); + llvm::sys::path::append(path, "IndexCache"); + lldbassert(SetLLDBIndexCachePath(FileSpec(path))); + } + } bool ModuleListProperties::GetEnableExternalLookup() const { @@ -110,6 +118,47 @@ bool ModuleListProperties::SetClangModulesCachePath(const FileSpec &path) { nullptr, ePropertyClangModulesCachePath, path); } +FileSpec ModuleListProperties::GetLLDBIndexCachePath() const { + return m_collection_sp + ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false, + ePropertyLLDBIndexCachePath) + ->GetCurrentValue(); +} + +bool ModuleListProperties::SetLLDBIndexCachePath(const FileSpec &path) { + return m_collection_sp->SetPropertyAtIndexAsFileSpec( + nullptr, ePropertyLLDBIndexCachePath, path); +} + +bool ModuleListProperties::GetEnableLLDBIndexCache() const { + const uint32_t idx = ePropertyEnableLLDBIndexCache; + return m_collection_sp->GetPropertyAtIndexAsBoolean( + nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0); +} + +bool ModuleListProperties::SetEnableLLDBIndexCache(bool new_value) { + return m_collection_sp->SetPropertyAtIndexAsBoolean( + nullptr, ePropertyEnableLLDBIndexCache, new_value); +} + +uint64_t ModuleListProperties::GetLLDBIndexCacheMaxByteSize() { + const uint32_t idx = ePropertyLLDBIndexCacheMaxByteSize; + return m_collection_sp->GetPropertyAtIndexAsUInt64( + nullptr, idx, g_modulelist_properties[idx].default_uint_value); +} + +uint64_t ModuleListProperties::GetLLDBIndexCacheMaxPercent() { + const uint32_t idx = ePropertyLLDBIndexCacheMaxPercent; + return m_collection_sp->GetPropertyAtIndexAsUInt64( + nullptr, idx, g_modulelist_properties[idx].default_uint_value); +} + +uint64_t ModuleListProperties::GetLLDBIndexCacheExpirationDays() { + const uint32_t idx = ePropertyLLDBIndexCacheExpirationDays; + return m_collection_sp->GetPropertyAtIndexAsUInt64( + nullptr, idx, g_modulelist_properties[idx].default_uint_value); +} + void ModuleListProperties::UpdateSymlinkMappings() { FileSpecList list = m_collection_sp ->GetPropertyAtIndexAsOptionValueFileSpecList( |