[Dwarf-Discuss] Inconsistency in DWARF length escape codes

Michael Eager eager@eagercon.com
Fri Jan 4 18:48:02 GMT 2008


Nick Clifton wrote:
> Hi Guys,
> 
>    There appears to be an inconsistency in the DWARF3 specification for the 
> range of values that can be used as escape codes in the initial 4-byte length 
> field of some headers:
> 
>    In section 7.2.2 (Initial Length Values) on page 120 of the DWARF3 spec 
> (published Dec 20, 2005 and downloaded from http://dwarfstd.org) it says:
> 
>      "In an initial length field, the values 0xfffffff0 through
>       0xffffffff are reserved by DWARF to indicate some form of
>       extension relative to DWARF Version 2; such values must
>       not be interpreted as a length field."
> 
> Note that the start value has seven 'f's and only one 0.  On the next page 
> however (Section 7.4 32-Bit and 64-Bit DWARF Formats) in item 1 it says:
> 
>      "In the 32-bit DWARF format, an initial length field (see
>       Section 7.2.2) is an unsigned 32-bit integer (which must
>       be less than 0xffffff00);"
> 
> This time the reserved value has six 'f's and two 0's.  This smaller value is 
> also referred to in Section 7.5.1, Section 7.19 and Section 7.20.
> 
> It would appear that Section 7.2.2 contains a typo and that the lower reserved 
> value ought to be 0xffffff00.   On the other hand is there really a need for 
> 256 escape codes ?  Maybe the other sections are wrong and their lower limits 
> should be changed to 0xfffffff0 ?
> 
> What do you think ?

I think that you found a typo.  The values should all be the same.
(It also points out that the DWARF standard should have only one place
where each value is defined.)

I don't recall the rationale for the range of reserved values.  But
I think that your question about whether 16 reserved values are adequate
is reasonable.  I don't see a need for more.

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




More information about the Dwarf-discuss mailing list