[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 24 06:37:46 PDT 2025
================
@@ -121,6 +121,15 @@ size_t Module::GetNumberAllocatedModules() {
return GetModuleCollection().size();
}
+Module *Module::GetAllocatedModuleWithUID(lldb::user_id_t uid) {
+ std::lock_guard<std::recursive_mutex> guard(
+ GetAllocationModuleCollectionMutex());
+ for (Module *mod : GetModuleCollection())
+ if (mod->GetID() == uid)
+ return mod;
+ return nullptr;
+}
+
----------------
labath wrote:
I'd probably put this function into the Target class. It will not need to iterate through that many modules and it avoids accidentally pulling in an unrelated module.
https://github.com/llvm/llvm-project/pull/148877
More information about the lldb-commits
mailing list