DWARF DIEs are organized as a tree - the top level DW_TAG_compile_unit
for a single file will contain all of the type definitions (DW_TAG_class_type
for instance), all of the functions (DW_TAG_subprogram
), and global/static variables (DW_TAG_variable
). A class definition (DW_TAG_class_type
) will be a parent DIE and contain children like DW_TAG_member
for member variables or DW_TAG_subprogram
for methods.
The output you've appended is the way your particular DWARF dumper operates - it looks like it is using that number to show parent/child relationships. Is this readelf
? Other dwarf dumper programs may choose to show this in a different way. On Mac OS X, dwarfdump
shows this relationship with indentation - children DIEs are indented a little more than parent DIEs.
If you're looking at the DWARF spec on http://dwarfstd.org/ you won't find anything about this number in the standard -- but if you write a genuine DWARF parser (as opposed to a parser which is interpreting the output of readelf
or whatever), you'll see this topic covered in section 2.3 ("Relationship of Debugging Information Entries") and section 7.5.3 "Abbreviations Tables" (DW_CHILDREN_yes
or DW_CHILDREN_no
) in the DWARF4 spec.