================
@@ -1510,6 +1510,7 @@ bool Target::IgnoreWatchpointByID(lldb::watch_id_t
watch_id,
}
ModuleSP Target::GetExecutableModule() {
+ std::lock_guard<std::recursive_mutex> guard(m_images.GetMutex());
----------------
JDevlieghere wrote:
Let's use the `Modules()` iterable which allows us to use a for-based loop and
does the locking for us:
```
// Search for the first executable in the module list.
for (ModuleSP module_sp : m_images.Modules()) {
lldb_private::ObjectFile *obj = module_sp->GetObjectFile();
```
https://github.com/llvm/llvm-project/pull/139862
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits