mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
[lldb] Specify default value for platform.module-cache-directory
In addition to the commit rG352f16db87f583ec7f55f8028647b5fd8616111f, this one fixes settings behavior on clearing - the setting should be reverted to their default value, not an empty one.
This commit is contained in:
@@ -50,6 +50,9 @@ public:
|
||||
|
||||
FileSpec GetModuleCacheDirectory() const;
|
||||
bool SetModuleCacheDirectory(const FileSpec &dir_spec);
|
||||
|
||||
private:
|
||||
void SetDefaultModuleCacheDirectory(const FileSpec &dir_spec);
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<PlatformProperties> PlatformPropertiesSP;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "lldb/Host/Host.h"
|
||||
#include "lldb/Host/HostInfo.h"
|
||||
#include "lldb/Host/OptionParser.h"
|
||||
#include "lldb/Interpreter/OptionValueFileSpec.h"
|
||||
#include "lldb/Interpreter/OptionValueProperties.h"
|
||||
#include "lldb/Interpreter/Property.h"
|
||||
#include "lldb/Symbol/ObjectFile.h"
|
||||
@@ -93,6 +94,7 @@ PlatformProperties::PlatformProperties() {
|
||||
module_cache_dir = FileSpec(user_home_dir.c_str());
|
||||
module_cache_dir.AppendPathComponent(".lldb");
|
||||
module_cache_dir.AppendPathComponent("module_cache");
|
||||
SetDefaultModuleCacheDirectory(module_cache_dir);
|
||||
SetModuleCacheDirectory(module_cache_dir);
|
||||
}
|
||||
|
||||
@@ -117,6 +119,14 @@ bool PlatformProperties::SetModuleCacheDirectory(const FileSpec &dir_spec) {
|
||||
nullptr, ePropertyModuleCacheDirectory, dir_spec);
|
||||
}
|
||||
|
||||
void PlatformProperties::SetDefaultModuleCacheDirectory(
|
||||
const FileSpec &dir_spec) {
|
||||
auto f_spec_opt = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec(
|
||||
nullptr, false, ePropertyModuleCacheDirectory);
|
||||
assert(f_spec_opt);
|
||||
f_spec_opt->SetDefaultValue(dir_spec);
|
||||
}
|
||||
|
||||
/// Get the native host platform plug-in.
|
||||
///
|
||||
/// There should only be one of these for each host that LLDB runs
|
||||
|
||||
Reference in New Issue
Block a user