diff options
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 879eb9bd182..5c8e0e0ca8e 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -1162,3 +1162,15 @@ ModuleList::LoadScriptingResourcesInTarget (Target *target, } return errors.size() == 0; } + +void +ModuleList::ForEach (std::function <bool (const ModuleSP &module_sp)> const &callback) const +{ + Mutex::Locker locker(m_modules_mutex); + for (const auto &module : m_modules) + { + // If the callback returns false, then stop iterating and break out + if (!callback (module)) + break; + } +} |