[lldb] Remove unused will_modify argument (NFC)

Various OptionValue related classes are passing around will_modify but
the value is never used. This patch simplifies the interfaces by
removing the redundant argument.
This commit is contained in:
Jonas Devlieghere
2023-05-02 00:17:52 -07:00
parent 3c83afb68b
commit ddd9358bca
21 changed files with 113 additions and 132 deletions

View File

@@ -47,7 +47,6 @@ public:
virtual lldb::OptionValueSP GetPropertyValue(const ExecutionContext *exe_ctx,
llvm::StringRef property_path,
bool will_modify,
Status &error) const;
virtual Status SetPropertyValue(const ExecutionContext *exe_ctx,

View File

@@ -108,7 +108,6 @@ public:
// Subclasses can override these functions
virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name,
bool will_modify,
Status &error) const {
error.SetErrorStringWithFormat("'%s' is not a value subvalue", name.str().c_str());
return lldb::OptionValueSP();

View File

@@ -46,7 +46,7 @@ public:
bool IsAggregateValue() const override { return true; }
lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name, bool will_modify,
llvm::StringRef name,
Status &error) const override;
// Subclass specific functions

View File

@@ -61,7 +61,7 @@ public:
lldb::OptionValueSP GetValueForKey(llvm::StringRef key) const;
lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name, bool will_modify,
llvm::StringRef name,
Status &error) const override;
Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op,

View File

@@ -79,30 +79,28 @@ public:
// not be a path to a property path that refers to a property within a
// property
virtual const Property *GetProperty(const ExecutionContext *exe_ctx,
bool will_modify,
ConstString name) const;
virtual const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
bool will_modify,
uint32_t idx) const;
// Property can be be a property path like
// "target.process.extra-startup-command"
virtual const Property *GetPropertyAtPath(const ExecutionContext *exe_ctx,
bool will_modify,
llvm::StringRef property_path) const;
virtual const Property *
GetPropertyAtPath(const ExecutionContext *exe_ctx,
llvm::StringRef property_path) const;
virtual lldb::OptionValueSP
GetPropertyValueAtIndex(const ExecutionContext *exe_ctx, bool will_modify,
uint32_t idx) const;
GetPropertyValueAtIndex(const ExecutionContext *exe_ctx, uint32_t idx) const;
virtual lldb::OptionValueSP GetValueForKey(const ExecutionContext *exe_ctx,
ConstString key,
bool value_will_be_modified) const;
ConstString key) const;
lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name,
bool value_will_be_modified,
Status &error) const override;
Status SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op,
@@ -182,11 +180,11 @@ public:
OptionValueString *
GetPropertyAtIndexAsOptionValueString(const ExecutionContext *exe_ctx,
bool will_modify, uint32_t idx) const;
uint32_t idx) const;
OptionValueFileSpec *
GetPropertyAtIndexAsOptionValueFileSpec(const ExecutionContext *exe_ctx,
bool will_modify, uint32_t idx) const;
uint32_t idx) const;
FileSpec GetPropertyAtIndexAsFileSpec(const ExecutionContext *exe_ctx,
uint32_t idx) const;
@@ -194,11 +192,13 @@ public:
bool SetPropertyAtIndexAsFileSpec(const ExecutionContext *exe_ctx,
uint32_t idx, const FileSpec &file_spec);
OptionValuePathMappings *GetPropertyAtIndexAsOptionValuePathMappings(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
OptionValuePathMappings *
GetPropertyAtIndexAsOptionValuePathMappings(const ExecutionContext *exe_ctx,
uint32_t idx) const;
OptionValueFileSpecList *GetPropertyAtIndexAsOptionValueFileSpecList(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
OptionValueFileSpecList *
GetPropertyAtIndexAsOptionValueFileSpecList(const ExecutionContext *exe_ctx,
uint32_t idx) const;
void AppendProperty(ConstString name, llvm::StringRef desc, bool is_global,
const lldb::OptionValueSP &value_sp);

View File

@@ -1363,7 +1363,7 @@ SBDebugger::GetInternalVariableValue(const char *var_name,
ExecutionContext exe_ctx(
debugger_sp->GetCommandInterpreter().GetExecutionContext());
lldb::OptionValueSP value_sp(
debugger_sp->GetPropertyValue(&exe_ctx, var_name, false, error));
debugger_sp->GetPropertyValue(&exe_ctx, var_name, error));
if (value_sp) {
StreamString value_strm;
value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);

View File

@@ -161,8 +161,8 @@ insert-before or insert-after.");
const char *setting_var_name =
request.GetParsedLine().GetArgumentAtIndex(setting_var_idx);
Status error;
lldb::OptionValueSP value_sp(GetDebugger().GetPropertyValue(
&m_exe_ctx, setting_var_name, false, error));
lldb::OptionValueSP value_sp(
GetDebugger().GetPropertyValue(&m_exe_ctx, setting_var_name, error));
if (!value_sp)
return;
value_sp->AutoComplete(m_interpreter, request);
@@ -520,7 +520,6 @@ protected:
bool DoExecute(Args &args, CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishResult);
const bool will_modify = false;
const size_t argc = args.GetArgumentCount();
if (argc > 0) {
const bool dump_qualified_name = true;
@@ -530,7 +529,7 @@ protected:
const Property *property =
GetDebugger().GetValueProperties()->GetPropertyAtPath(
&m_exe_ctx, will_modify, property_path);
&m_exe_ctx, property_path);
if (property) {
property->DumpDescription(m_interpreter, result.GetOutputStream(), 0,

View File

@@ -253,7 +253,7 @@ bool Disassembler::ElideMixedSourceAndDisassemblyLine(
if (target_sp) {
Status error;
OptionValueSP value_sp = target_sp->GetDebugger().GetPropertyValue(
&exe_ctx, "target.process.thread.step-avoid-regexp", false, error);
&exe_ctx, "target.process.thread.step-avoid-regexp", error);
if (value_sp && value_sp->GetType() == OptionValue::eTypeRegex) {
OptionValueRegex *re = value_sp->GetAsRegex();
if (re) {

View File

@@ -114,7 +114,7 @@ bool ModuleListProperties::GetEnableBackgroundLookup() const {
FileSpec ModuleListProperties::GetClangModulesCachePath() const {
return m_collection_sp
->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
->GetPropertyAtIndexAsOptionValueFileSpec(nullptr,
ePropertyClangModulesCachePath)
->GetCurrentValue();
}
@@ -126,7 +126,7 @@ bool ModuleListProperties::SetClangModulesCachePath(const FileSpec &path) {
FileSpec ModuleListProperties::GetLLDBIndexCachePath() const {
return m_collection_sp
->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
->GetPropertyAtIndexAsOptionValueFileSpec(nullptr,
ePropertyLLDBIndexCachePath)
->GetCurrentValue();
}
@@ -168,7 +168,7 @@ uint64_t ModuleListProperties::GetLLDBIndexCacheExpirationDays() {
void ModuleListProperties::UpdateSymlinkMappings() {
FileSpecList list = m_collection_sp
->GetPropertyAtIndexAsOptionValueFileSpecList(
nullptr, false, ePropertySymLinkPaths)
nullptr, ePropertySymLinkPaths)
->GetCurrentValue();
llvm::sys::ScopedWriter lock(m_symlink_paths_mutex);
const bool notify = false;

View File

@@ -32,11 +32,10 @@ using namespace lldb_private;
lldb::OptionValueSP
Properties::GetPropertyValue(const ExecutionContext *exe_ctx,
llvm::StringRef path, bool will_modify,
Status &error) const {
llvm::StringRef path, Status &error) const {
OptionValuePropertiesSP properties_sp(GetValueProperties());
if (properties_sp)
return properties_sp->GetSubValue(exe_ctx, path, will_modify, error);
return properties_sp->GetSubValue(exe_ctx, path, error);
return lldb::OptionValueSP();
}

View File

@@ -94,8 +94,7 @@ Status OptionValueArray::SetValueFromString(llvm::StringRef value,
lldb::OptionValueSP
OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name, bool will_modify,
Status &error) const {
llvm::StringRef name, Status &error) const {
if (name.empty() || name.front() != '[') {
error.SetErrorStringWithFormat(
"invalid value path '%s', %s values only support '[<index>]' subvalues "
@@ -129,8 +128,7 @@ OptionValueArray::GetSubValue(const ExecutionContext *exe_ctx,
if (new_idx < array_count) {
if (m_values[new_idx]) {
if (!sub_value.empty())
return m_values[new_idx]->GetSubValue(exe_ctx, sub_value,
will_modify, error);
return m_values[new_idx]->GetSubValue(exe_ctx, sub_value, error);
else
return m_values[new_idx];
}

View File

@@ -234,8 +234,7 @@ Status OptionValueDictionary::SetValueFromString(llvm::StringRef value,
lldb::OptionValueSP
OptionValueDictionary::GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name, bool will_modify,
Status &error) const {
llvm::StringRef name, Status &error) const {
lldb::OptionValueSP value_sp;
if (name.empty())
return nullptr;
@@ -280,7 +279,7 @@ OptionValueDictionary::GetSubValue(const ExecutionContext *exe_ctx,
if (sub_name.empty())
return value_sp;
return value_sp->GetSubValue(exe_ctx, sub_name, will_modify, error);
return value_sp->GetSubValue(exe_ctx, sub_name, error);
}
Status OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx,
@@ -288,8 +287,7 @@ Status OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name,
llvm::StringRef value) {
Status error;
const bool will_modify = true;
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, error));
if (value_sp)
error = value_sp->SetValueFromString(value, op);
else {

View File

@@ -75,19 +75,17 @@ void OptionValueProperties::AppendProperty(ConstString name,
//
lldb::OptionValueSP
OptionValueProperties::GetValueForKey(const ExecutionContext *exe_ctx,
ConstString key,
bool will_modify) const {
ConstString key) const {
lldb::OptionValueSP value_sp;
size_t idx = m_name_to_index.Find(key, SIZE_MAX);
if (idx < m_properties.size())
value_sp = GetPropertyAtIndex(exe_ctx, will_modify, idx)->GetValue();
value_sp = GetPropertyAtIndex(exe_ctx, idx)->GetValue();
return value_sp;
}
lldb::OptionValueSP
OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name, bool will_modify,
Status &error) const {
llvm::StringRef name, Status &error) const {
lldb::OptionValueSP value_sp;
if (name.empty())
return OptionValueSP();
@@ -101,7 +99,7 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
} else
key.SetString(name);
value_sp = GetValueForKey(exe_ctx, key, will_modify);
value_sp = GetValueForKey(exe_ctx, key);
if (sub_name.empty() || !value_sp)
return value_sp;
@@ -109,14 +107,14 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
case '.': {
lldb::OptionValueSP return_val_sp;
return_val_sp =
value_sp->GetSubValue(exe_ctx, sub_name.drop_front(), will_modify, error);
value_sp->GetSubValue(exe_ctx, sub_name.drop_front(), error);
if (!return_val_sp) {
if (Properties::IsSettingExperimental(sub_name.drop_front())) {
size_t experimental_len =
strlen(Properties::GetExperimentalSettingsName());
if (sub_name[experimental_len + 1] == '.')
return_val_sp = value_sp->GetSubValue(
exe_ctx, sub_name.drop_front(experimental_len + 2), will_modify, error);
exe_ctx, sub_name.drop_front(experimental_len + 2), error);
// It isn't an error if an experimental setting is not present.
if (!return_val_sp)
error.Clear();
@@ -127,7 +125,7 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
case '[':
// Array or dictionary access for subvalues like: "[12]" -- access
// 12th array element "['hello']" -- dictionary access of key named hello
return value_sp->GetSubValue(exe_ctx, sub_name, will_modify, error);
return value_sp->GetSubValue(exe_ctx, sub_name, error);
default:
value_sp.reset();
@@ -141,7 +139,6 @@ Status OptionValueProperties::SetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef name,
llvm::StringRef value) {
Status error;
const bool will_modify = true;
llvm::SmallVector<llvm::StringRef, 8> components;
name.split(components, '.');
bool name_contains_experimental = false;
@@ -149,7 +146,7 @@ Status OptionValueProperties::SetSubValue(const ExecutionContext *exe_ctx,
if (Properties::IsSettingExperimental(part))
name_contains_experimental = true;
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, error));
if (value_sp)
error = value_sp->SetValueFromString(value, op);
else {
@@ -169,21 +166,21 @@ OptionValueProperties::GetPropertyIndex(ConstString name) const {
const Property *
OptionValueProperties::GetProperty(const ExecutionContext *exe_ctx,
bool will_modify,
ConstString name) const {
return GetPropertyAtIndex(
exe_ctx, will_modify,
m_name_to_index.Find(name, SIZE_MAX));
return GetPropertyAtIndex(exe_ctx, m_name_to_index.Find(name, SIZE_MAX));
}
const Property *OptionValueProperties::GetPropertyAtIndex(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
const Property *
OptionValueProperties::GetPropertyAtIndex(const ExecutionContext *exe_ctx,
uint32_t idx) const {
return ProtectedGetPropertyAtIndex(idx);
}
lldb::OptionValueSP OptionValueProperties::GetPropertyValueAtIndex(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
const Property *setting = GetPropertyAtIndex(exe_ctx, will_modify, idx);
lldb::OptionValueSP
OptionValueProperties::GetPropertyValueAtIndex(const ExecutionContext *exe_ctx,
uint32_t idx) const {
const Property *setting = GetPropertyAtIndex(exe_ctx, idx);
if (setting)
return setting->GetValue();
return OptionValueSP();
@@ -191,8 +188,8 @@ lldb::OptionValueSP OptionValueProperties::GetPropertyValueAtIndex(
OptionValuePathMappings *
OptionValueProperties::GetPropertyAtIndexAsOptionValuePathMappings(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, will_modify, idx));
const ExecutionContext *exe_ctx, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, idx));
if (value_sp)
return value_sp->GetAsPathMappings();
return nullptr;
@@ -200,8 +197,8 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValuePathMappings(
OptionValueFileSpecList *
OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpecList(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, will_modify, idx));
const ExecutionContext *exe_ctx, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, idx));
if (value_sp)
return value_sp->GetAsFileSpecList();
return nullptr;
@@ -209,7 +206,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpecList(
OptionValueArch *OptionValueProperties::GetPropertyAtIndexAsOptionValueArch(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property)
return property->GetValue()->GetAsArch();
return nullptr;
@@ -218,7 +215,7 @@ OptionValueArch *OptionValueProperties::GetPropertyAtIndexAsOptionValueArch(
OptionValueLanguage *
OptionValueProperties::GetPropertyAtIndexAsOptionValueLanguage(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property)
return property->GetValue()->GetAsLanguage();
return nullptr;
@@ -226,7 +223,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueLanguage(
bool OptionValueProperties::SetPropertyAtIndexAsLanguage(
const ExecutionContext *exe_ctx, uint32_t idx, const LanguageType lang) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -237,7 +234,7 @@ bool OptionValueProperties::SetPropertyAtIndexAsLanguage(
bool OptionValueProperties::GetPropertyAtIndexAsArgs(
const ExecutionContext *exe_ctx, uint32_t idx, Args &args) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (!property)
return false;
@@ -268,7 +265,7 @@ bool OptionValueProperties::GetPropertyAtIndexAsArgs(
bool OptionValueProperties::SetPropertyAtIndexFromArgs(
const ExecutionContext *exe_ctx, uint32_t idx, const Args &args) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (!property)
return false;
@@ -293,7 +290,7 @@ bool OptionValueProperties::SetPropertyAtIndexFromArgs(
std::optional<bool> OptionValueProperties::GetPropertyAtIndexAsBoolean(
const ExecutionContext *exe_ctx, uint32_t idx) const {
if (const Property *property = GetPropertyAtIndex(exe_ctx, false, idx)) {
if (const Property *property = GetPropertyAtIndex(exe_ctx, idx)) {
if (OptionValue *value = property->GetValue().get())
return value->GetBooleanValue();
}
@@ -302,7 +299,7 @@ std::optional<bool> OptionValueProperties::GetPropertyAtIndexAsBoolean(
bool OptionValueProperties::SetPropertyAtIndexAsBoolean(
const ExecutionContext *exe_ctx, uint32_t idx, bool new_value) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value) {
@@ -316,7 +313,7 @@ bool OptionValueProperties::SetPropertyAtIndexAsBoolean(
OptionValueDictionary *
OptionValueProperties::GetPropertyAtIndexAsOptionValueDictionary(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property)
return property->GetValue()->GetAsDictionary();
return nullptr;
@@ -324,7 +321,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueDictionary(
std::optional<int64_t> OptionValueProperties::GetPropertyAtIndexAsEnumeration(
const ExecutionContext *exe_ctx, uint32_t idx) const {
if (const Property *property = GetPropertyAtIndex(exe_ctx, false, idx)) {
if (const Property *property = GetPropertyAtIndex(exe_ctx, idx)) {
if (OptionValue *value = property->GetValue().get())
return value->GetEnumerationValue();
}
@@ -333,7 +330,7 @@ std::optional<int64_t> OptionValueProperties::GetPropertyAtIndexAsEnumeration(
bool OptionValueProperties::SetPropertyAtIndexAsEnumeration(
const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -345,7 +342,7 @@ bool OptionValueProperties::SetPropertyAtIndexAsEnumeration(
const FormatEntity::Entry *
OptionValueProperties::GetPropertyAtIndexAsFormatEntity(
const ExecutionContext *exe_ctx, uint32_t idx) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -356,8 +353,8 @@ OptionValueProperties::GetPropertyAtIndexAsFormatEntity(
OptionValueFileSpec *
OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpec(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -368,7 +365,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpec(
FileSpec OptionValueProperties::GetPropertyAtIndexAsFileSpec(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -380,7 +377,7 @@ FileSpec OptionValueProperties::GetPropertyAtIndexAsFileSpec(
bool OptionValueProperties::SetPropertyAtIndexAsFileSpec(
const ExecutionContext *exe_ctx, uint32_t idx,
const FileSpec &new_file_spec) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -392,7 +389,7 @@ bool OptionValueProperties::SetPropertyAtIndexAsFileSpec(
const RegularExpression *
OptionValueProperties::GetPropertyAtIndexAsOptionValueRegex(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -403,7 +400,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueRegex(
OptionValueSInt64 *OptionValueProperties::GetPropertyAtIndexAsOptionValueSInt64(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -414,7 +411,7 @@ OptionValueSInt64 *OptionValueProperties::GetPropertyAtIndexAsOptionValueSInt64(
OptionValueUInt64 *OptionValueProperties::GetPropertyAtIndexAsOptionValueUInt64(
const ExecutionContext *exe_ctx, uint32_t idx) const {
const Property *property = GetPropertyAtIndex(exe_ctx, false, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -425,7 +422,7 @@ OptionValueUInt64 *OptionValueProperties::GetPropertyAtIndexAsOptionValueUInt64(
std::optional<int64_t> OptionValueProperties::GetPropertyAtIndexAsSInt64(
const ExecutionContext *exe_ctx, uint32_t idx) const {
if (const Property *property = GetPropertyAtIndex(exe_ctx, false, idx)) {
if (const Property *property = GetPropertyAtIndex(exe_ctx, idx)) {
if (OptionValue *value = property->GetValue().get())
return value->GetSInt64Value();
}
@@ -434,7 +431,7 @@ std::optional<int64_t> OptionValueProperties::GetPropertyAtIndexAsSInt64(
bool OptionValueProperties::SetPropertyAtIndexAsSInt64(
const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -446,7 +443,7 @@ bool OptionValueProperties::SetPropertyAtIndexAsSInt64(
std::optional<llvm::StringRef>
OptionValueProperties::GetPropertyAtIndexAsString(
const ExecutionContext *exe_ctx, uint32_t idx) const {
if (const Property *property = GetPropertyAtIndex(exe_ctx, false, idx)) {
if (const Property *property = GetPropertyAtIndex(exe_ctx, idx)) {
if (OptionValue *value = property->GetValue().get())
return value->GetStringValue();
}
@@ -455,7 +452,7 @@ OptionValueProperties::GetPropertyAtIndexAsString(
bool OptionValueProperties::SetPropertyAtIndexAsString(
const ExecutionContext *exe_ctx, uint32_t idx, llvm::StringRef new_value) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -465,8 +462,8 @@ bool OptionValueProperties::SetPropertyAtIndexAsString(
}
OptionValueString *OptionValueProperties::GetPropertyAtIndexAsOptionValueString(
const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, will_modify, idx));
const ExecutionContext *exe_ctx, uint32_t idx) const {
OptionValueSP value_sp(GetPropertyValueAtIndex(exe_ctx, idx));
if (value_sp)
return value_sp->GetAsString();
return nullptr;
@@ -474,7 +471,7 @@ OptionValueString *OptionValueProperties::GetPropertyAtIndexAsOptionValueString(
std::optional<uint64_t> OptionValueProperties::GetPropertyAtIndexAsUInt64(
const ExecutionContext *exe_ctx, uint32_t idx) const {
if (const Property *property = GetPropertyAtIndex(exe_ctx, false, idx)) {
if (const Property *property = GetPropertyAtIndex(exe_ctx, idx)) {
if (OptionValue *value = property->GetValue().get())
return value->GetUInt64Value();
}
@@ -483,7 +480,7 @@ std::optional<uint64_t> OptionValueProperties::GetPropertyAtIndexAsUInt64(
bool OptionValueProperties::SetPropertyAtIndexAsUInt64(
const ExecutionContext *exe_ctx, uint32_t idx, uint64_t new_value) {
const Property *property = GetPropertyAtIndex(exe_ctx, true, idx);
const Property *property = GetPropertyAtIndex(exe_ctx, idx);
if (property) {
OptionValue *value = property->GetValue().get();
if (value)
@@ -527,7 +524,7 @@ void OptionValueProperties::DumpValue(const ExecutionContext *exe_ctx,
Stream &strm, uint32_t dump_mask) {
const size_t num_properties = m_properties.size();
for (size_t i = 0; i < num_properties; ++i) {
const Property *property = GetPropertyAtIndex(exe_ctx, false, i);
const Property *property = GetPropertyAtIndex(exe_ctx, i);
if (property) {
OptionValue *option_value = property->GetValue().get();
assert(option_value);
@@ -544,7 +541,7 @@ OptionValueProperties::ToJSON(const ExecutionContext *exe_ctx) {
llvm::json::Object json_properties;
const size_t num_properties = m_properties.size();
for (size_t i = 0; i < num_properties; ++i) {
const Property *property = GetPropertyAtIndex(exe_ctx, false, i);
const Property *property = GetPropertyAtIndex(exe_ctx, i);
if (property) {
OptionValue *option_value = property->GetValue().get();
assert(option_value);
@@ -560,9 +557,7 @@ Status OptionValueProperties::DumpPropertyValue(const ExecutionContext *exe_ctx,
llvm::StringRef property_path,
uint32_t dump_mask, bool is_json) {
Status error;
const bool will_modify = false;
lldb::OptionValueSP value_sp(
GetSubValue(exe_ctx, property_path, will_modify, error));
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, property_path, error));
if (value_sp) {
if (!value_sp->ValueIsTransparent()) {
if (dump_mask & eDumpOptionName)
@@ -606,8 +601,9 @@ OptionValueProperties::DeepCopy(const OptionValueSP &new_parent) const {
return copy_sp;
}
const Property *OptionValueProperties::GetPropertyAtPath(
const ExecutionContext *exe_ctx, bool will_modify, llvm::StringRef name) const {
const Property *
OptionValueProperties::GetPropertyAtPath(const ExecutionContext *exe_ctx,
llvm::StringRef name) const {
const Property *property = nullptr;
if (name.empty())
return nullptr;
@@ -621,7 +617,7 @@ const Property *OptionValueProperties::GetPropertyAtPath(
} else
key.SetString(name);
property = GetProperty(exe_ctx, will_modify, key);
property = GetProperty(exe_ctx, key);
if (sub_name.empty() || !property)
return property;
@@ -629,8 +625,7 @@ const Property *OptionValueProperties::GetPropertyAtPath(
OptionValueProperties *sub_properties =
property->GetValue()->GetAsProperties();
if (sub_properties)
return sub_properties->GetPropertyAtPath(exe_ctx, will_modify,
sub_name.drop_front());
return sub_properties->GetPropertyAtPath(exe_ctx, sub_name.drop_front());
}
return nullptr;
}
@@ -684,7 +679,7 @@ void OptionValueProperties::Apropos(
lldb::OptionValuePropertiesSP
OptionValueProperties::GetSubProperty(const ExecutionContext *exe_ctx,
ConstString name) {
lldb::OptionValueSP option_value_sp(GetValueForKey(exe_ctx, name, false));
lldb::OptionValueSP option_value_sp(GetValueForKey(exe_ctx, name));
if (option_value_sp) {
OptionValueProperties *ov_properties = option_value_sp->GetAsProperties();
if (ov_properties)

View File

@@ -136,8 +136,7 @@ public:
const char *GetIgnoredExceptions() const {
const uint32_t idx = ePropertyIgnoredExceptions;
const OptionValueString *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueString(nullptr, false,
idx);
m_collection_sp->GetPropertyAtIndexAsOptionValueString(nullptr, idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -145,8 +144,7 @@ public:
OptionValueString *GetIgnoredExceptionValue() {
const uint32_t idx = ePropertyIgnoredExceptions;
OptionValueString *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueString(nullptr, false,
idx);
m_collection_sp->GetPropertyAtIndexAsOptionValueString(nullptr, idx);
assert(option_value);
return option_value;
}

View File

@@ -202,8 +202,8 @@ public:
FileSpecList GetKextDirectories() const {
const uint32_t idx = ePropertyKextDirectories;
const OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(
NULL, false, idx);
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
idx);
assert(option_value);
return option_value->GetCurrentValue();
}

View File

@@ -975,9 +975,10 @@ EnableOptionsSP ParseAutoEnableOptions(Status &error, Debugger &debugger) {
// Parse the arguments.
auto options_property_sp =
debugger.GetPropertyValue(nullptr, "plugin.structured-data.darwin-log."
"auto-enable-options",
false, error);
debugger.GetPropertyValue(nullptr,
"plugin.structured-data.darwin-log."
"auto-enable-options",
error);
if (!error.Success())
return EnableOptionsSP();
if (!options_property_sp) {

View File

@@ -121,7 +121,7 @@ bool PlatformProperties::SetModuleCacheDirectory(const FileSpec &dir_spec) {
void PlatformProperties::SetDefaultModuleCacheDirectory(
const FileSpec &dir_spec) {
auto f_spec_opt = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec(
nullptr, false, ePropertyModuleCacheDirectory);
nullptr, ePropertyModuleCacheDirectory);
assert(f_spec_opt);
f_spec_opt->SetDefaultValue(dir_spec);
}

View File

@@ -93,7 +93,6 @@ public:
ProcessOptionValueProperties(ConstString name) : Cloneable(name) {}
const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
bool will_modify,
uint32_t idx) const override {
// When getting the value for a key from the process options, we will
// always try and grab the setting from the current process if there is
@@ -329,7 +328,7 @@ bool ProcessProperties::GetSteppingRunsAllThreads() const {
bool ProcessProperties::GetOSPluginReportsAllThreads() const {
const bool fail_value = true;
const Property *exp_property =
m_collection_sp->GetPropertyAtIndex(nullptr, true, ePropertyExperimental);
m_collection_sp->GetPropertyAtIndex(nullptr, ePropertyExperimental);
OptionValueProperties *exp_values =
exp_property->GetValue()->GetAsProperties();
if (!exp_values)
@@ -342,7 +341,7 @@ bool ProcessProperties::GetOSPluginReportsAllThreads() const {
void ProcessProperties::SetOSPluginReportsAllThreads(bool does_report) {
const Property *exp_property =
m_collection_sp->GetPropertyAtIndex(nullptr, true, ePropertyExperimental);
m_collection_sp->GetPropertyAtIndex(nullptr, ePropertyExperimental);
OptionValueProperties *exp_values =
exp_property->GetValue()->GetAsProperties();
if (exp_values)
@@ -481,8 +480,7 @@ Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp,
// Allow the platform to override the default cache line size
OptionValueSP value_sp =
m_collection_sp
->GetPropertyAtIndex(nullptr, true, ePropertyMemCacheLineSize)
m_collection_sp->GetPropertyAtIndex(nullptr, ePropertyMemCacheLineSize)
->GetValue();
uint32_t platform_cache_line_size =
target_sp->GetPlatform()->GetDefaultMemoryCacheLineSize();

View File

@@ -4008,7 +4008,6 @@ public:
TargetOptionValueProperties(ConstString name) : Cloneable(name) {}
const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
bool will_modify,
uint32_t idx) const override {
// When getting the value for a key from the target options, we will always
// try and grab the setting from the current target if there is one. Else
@@ -4130,8 +4129,8 @@ void TargetProperties::UpdateLaunchInfoFromProperties() {
bool TargetProperties::GetInjectLocalVariables(
ExecutionContext *exe_ctx) const {
const Property *exp_property = m_collection_sp->GetPropertyAtIndex(
exe_ctx, false, ePropertyExperimental);
const Property *exp_property =
m_collection_sp->GetPropertyAtIndex(exe_ctx, ePropertyExperimental);
OptionValueProperties *exp_values =
exp_property->GetValue()->GetAsProperties();
if (exp_values)
@@ -4145,7 +4144,7 @@ bool TargetProperties::GetInjectLocalVariables(
void TargetProperties::SetInjectLocalVariables(ExecutionContext *exe_ctx,
bool b) {
const Property *exp_property =
m_collection_sp->GetPropertyAtIndex(exe_ctx, true, ePropertyExperimental);
m_collection_sp->GetPropertyAtIndex(exe_ctx, ePropertyExperimental);
OptionValueProperties *exp_values =
exp_property->GetValue()->GetAsProperties();
if (exp_values)
@@ -4374,7 +4373,7 @@ PathMappingList &TargetProperties::GetSourcePathMap() const {
const uint32_t idx = ePropertySourceMap;
OptionValuePathMappings *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValuePathMappings(nullptr,
false, idx);
idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -4389,7 +4388,7 @@ void TargetProperties::AppendExecutableSearchPaths(const FileSpec &dir) {
const uint32_t idx = ePropertyExecutableSearchPaths;
OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
false, idx);
idx);
assert(option_value);
option_value->AppendCurrentValue(dir);
}
@@ -4398,7 +4397,7 @@ FileSpecList TargetProperties::GetExecutableSearchPaths() {
const uint32_t idx = ePropertyExecutableSearchPaths;
const OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
false, idx);
idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -4407,7 +4406,7 @@ FileSpecList TargetProperties::GetDebugFileSearchPaths() {
const uint32_t idx = ePropertyDebugFileSearchPaths;
const OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
false, idx);
idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -4416,7 +4415,7 @@ FileSpecList TargetProperties::GetClangModuleSearchPaths() {
const uint32_t idx = ePropertyClangModuleSearchPaths;
const OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
false, idx);
idx);
assert(option_value);
return option_value->GetCurrentValue();
}
@@ -4477,7 +4476,7 @@ void TargetProperties::CheckJITObjectsDir() {
if (exists && is_directory && writable)
return;
m_collection_sp->GetPropertyAtIndex(nullptr, true, ePropertySaveObjectsDir)
m_collection_sp->GetPropertyAtIndex(nullptr, ePropertySaveObjectsDir)
->GetValue()
->Clear();
@@ -4578,8 +4577,7 @@ LanguageType TargetProperties::GetLanguage() const {
llvm::StringRef TargetProperties::GetExpressionPrefixContents() {
const uint32_t idx = ePropertyExprPrefix;
OptionValueFileSpec *file =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
idx);
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, idx);
if (file) {
DataBufferSP data_sp(file->GetFileContents());
if (data_sp)

View File

@@ -79,7 +79,6 @@ public:
ThreadOptionValueProperties(ConstString name) : Cloneable(name) {}
const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
bool will_modify,
uint32_t idx) const override {
// When getting the value for a key from the thread options, we will always
// try and grab the setting from the current thread if there is one. Else
@@ -119,7 +118,7 @@ FileSpecList ThreadProperties::GetLibrariesToAvoid() const {
const uint32_t idx = ePropertyStepAvoidLibraries;
const OptionValueFileSpecList *option_value =
m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
false, idx);
idx);
assert(option_value);
return option_value->GetCurrentValue();
}

View File

@@ -105,7 +105,7 @@ public:
}
OptionValueFileSpecList *GetFileList() {
return GetPropertyAtIndexAsOptionValueFileSpecList(nullptr, true,
return GetPropertyAtIndexAsOptionValueFileSpecList(nullptr,
m_file_list_index);
}