[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Don't overwrite DW_AT_object_pointer of definition with that of a declaration (PR #123089)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 16 01:30:03 PST 2025
================
@@ -377,7 +377,12 @@ ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(const DWARFDIE &die) {
break;
case DW_AT_object_pointer:
- object_pointer = form_value.Reference();
+ // GetAttributes follows DW_AT_specification.
+ // DW_TAG_subprogram definitions and declarations may both
+ // have a DW_AT_object_pointer. Don't overwrite the one
+ // we parsed for the definition with the one from the declaration.
----------------
labath wrote:
I can sort of see how that could make sense, though I'm not prepared to call it "more consistent". I'm also unsure how many other attributes could be argued into the list in this way, and I wouldn't want this list to get big.
If you want to go that way, then I think it's fine, though I think I'd prefer to change the iteration order (FWIW, llvm's `DWARFDie::findRecursively` visits the current element first before recursing, although it doesn't have a direct equivalent to our GetAttributes)
https://github.com/llvm/llvm-project/pull/123089
More information about the lldb-commits
mailing list