[Lldb-commits] [lldb] [lldb] Remove DWARFDebugInfo DIERef footguns (PR #92894)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu May 23 01:51:55 PDT 2024


================
@@ -195,17 +195,17 @@ void DebugNamesDWARFIndex::GetCompleteObjCClass(
     if (!ref)
       continue;
 
-    DWARFUnit *cu = m_debug_info.GetUnit(*ref);
-    if (!cu || !cu->Supports_DW_AT_APPLE_objc_complete_type()) {
-      incomplete_types.push_back(*ref);
-      continue;
-    }
-
-    DWARFDIE die = m_debug_info.GetDIE(*ref);
+    SymbolFileDWARF &dwarf = *llvm::cast<SymbolFileDWARF>(
+        m_module.GetSymbolFile()->GetBackingSymbolFile());
----------------
labath wrote:

I was going to say that these can't be null, because then we wouldn't exist (the index is created by the symbol file, which is created by the module), but then I realized that the SymbolFile of a module can change during its lifetime (it rarely does, but it can), which would wreak havoc here (and elsewhere). So I'm going to do something even better instead. Hang on..

https://github.com/llvm/llvm-project/pull/92894


More information about the lldb-commits mailing list