aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectProcess.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-21 23:18:07 +0000
committerZachary Turner <zturner@google.com>2016-11-21 23:18:07 +0000
commit1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2 (patch)
tree2ca0a559a8f8c36f3055919c15f379cfaf71df79 /lldb/source/Commands/CommandObjectProcess.cpp
parentc2cd4e004c4b34d8be0333b3dfe80831661bf11d (diff)
downloadllvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.zip
llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.tar.gz
llvm-1c55c9b5bf820a25ecf040fc3a5a1488b1d65cb2.tar.bz2
Add the new Args / entry-access API.
The long-term goal here is to get rid of the functions GetArgumentAtIndex() and GetQuoteCharAtIndex(), instead replacing them with operator based access and range-based for enumeration. There are a lot of callsites, though, so the changes will be done incrementally, starting with this one. Differential Revision: https://reviews.llvm.org/D26883 llvm-svn: 287597
Diffstat (limited to 'lldb/source/Commands/CommandObjectProcess.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index fd3795e..5b7f134 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 {