Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lldb/source/Target/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,15 +1510,18 @@ bool Target::IgnoreWatchpointByID(lldb::watch_id_t watch_id,
}

ModuleSP Target::GetExecutableModule() {
// search for the first executable in the module list
for (ModuleSP module_sp : m_images.Modules()) {
std::lock_guard<std::recursive_mutex> lock(m_images.GetMutex());

// Search for the first executable in the module list.
for (ModuleSP module_sp : m_images.ModulesNoLocking()) {
lldb_private::ObjectFile *obj = module_sp->GetObjectFile();
if (obj == nullptr)
continue;
if (obj->GetType() == ObjectFile::Type::eTypeExecutable)
return module_sp;
}
// as fall back return the first module loaded

// If there is none, fall back return the first module loaded.
return m_images.GetModuleAtIndex(0);
}

Expand Down
Loading