[Dwarf-Discuss] DW_AT_accessibility default

Michael Eager eager@eagercon.com
Thu Jul 29 18:12:20 GMT 2010

Jakub Jelinek wrote:
> On Thu, Jul 29, 2010 at 01:07:44PM +0200, Jakub Jelinek wrote:
>> For DW_TAG_inheritance, DW_TAG_member and DW_TAG_subprogram
>> the standard says that if the DW_AT_accessibility attribute is missing,
>> private accessibility is assumed for class entries and public for
>> interfaces, structs or unions.
>> Does the same apply to all the other DIEs that may have DW_AT_accessibility
>> attribute?
>> What exactly is meant by in class?  DIEs that are immediate children
>> of DW_TAG_class_type (resp. DW_TAG_{structure,interface,union}_type)?
>> E.g. if
>> DW_TAG_class_type
>>   DW_TAG_structure_type
>>     ! DW_AT_accessibility is missing, does that imply DW_ACCESS_private
>>     ! here?
>> Should for DIE parents other than DW_TAG_{structure,interface,union,class}_type
>> DW_AT_accessibility be not considered meaningful?
> Also, the default for DW_AT_accessibility seems to be incompatible between
> DWARF2 and DWARF3+, as in DWARF2 for DW_TAG_inheritance the default was
> unconditionally DW_ACCESS_private (for other DIEs DWARF2 doesn't talk about
> any defaults).

I'd have to research the history of the change, but it seems to me that
this would be to reduce the size of the DWARF data, by eliminating an
otherwise unnecessary DW_ACCESS_public attribute on every struct or
union member.  Or possibly the change was to conform to existing practice.

Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

More information about the Dwarf-discuss mailing list