[Dwarf-discuss] Possible mistakes in DWARF-6 Draft for properties (differences to issue in tracker)
Martin
dwarf@mfriebe.de
Tue Apr 28 20:42:01 GMT 2026
The issue for the property addition:
https://dwarfstd.org/issues/240507.1.html
> DW_TAG_property
> DW_AT_name "Indexed"
>
> DW_TAG_property_getter
> DW_AT_property_forward <ref to GetValue>
>
> DW_TAG_formal_parameter ; _this (no default specified, details inherited from GetValue
> DW_TAG_formal_parameter ; x (no default specified)
> DW_TAG_formal_parameter
> DW_AT_default_value <DW_OP_lit 1> ; property index
formal-param are direct child entities of DW_TAG_property_getter
But in dwarf6-20260411-0357.pdf
D.19 Property Example
Page 405
> ! Indexed property
> !
> private
> function GetValue ( x : word ; AIndex : Integer ) : char ;
> public
> property Indexed [ x : word ]: char index 1 read GetValue ;
Is give as follows.
But the formal parameters (for the default value) must be in the
DW_TAG_property_getter.
The "function GetValue" (if called/used without the property) does not
have a default value.
Only when called by/via the property does the default value exist (from
the specified "index 1" in the property declaration.
(Of course the subprogram needs param declarations. But without default)
> !
> ! Indexed property
> !
> DW_TAG_subprogram ! function GetValue
> DW_AT_accessibility(DW_ACCESS_private)
> DW_AT_name("GetValue") ! (x: word; AIndex: Integer): char;
> DW_AT_type(ref to char)
> DW_TAG_formal_parameter ! implicit _this
> DW_TAG_formal_parameter ! x (no default specified)
> DW_TAG_formal_parameter ! AIndex
> DW_AT_default_value !
> DW_OP_lit1 ! default index =1
> ...
> DW_TAG_property ! property Indexed[x: word]: char index 1
> DW_AT_accessibility(DW_ACCESS_public)
> DW_AT_name("Indexed")
> DW_TAG_property_getter ! read GetValue;
> DW_AT_property_forward(ref to GetValue)
Also in the same example, just a bit above
- DW_AT_name is to little indented
> DW_TAG_property ! property PropFromMethods: integer
> DW_AT_accessibility(DW_ACCESS_public)
> DW_AT_name("PropFromMethods")
> DW_TAG_property_getter ! read GetProp
> DW_AT_property_forward(ref to GetProp)
> DW_TAG_property_setter ! write SetProp;
> DW_AT_property_forward(ref to SetProp)
More information about the Dwarf-discuss
mailing list