DWARF Standard


050616.1 Ron Brender Null entries and null sibling references Clarification Closed Ron Brender


The DW_AT_sibling attribute does not allow a means to indicate
the end of a sequence of siblings other than to reference a null
entry DIE that is arbitrarily later in the DWARF description. It
is not even sufficient to point to any arbitrary null entry that
may be available; the attribute must point to the one and only
null entry that terminates the list on which the DIE is linked.

OTOH, it is valid to terminate a list linked by sibling
attributes using a DIE that lacks a sibling attribute all
together. This has the disadvantage that it requires
definition/use of an abbreviation code/description that might
otherwise not be needed. Because this is valid, a consumer must be
prepared to parse the DIE tree with or without sibling pointers
on some or all DIEs.

Thus, the requirement that the last sibling attribute on a list
must refer to the null entry *of that same list* is a burden for
a producer but provides no advantage to a consumer.


Allow the DW_AT_sibling attribute to have the reference value 0
to indicate there is no successor. Note that the value 0 is not
currently valid in any case, because it "refers" to the beginning
of the .debug_info section and not to any DIE at all.

To achieve this, add the following to the end of the last
paragraph in Section 2.3:

        "A value of 0 (which otherwise does not refer to any
	DIE) may be used to indicate that there is no successor

Related editorial changes include the following:

  - Add index entries for the phrase "null entry", which is used
    in Sections 2.3, 7.5.2 and 7.5.3.

  - Reword the second paragraph of bullet 4 in Section 4.1 to avoid
    the phrase "null entry" which is claimed to be described in
    Section 2.5 but is not. I suggest replace

	"...if no location attribute is present, or if the location
	attribute is present but describes a null entry (as described
	in Section 2.5), the variable is..."


	"...if no location attribute is present, or if the value
	of the location attribute is a zero length location expression
	(see Section 2.5.2) or designates a location list consisting
	solely of an end of list entry (see Section 2.5.4), the
	variable is..."


The original submitter of this issue have found a way to generate
the null entry and no longer feel this is needed. 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2017 by DWARF Standards Committee.