File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1451,16 +1451,18 @@ bool Target::IgnoreWatchpointByID(lldb::watch_id_t watch_id,
1451
1451
}
1452
1452
1453
1453
ModuleSP Target::GetExecutableModule () {
1454
- // search for the first executable in the module list
1455
- for (size_t i = 0 ; i < m_images.GetSize (); ++i) {
1456
- ModuleSP module_sp = m_images.GetModuleAtIndex (i);
1454
+ std::lock_guard<std::recursive_mutex> lock (m_images.GetMutex ());
1455
+
1456
+ // Search for the first executable in the module list.
1457
+ for (ModuleSP module_sp : m_images.ModulesNoLocking ()) {
1457
1458
lldb_private::ObjectFile *obj = module_sp->GetObjectFile ();
1458
1459
if (obj == nullptr )
1459
1460
continue ;
1460
1461
if (obj->GetType () == ObjectFile::Type::eTypeExecutable)
1461
1462
return module_sp;
1462
1463
}
1463
- // as fall back return the first module loaded
1464
+
1465
+ // If there is none, fall back return the first module loaded.
1464
1466
return m_images.GetModuleAtIndex (0 );
1465
1467
}
1466
1468
You can’t perform that action at this time.
0 commit comments