summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 7637237aa16..c1da6f3d257 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -599,12 +599,9 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
// which only copies the main thread.
LLDB_LOG(log, "exec received, stop tracking all but main thread");
- for (auto i = m_threads.begin(); i != m_threads.end();) {
- if ((*i)->GetID() == GetID())
- i = m_threads.erase(i);
- else
- ++i;
- }
+ llvm::erase_if(m_threads, [&](std::unique_ptr<NativeThreadProtocol> &t) {
+ return t->GetID() != GetID();
+ });
assert(m_threads.size() == 1);
auto *main_thread = static_cast<NativeThreadLinux *>(m_threads[0].get());
OpenPOWER on IntegriCloud