[Dwarf-discuss] Additional values for DW_AT_accessibility

Cary Coutant ccoutant@gmail.com
Fri Sep 25 00:18:46 GMT 2026


>
> Currently there are the values
> DW_ACCESS_public DW_ACCESS_private DW_ACCESS_protected
>
> FreePascal has more (list at the end of mail)
> Could those please be added?
>
> https://www.freepascal.org/docs-html/ref/refse35.html
> > Private
> >   All fields and methods that are in a private block, can only be
> > accessed in the module (i. e. unit) that contains the class definition.
> >   They can be accessed from     inside the classes’ methods or from
> > outside them (e. g. from other classes’ methods)
> > Strict Private
> >   All fields and methods that are in a strict private block, can only
> > be accessed from methods of the class itself. Other classes or
> > descendent classes (even in the   same unit) cannot access strict
> > private members.
> > Protected
> >   Is the same as Private, except that the members of a Protected
> > section are also accessible to descendent types, even if they are
> > implemented in other   modules.
> > Strict Protected
> >   Is the same as Protected, except that the members of a
> > Protected section are also accessible to other classes implemented in
> > the same unit. Strict protected   members are only visible to
> > descendent classes, not to other classes in the same unit.
> > Public
> >   sections are always accessible.
> > Published
> >   From a language perspective, this is the same as a Public section,
> > but the compiler generates also type information that is needed for
> > automatic streaming of   these classes if the compiler is in the {$M+}
> > state. Fields defined in a published section must be of class type.
> > Array properties cannot be in a published section.
>

>From these descriptions, it looks to me like "strict private" and "strict
protected" better match the existing meaning of DW_ACCESS_private and
DW_ACCESS_protected, respectively (i.e., access is restricted to members of
the class rather than the whole module, which is more like what these
attributes mean for C++ code). If I'm understanding that correctly, would
it be more accurate to add new enumerators for Pascal's plain "private" and
"protected" attributes? Say, DW_ACCESS_module_private and
DW_ACCESS_module_protected?

I don't see a need to represent "published" as distinct from "public".

While we're at it, I see the need to add more descriptive text in the spec
to make these accessibility attributes more broadly applicable across
languages.

-cary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dwarfstd.org/pipermail/dwarf-discuss/attachments/20260924/344f9b0d/attachment.htm>


More information about the Dwarf-discuss mailing list