[llvm] [DebugInfo] Add DW_AT_artificial for compiler generated static member. (PR #115851)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 03:44:27 PST 2024


CarlosAlbertoEnciso wrote:

We want to allow our (SCE) debugger to have a direct access to the whole vtable, thru a static data member `_vtable$`.
```
.debug_info contents:
...
DW_TAG_variable
  DW_AT_specification	("_vtable$")
  DW_AT_location	(DW_OP_addrx 0x0)     --> index (0) in the '.debug_addr'
  DW_AT_linkage_name	("_ZTVN7MyClassE")
...
DW_TAG_structure_type
  DW_AT_name	("MyClass")
  ...
  DW_TAG_variable
    DW_AT_name	("_vtable$")
    DW_AT_type	(0x000000d7 "void *")
    DW_AT_artificial	(true)
    ...

.debug_addr contents:
...
Addrs: [
 Address of vtable for MyClass
...
]
```
We need for the generated static data member to be `artificial`.

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


More information about the llvm-commits mailing list