Skip to content

Commit afe6ab7

Browse files
authored
[lldb][DebugNames] Only skip processing of DW_AT_declarations for class/union types (#94400)
This is a follow-up of #92328 (comment) Clang attaches `DW_AT_declaration` to static inline data members and `dsymutil` indexes these constants. Skipping these caused the expression evaluator to fail to find such constants when using DWARFv5. Fixes `TestConstStaticIntegralMember.py` on DWARFv5.
1 parent 679f75e commit afe6ab7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ bool DebugNamesDWARFIndex::ProcessEntry(
8787
return true;
8888
// Clang erroneously emits index entries for declaration DIEs in case when the
8989
// definition is in a type unit (llvm.org/pr77696). Weed those out.
90-
if (die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
90+
if (die.IsStructUnionOrClass() &&
91+
die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
9192
return true;
9293
return callback(die);
9394
}

0 commit comments

Comments
 (0)