diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 3e75e64..41416d3 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -770,28 +770,22 @@ public: process->GetThreadList().GetMutex()); const uint32_t num_threads = process->GetThreadList().GetSize(); std::vector<Thread *> resume_threads; - for (uint32_t i = 0; i < argc; ++i) { - bool success; - const int base = 0; - uint32_t thread_idx = - StringConvert::ToUInt32(command.GetArgumentAtIndex(i), - LLDB_INVALID_INDEX32, base, &success); - if (success) { - Thread *thread = - process->GetThreadList().FindThreadByIndexID(thread_idx).get(); + for (auto &entry : command.entries()) { + uint32_t thread_idx; + if (entry.ref.getAsInteger(0, thread_idx)) { + result.AppendErrorWithFormat( + "invalid thread index argument: \"%s\".\n", entry.c_str()); + result.SetStatus(eReturnStatusFailed); + return false; + } + Thread *thread = + process->GetThreadList().FindThreadByIndexID(thread_idx).get(); - if (thread) { - resume_threads.push_back(thread); - } else { - result.AppendErrorWithFormat("invalid thread index %u.\n", - thread_idx); - result.SetStatus(eReturnStatusFailed); - return false; - } + if (thread) { + resume_threads.push_back(thread); } else { - result.AppendErrorWithFormat( - "invalid thread index argument: \"%s\".\n", - command.GetArgumentAtIndex(i)); + result.AppendErrorWithFormat("invalid thread index %u.\n", + thread_idx); result.SetStatus(eReturnStatusFailed); return false; } |