summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueDictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/OptionValueDictionary.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueDictionary.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp
index da68a686045..c844d225405 100644
--- a/lldb/source/Interpreter/OptionValueDictionary.cpp
+++ b/lldb/source/Interpreter/OptionValueDictionary.cpp
@@ -308,7 +308,8 @@ Error OptionValueDictionary::SetSubValue(const ExecutionContext *exe_ctx,
const bool will_modify = true;
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
if (value_sp)
- error = value_sp->SetValueFromString(value, op);
+ error = value_sp->SetValueFromString(
+ llvm::StringRef::withNullAsEmpty(value), op);
else {
if (error.AsCString() == nullptr)
error.SetErrorStringWithFormat("invalid value path '%s'", name);
@@ -325,33 +326,6 @@ OptionValueDictionary::GetValueForKey(const ConstString &key) const {
return value_sp;
}
-const char *
-OptionValueDictionary::GetStringValueForKey(const ConstString &key) {
- collection::const_iterator pos = m_values.find(key);
- if (pos != m_values.end()) {
- OptionValueString *string_value = pos->second->GetAsString();
- if (string_value)
- return string_value->GetCurrentValue();
- }
- return nullptr;
-}
-
-bool OptionValueDictionary::SetStringValueForKey(const ConstString &key,
- const char *value,
- bool can_replace) {
- collection::const_iterator pos = m_values.find(key);
- if (pos != m_values.end()) {
- if (!can_replace)
- return false;
- if (pos->second->GetType() == OptionValue::eTypeString) {
- pos->second->SetValueFromString(value);
- return true;
- }
- }
- m_values[key] = OptionValueSP(new OptionValueString(value));
- return true;
-}
-
bool OptionValueDictionary::SetValueForKey(const ConstString &key,
const lldb::OptionValueSP &value_sp,
bool can_replace) {
OpenPOWER on IntegriCloud