aboutsummaryrefslogtreecommitdiff
path: root/source/Interpreter/OptionValueArch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Interpreter/OptionValueArch.cpp')
-rw-r--r--source/Interpreter/OptionValueArch.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/source/Interpreter/OptionValueArch.cpp b/source/Interpreter/OptionValueArch.cpp
index 7df149234bda..0e1ca07afd2e 100644
--- a/source/Interpreter/OptionValueArch.cpp
+++ b/source/Interpreter/OptionValueArch.cpp
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/lldb-python.h"
-
#include "lldb/Interpreter/OptionValueArch.h"
// C Includes
@@ -43,7 +41,7 @@ OptionValueArch::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint3
}
Error
-OptionValueArch::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+OptionValueArch::SetValueFromString (llvm::StringRef value, VarSetOperationType op)
{
Error error;
switch (op)
@@ -55,28 +53,23 @@ OptionValueArch::SetValueFromCString (const char *value_cstr, VarSetOperationTyp
case eVarSetOperationReplace:
case eVarSetOperationAssign:
- if (value_cstr && value_cstr[0])
{
- if (m_current_value.SetTriple (value_cstr))
+ std::string value_str = value.trim().str();
+ if (m_current_value.SetTriple (value_str.c_str()))
{
m_value_was_set = true;
NotifyValueChanged();
}
else
- error.SetErrorStringWithFormat("unsupported architecture '%s'", value_cstr);
- }
- else
- {
- error.SetErrorString("invalid value string");
+ error.SetErrorStringWithFormat("unsupported architecture '%s'", value_str.c_str());
+ break;
}
- break;
-
case eVarSetOperationInsertBefore:
case eVarSetOperationInsertAfter:
case eVarSetOperationRemove:
case eVarSetOperationAppend:
case eVarSetOperationInvalid:
- error = OptionValue::SetValueFromCString (value_cstr, op);
+ error = OptionValue::SetValueFromString (value, op);
break;
}
return error;