summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/Args.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-08-31 08:43:37 +0000
committerPavel Labath <labath@google.com>2016-08-31 08:43:37 +0000
commitb9739d4090da7812e4a3ba2fccc357a76ee80bcb (patch)
tree5bc0712bb45db3a66d76b1f1aac45ff2e13de4a8 /lldb/source/Interpreter/Args.cpp
parentf21aade0d8d96417b4a7e25c7ddc300b0ea6d718 (diff)
downloadbcm5719-llvm-b9739d4090da7812e4a3ba2fccc357a76ee80bcb.tar.gz
bcm5719-llvm-b9739d4090da7812e4a3ba2fccc357a76ee80bcb.zip
Revert r280137 and 280139 and subsequent build fixes
The rewrite of StringExtractor::GetHexMaxU32 changes functionality in a way which makes lldb-server crash. The crash (assert) happens when parsing the "qRegisterInfo0" packet, because the function tries to drop_front more bytes than the packet contains. It's not clear to me whether we should consider this a bug in the caller or the callee, but it any case, it worked before, so I am reverting this until we can figure out what the proper interface should be. llvm-svn: 280207
Diffstat (limited to 'lldb/source/Interpreter/Args.cpp')
-rw-r--r--lldb/source/Interpreter/Args.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 3587707b64c..2ffb8235430 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -430,19 +430,13 @@ Args::AppendArguments (const char **argv)
}
const char *
-Args::AppendArgument(llvm::StringRef arg_str, char quote_char)
-{
- return InsertArgumentAtIndex(GetArgumentCount(), arg_str, quote_char);
-}
-
-const char *
-Args::AppendArgument(const char *arg_cstr, char quote_char)
+Args::AppendArgument (const char *arg_cstr, char quote_char)
{
return InsertArgumentAtIndex (GetArgumentCount(), arg_cstr, quote_char);
}
const char *
-Args::InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char)
+Args::InsertArgumentAtIndex (size_t idx, const char *arg_cstr, char quote_char)
{
// Since we are using a std::list to hold onto the copied C string and
// we don't have direct access to the elements, we have to iterate to
@@ -452,8 +446,8 @@ Args::InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char
for (pos = m_args.begin(); i > 0 && pos != end; ++pos)
--i;
- pos = m_args.insert(pos, std::string(arg_str.data(), arg_str.size()));
-
+ pos = m_args.insert(pos, arg_cstr);
+
if (idx >= m_args_quote_char.size())
{
m_args_quote_char.resize(idx + 1);
@@ -461,19 +455,13 @@ Args::InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char
}
else
m_args_quote_char.insert(m_args_quote_char.begin() + idx, quote_char);
-
+
UpdateArgvFromArgs();
return GetArgumentAtIndex(idx);
}
const char *
-Args::InsertArgumentAtIndex(size_t idx, const char *arg_cstr, char quote_char)
-{
- return InsertArgumentAtIndex(idx, llvm::StringRef(arg_cstr), quote_char);
-}
-
-const char *
-Args::ReplaceArgumentAtIndex(size_t idx, const char *arg_cstr, char quote_char)
+Args::ReplaceArgumentAtIndex (size_t idx, const char *arg_cstr, char quote_char)
{
// Since we are using a std::list to hold onto the copied C string and
// we don't have direct access to the elements, we have to iterate to
OpenPOWER on IntegriCloud