aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Core/ModuleList.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-07-26 19:03:47 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-07-26 19:04:23 +0000
commit7fa27ce4a07f19b07799a767fc29416f3b625afb (patch)
tree27825c83636c4de341eb09a74f49f5d38a15d165 /lldb/source/Core/ModuleList.cpp
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp64
1 files changed, 28 insertions, 36 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 5aa58d9bba6b..d0d0b2050e18 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
#include "lldb/Core/ModuleList.h"
-#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/FileSystem.h"
@@ -22,6 +21,7 @@
#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"
@@ -97,79 +97,71 @@ ModuleListProperties::ModuleListProperties() {
bool ModuleListProperties::GetEnableExternalLookup() const {
const uint32_t idx = ePropertyEnableExternalLookup;
- return m_collection_sp->GetPropertyAtIndexAsBoolean(
- nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0);
+ return GetPropertyAtIndexAs<bool>(
+ idx, g_modulelist_properties[idx].default_uint_value != 0);
}
bool ModuleListProperties::SetEnableExternalLookup(bool new_value) {
- return m_collection_sp->SetPropertyAtIndexAsBoolean(
- nullptr, ePropertyEnableExternalLookup, new_value);
+ return SetPropertyAtIndex(ePropertyEnableExternalLookup, new_value);
}
bool ModuleListProperties::GetEnableBackgroundLookup() const {
const uint32_t idx = ePropertyEnableBackgroundLookup;
- return m_collection_sp->GetPropertyAtIndexAsBoolean(
- nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0);
+ return GetPropertyAtIndexAs<bool>(
+ idx, g_modulelist_properties[idx].default_uint_value != 0);
}
FileSpec ModuleListProperties::GetClangModulesCachePath() const {
- return m_collection_sp
- ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
- ePropertyClangModulesCachePath)
- ->GetCurrentValue();
+ const uint32_t idx = ePropertyClangModulesCachePath;
+ return GetPropertyAtIndexAs<FileSpec>(idx, {});
}
bool ModuleListProperties::SetClangModulesCachePath(const FileSpec &path) {
- return m_collection_sp->SetPropertyAtIndexAsFileSpec(
- nullptr, ePropertyClangModulesCachePath, path);
+ const uint32_t idx = ePropertyClangModulesCachePath;
+ return SetPropertyAtIndex(idx, path);
}
FileSpec ModuleListProperties::GetLLDBIndexCachePath() const {
- return m_collection_sp
- ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
- ePropertyLLDBIndexCachePath)
- ->GetCurrentValue();
+ const uint32_t idx = ePropertyLLDBIndexCachePath;
+ return GetPropertyAtIndexAs<FileSpec>(idx, {});
}
bool ModuleListProperties::SetLLDBIndexCachePath(const FileSpec &path) {
- return m_collection_sp->SetPropertyAtIndexAsFileSpec(
- nullptr, ePropertyLLDBIndexCachePath, path);
+ const uint32_t idx = ePropertyLLDBIndexCachePath;
+ return SetPropertyAtIndex(idx, 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);
+ return GetPropertyAtIndexAs<bool>(
+ idx, g_modulelist_properties[idx].default_uint_value != 0);
}
bool ModuleListProperties::SetEnableLLDBIndexCache(bool new_value) {
- return m_collection_sp->SetPropertyAtIndexAsBoolean(
- nullptr, ePropertyEnableLLDBIndexCache, new_value);
+ return SetPropertyAtIndex(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);
+ return GetPropertyAtIndexAs<uint64_t>(
+ 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);
+ return GetPropertyAtIndexAs<uint64_t>(
+ 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);
+ return GetPropertyAtIndexAs<uint64_t>(
+ idx, g_modulelist_properties[idx].default_uint_value);
}
void ModuleListProperties::UpdateSymlinkMappings() {
- FileSpecList list = m_collection_sp
- ->GetPropertyAtIndexAsOptionValueFileSpecList(
- nullptr, false, ePropertySymLinkPaths)
- ->GetCurrentValue();
+ FileSpecList list =
+ GetPropertyAtIndexAs<FileSpecList>(ePropertySymLinkPaths, {});
llvm::sys::ScopedWriter lock(m_symlink_paths_mutex);
const bool notify = false;
m_symlink_paths.Clear(notify);
@@ -188,8 +180,8 @@ PathMappingList ModuleListProperties::GetSymlinkMappings() const {
bool ModuleListProperties::GetLoadSymbolOnDemand() {
const uint32_t idx = ePropertyLoadSymbolOnDemand;
- return m_collection_sp->GetPropertyAtIndexAsBoolean(
- nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0);
+ return GetPropertyAtIndexAs<bool>(
+ idx, g_modulelist_properties[idx].default_uint_value != 0);
}
ModuleList::ModuleList() : m_modules(), m_modules_mutex() {}
@@ -1036,7 +1028,7 @@ bool ModuleList::RemoveSharedModuleIfOrphaned(const Module *module_ptr) {
bool ModuleList::LoadScriptingResourcesInTarget(Target *target,
std::list<Status> &errors,
- Stream *feedback_stream,
+ Stream &feedback_stream,
bool continue_on_error) {
if (!target)
return false;