Currently the debugger can not show properties (even though it can call functions).
DWARF does not know properties, but custom tags can be added. Joost started this in the branch fork-gl/joost/dwarfproperties https://gitlab.com/freepascal.org/fpc/source/-/tree/joost/dwarfproperties
Rebased at
https://gitlab.com/martin_frb/fpc-src/-/commits/joost-dwarfproperties I started on reading that info:
https://gitlab.com/martin_frb/lazarus/-/commits/fpdebug-godwarfproperties
See bottom of the mail for Joost's original explanation. ------------------------------------
Unfortunately I can't reach Joost.
And I really want that to be in 3.4 (whenever that will be).
Yet there are some issues (I am still testing, just what I found so far)
*** Issue 1)
Sometimes nhe references to the function/member are wrong. I reproduced with a small test (attached) -gw3 -godwarfproperties
In unit 1, all location for the getters are correct. getter PropGetter at: 0x13c5
getter PropGetter2 at: 0x142f (0x6a bytes higher)
In dwarf_prop_test.lpr the first property has the correct location for the getter.
But then the next property does not.
getter PropGetter at: 0x04b8
getter PropGetter2 at: 0x0522 (wrong, but also 0x6a bytes higher)
The actual GetPropGetter2 is at 4dd (only 0x25 bytes higher)
So somehow a value from the other unit was used? Or maybe this is because the address (low_pc) was omitted in the getter before, but the size for it was still added to the offset for the next getter?
In unit1
<1><134e>: Abbrev Number: 4 (DW_TAG_class_type)
....
<2><1381>: Abbrev Number: 7 (Unknown TAG value: 4230) <1382> DW_AT_name : PropGetter <138d> Unknown AT value: 3230: <0x13c5> <2><1391>: Abbrev Number: 7 (Unknown TAG value: 4230) <1392> DW_AT_name : PropGetter2 <139e> Unknown AT value: 3230: <0x142f>
in dwarf_prop_test.lpr
<1><441>: Abbrev Number: 5 (DW_TAG_class_type)
...
<2><474>: Abbrev Number: 8 (Unknown TAG value: 4230) <475> DW_AT_name : PropGetter <480> Unknown AT value: 3230: <0x4b8>
<2><484>: Abbrev Number: 8 (Unknown TAG value: 4230) <485> DW_AT_name : PropGetter2 <491> Unknown AT value: 3230: <0x522>
...
<2><4b8>: Abbrev Number: 14 (DW_TAG_subprogram)
<4b9> DW_AT_name : GetPropGetter ...
<2><4dd>: Abbrev Number: 14 (DW_TAG_subprogram)
<4de> DW_AT_name : GetPropGetter2
*** Issue 2:
Nothing to do with Joosts code, but on Windows the entry pc for the methods aren't in the DWARF.
Well, the class is copied into each unit (on Linux there is a cross compile-units reference).
The copies are without entry_pc, but there is on pointer to were to find the original info (which may not be present, if that unit did not have debug info)
=============================================
