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

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Fri May 10 12:56:17 PDT 2024


ZequanWu wrote:

> The issue might arise from having a .debug_names table that has DW_IDX_parent entries that means that there might be forward declarations included in the DWARF index.

Do you mean that the searching in the type index returns a declaration DIE (but I expected it to always return a definition DIE if exists: https://github.com/llvm/llvm-project/blob/91feb130d5cd3cafce94bbaf7ad67d1542623a75/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp#L3135)?  If that's the case, we get a type created from declaration DIE `SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext`, which makes it falls through the check. 

A quick fix I have in mind is to do a double-check if the dwarf_die is a declaration or not before: https://github.com/llvm/llvm-project/blob/d8e73752a5f4f79ef4293d8f446c03062010233d/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp#L1659-L1661, so we won't complete it. But if there truly exists a definition DIE, it will never be completed because it relies on index to find definition DIE.

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


More information about the lldb-commits mailing list