Issue 120973
Summary [DebugInfo] DW_AT_object_pointer not attached to method declarations
Labels new issue
Assignees
Reporter Michael137
    [DWARF's `DW_AT_object_pointer`](https://dwarfstd.org/issues/050711.2.html) indicates which `DW_TAG_formal_parameter` corresponds to the function object that the method is being called on.

One motivator for this attribute from the original proposal is that it can be used to determine whether a C++ method is static or not. LLDB does need to distinguish static vs. non-static methods, but can't rely on `DW_AT_object_pointer` at the moment because Clang does not emit it on the declaration DIE (only on the definition). GCC emits it on both. See https://godbolt.org/z/3TWjTfWon

So LLDB currently relies on the existence of a `DW_TAG_formal_parameter` called `this` which is a pointer type. With C++23, we can't rely on either of these being true because of the `deducing this` feature: https://godbolt.org/z/h4jeT54G5 (though there's a bug in both Clang and GCC here where we don't emit the `DW_AT_object_pointer` for an explicit object parameter, will raise a separate issue for it)

This issue proposes adding the `DW_AT_object_pointer` to declarations too.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to