diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 15 |
2 files changed, 8 insertions, 11 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index ef431e25c3d..8e7e68aad39 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1796,10 +1796,8 @@ LookupTypeInModule (CommandInterpreter &interpreter, strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : ""); DumpFullpath (strm, &module->GetFileSpec(), 0); strm.PutCString(":\n"); - const uint32_t num_types = type_list.GetSize(); - for (uint32_t i=0; i<num_types; ++i) + for (TypeSP type_sp : type_list.Types()) { - TypeSP type_sp (type_list.GetTypeAtIndex(i)); if (type_sp) { // Resolve the clang type so that any forward references diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index f46a2219a50..3dce83c48d0 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -183,24 +183,23 @@ protected: else if (command.GetArgumentCount() == 1 && ::strcmp (command.GetArgumentAtIndex(0), "all") == 0) { Process *process = m_exe_ctx.GetProcessPtr(); - Mutex::Locker locker (process->GetThreadList().GetMutex()); - uint32_t num_threads = process->GetThreadList().GetSize(); - for (uint32_t i = 0; i < num_threads; i++) + uint32_t idx = 0; + for (ThreadSP thread_sp : process->Threads()) { - ThreadSP thread_sp = process->GetThreadList().GetThreadAtIndex(i); + if (idx != 0) + result.AppendMessage(""); + if (!thread_sp->GetStatus (strm, m_options.m_start, m_options.m_count, num_frames_with_source)) { - result.AppendErrorWithFormat ("error displaying backtrace for thread: \"0x%4.4x\"\n", i); + result.AppendErrorWithFormat ("error displaying backtrace for thread: \"0x%4.4x\"\n", idx); result.SetStatus (eReturnStatusFailed); return false; } - if (i < num_threads - 1) - result.AppendMessage(""); - + ++idx; } } else |