[Dwarf-discuss] Bug / Corrections for DWARF-6 Draft (example for properties / differences to issue in tracker)

Martin dwarf@mfriebe.de
Wed Sep 30 14:59:13 GMT 2026


(This is a resend, I did sent this in April, but didn't get any 
response, and the issue is still present)


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-20260920-2248.pdf
D.19 Property Example
Page 415

The following example code


> ! Indexed property
> !
> private
> function GetValue ( x : word ; AIndex : Integer ) : char ;
> public
> property Indexed [ x : word ]: char index 1 read GetValue ;

Is represented by the given DWARF example (page 416/417)

 >     !
 >     ! 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)

- The Getter refers to the Entry for the function GetValue
- The function GetValue has the default parameter

The formal parameters (for the default value) must be in the 
DW_TAG_property_getter not in the DW_TAG_Subprogram.

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.

----------------------------------------------------------

Also in the same example, page 416
   DW_AT_name("PropFromMethods")
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