[Lldb-commits] [lldb] [lldb][DebugNames] Only skip processing of DW_AT_declarations for class/union types (PR #94400)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 4 13:57:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Michael Buch (Michael137)
<details>
<summary>Changes</summary>
This is a follow-up of https://github.com/llvm/llvm-project/pull/92328#issuecomment-2145849441
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/94400.diff
1 Files Affected:
- (modified) lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp (+2-1)
``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 56717bab1ecd8..6330470b970e7 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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/94400
More information about the lldb-commits
mailing list