[Dwarf-discuss] Bug / Corrections for DWARF-6 Draft (example for properties / differences to issue in tracker)
Martin
lists@mfriebe.de
Fri Oct 2 09:32:52 GMT 2026
On 02/10/2026 02:27, Cary Coutant via Dwarf-discuss wrote:
>
>
> On Thu, Oct 1, 2026 at 12:52 AM Martin via Dwarf-discuss <dwarf-
> discuss@lists.dwarfstd.org <mailto:dwarf-discuss@lists.dwarfstd.org>> wrote:
>
> formal-param are direct child entities of DW_TAG_property_getter
>
>
> I think what you're saying is that the three formal parameters (with the
> default value on the third) should be moved from the DW_TAG_subprogram
> "GetValue" to the DW_TAG_property_getter.
>
> Should the DW_TAG_subprogram "GetValue" also have those formal
> parameters (but without the default_value)? I'm not sure if those were
> assumed to lie under the ellipsis in the example in the original issue,
> or if they're supposed to be omitted.
>
Yes, they should be moved
- DW_TAG_property_getter =>
- If any defaults are needed then this has DW_TAG_formal_parameter
- Those DW_TAG_formal_parameter may have the DW_AT_default_value
- DW_TAG_subprogram also has DW_TAG_formal_parameter
- But without DW_TAG_formal_parameter
The DW_TAG_subprogram is the normal (as has always been) representation
of the member function.
- As the member function does not have any defaults, then
DW_TAG_subprogram also does not have DW_AT_default_value.
- But the DW_TAG_subprogram has the DW_TAG_formal_parameter.
- The DW_TAG_subprogram does exist exactly as it would have without the
DW_TAG_property
This is correctly described in
""" QUOTE 6.19 Property Entries BEGIN
A property may have one or several of DW_TAG_property_getter,
DW_TAG_property_setter, or DW_TAG_property_stored children to represent
the getter and setter (member) functions, or underlying storage. A
DW_TAG_property_stored child describes the Pascal-style stored accessor
for a property.
Each of these tags have a DW_AT_property_forward attribute to refer to a
(member) function declaration or a data member.
If they refer to a function, they may also have DW_TAG_formal_parameter
children (matching the ones in the function)
""" QUOTE 6.19 Property Entries END
Last paragraph "if they refer": "they" = one of DW_TAG_property_getter,
DW_TAG_property_setter, ...
> But in dwarf6-20260920-2248.pdf
> D.19 Property Example
> Page 415
> ...
> > !
> > ! 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
>
>
> I'm assuming you're pointing out that these are mistakes, not what it
> should be, right?
>
yes, I pointed out the mistakes.
All included example codes are copies of the mistakes found in the draft.
More information about the Dwarf-discuss
mailing list