summaryrefslogtreecommitdiffstats
path: root/source/Interpreter/OptionValueSInt64.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-07-03 16:57:06 +0000
committeremaste <emaste@FreeBSD.org>2015-07-03 16:57:06 +0000
commit8037fa4ee916fa20b3c63cbf531f4ee7e1c76138 (patch)
tree3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Interpreter/OptionValueSInt64.cpp
parentd61b076ede88b56f3372a55e7d1eac6a9d717120 (diff)
downloadFreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.zip
FreeBSD-src-8037fa4ee916fa20b3c63cbf531f4ee7e1c76138.tar.gz
Import LLDB as of upstream SVN 241361 (git 612c075f)
Diffstat (limited to 'source/Interpreter/OptionValueSInt64.cpp')
-rw-r--r--source/Interpreter/OptionValueSInt64.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/Interpreter/OptionValueSInt64.cpp b/source/Interpreter/OptionValueSInt64.cpp
index c691729..97cdf10 100644
--- a/source/Interpreter/OptionValueSInt64.cpp
+++ b/source/Interpreter/OptionValueSInt64.cpp
@@ -36,9 +36,8 @@ OptionValueSInt64::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uin
}
Error
-OptionValueSInt64::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+OptionValueSInt64::SetValueFromString (llvm::StringRef value_ref, VarSetOperationType op)
{
- //printf ("%p: SetValueFromCString (s=\"%s\", op=%i)\n", this, value_cstr, op);
Error error;
switch (op)
{
@@ -51,7 +50,8 @@ OptionValueSInt64::SetValueFromCString (const char *value_cstr, VarSetOperationT
case eVarSetOperationAssign:
{
bool success = false;
- int64_t value = StringConvert::ToSInt64 (value_cstr, 0, 0, &success);
+ std::string value_str = value_ref.trim().str();
+ int64_t value = StringConvert::ToSInt64 (value_str.c_str(), 0, 0, &success);
if (success)
{
if (value >= m_min_value && value <= m_max_value)
@@ -68,7 +68,8 @@ OptionValueSInt64::SetValueFromCString (const char *value_cstr, VarSetOperationT
}
else
{
- error.SetErrorStringWithFormat ("invalid int64_t string value: '%s'", value_cstr);
+ error.SetErrorStringWithFormat ("invalid int64_t string value: '%s'",
+ value_ref.str().c_str());
}
}
break;
@@ -78,7 +79,7 @@ OptionValueSInt64::SetValueFromCString (const char *value_cstr, VarSetOperationT
case eVarSetOperationRemove:
case eVarSetOperationAppend:
case eVarSetOperationInvalid:
- error = OptionValue::SetValueFromCString (value_cstr, op);
+ error = OptionValue::SetValueFromString (value_ref, op);
break;
}
return error;
OpenPOWER on IntegriCloud