[Dwarf-discuss] "null entry"

David Anderson davea
Mon May 23 16:40:36 GMT 2005


>On Mon, May 23, 2005 at 04:05:12PM -0400, Bishop, John E wrote:
>> I'll agree with the poster who said it was a pain to 
>> have zero not work as a null sibling pointer.  But there's
>> a work-around:
>> 
>> Since the value of SW_AT_sibling is a reference, and a
>> reference is an offset from a .debug_info section (this one
>> or a remote one), zero would normally mean "the first DIE".
>> So producers could issue a null DIE as the very first DIE,
>> and then zero works!  (or have I misunderstood something?)
>
>Won't a DIE offset of zero give you the compilation unit header?

Exactly right.  The only time one might expect to see
an offset of zero for a DIE is pre-relocation of something
with an as-yet-unknown final value (and a relocation record).

The length of a CU header is always > 10+ bytes, so the minimum
post-relocation DIE offset into the .debug_info section is > 10. 

David Anderson




More information about the Dwarf-discuss mailing list