summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp9
4 files changed, 11 insertions, 17 deletions
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 946bb83aa8f..f1fa7b8ee7d 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -1476,12 +1476,12 @@ public:
int match_start_point, int max_return_elements,
bool &word_complete,
StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
+ llvm::StringRef completion_str = input[cursor_index].ref;
+ completion_str = completion_str.take_front(cursor_char_position);
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
+ completion_str, match_start_point, max_return_elements, nullptr,
word_complete, matches);
return matches.GetSize();
}
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 56e2cc94c9d..74de945dbd9 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -473,12 +473,12 @@ public:
bool &word_complete,
StringList &matches) override {
// Arguments are the standard source file completer.
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
+ auto completion_str = input[cursor_index].ref;
+ completion_str = completion_str.take_front(cursor_char_position);
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eVariablePathCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
+ completion_str, match_start_point, max_return_elements, nullptr,
word_complete, matches);
return matches.GetSize();
}
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index fd3795e0859..5b7f1342328 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1558,9 +1558,8 @@ protected:
int num_signals_set = 0;
if (num_args > 0) {
- for (size_t i = 0; i < num_args; ++i) {
- int32_t signo = signals_sp->GetSignalNumberFromName(
- signal_args.GetArgumentAtIndex(i));
+ for (const auto &arg : signal_args) {
+ int32_t signo = signals_sp->GetSignalNumberFromName(arg.c_str());
if (signo != LLDB_INVALID_SIGNAL_NUMBER) {
// Casting the actions as bools here should be okay, because
// VerifyCommandOptionValue guarantees
@@ -1576,7 +1575,7 @@ protected:
++num_signals_set;
} else {
result.AppendErrorWithFormat("Invalid signal name '%s'\n",
- signal_args.GetArgumentAtIndex(i));
+ arg.c_str());
}
}
} else {
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index 0a97804fbf6..23fdcb9e895 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -293,15 +293,10 @@ protected:
bool DoExecute(Args &args, CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishResult);
- const size_t argc = args.GetArgumentCount();
if (!args.empty()) {
- // TODO: Convert this to StringRef based enumeration. Requires converting
- // DumpPropertyValue first.
- for (size_t i = 0; i < argc; ++i) {
- const char *property_path = args.GetArgumentAtIndex(i);
-
+ for (const auto &arg : args) {
Error error(m_interpreter.GetDebugger().DumpPropertyValue(
- &m_exe_ctx, result.GetOutputStream(), property_path,
+ &m_exe_ctx, result.GetOutputStream(), arg.ref,
OptionValue::eDumpGroupValue));
if (error.Success()) {
result.GetOutputStream().EOL();
OpenPOWER on IntegriCloud