[Lldb-commits] [lldb] Reapply [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (PR #92328)

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 3 20:49:49 PDT 2024


ZequanWu wrote:

> You can repro this by running ./bin/lldb-dotest -p TestConstStaticIntegralMember.py --dwarf-version 5
>
> Could you take a look @ZequanWu ?

It should be fixed by the following. We just need to skip the declaration DIEs that are struct/class/union. This failure you see is caused by skipping a declaration `DW_TAG_variable`. 
```
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 56717bab1ecd..6330470b970e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -87,7 +87,8 @@ bool DebugNamesDWARFIndex::ProcessEntry(
     return true;
   // Clang erroneously emits index entries for declaration DIEs in case when the
   // definition is in a type unit (llvm.org/pr77696). Weed those out.
-  if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
+  if (die.IsStructUnionOrClass() &&
+      die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
     return true;
   return callback(die);
 }
```

Can you (or anyone with commit access) commit above fix for me? I somehow cannot pull/push from git.

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


More information about the lldb-commits mailing list