================ @@ -129,8 +129,19 @@ void DebugNamesDWARFIndex::GetGlobalVariables( DWARFUnit &cu, llvm::function_ref<bool(DWARFDIE die)> callback) { uint64_t cu_offset = cu.GetOffset(); bool found_entry_for_cu = false; - for (const DebugNames::NameIndex &ni: *m_debug_names_up) { - for (DebugNames::NameTableEntry nte: ni) { + for (const DebugNames::NameIndex &ni : *m_debug_names_up) { + // Check if this name index contains an entry for the given CU. + bool cu_matches = false; + for (uint32_t i = 0; i < ni.getCUCount(); ++i) { + if (ni.getCUOffset(i) == cu_offset) { + cu_matches = true; + break; + } + } + if (!cu_matches) + continue; ---------------- bulbazord wrote:
It'd be great if we could use some kind of `find_if` instead of manually walking the CU Offsets. https://github.com/llvm/llvm-project/pull/70231 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits