DWARF Standard


200716.1 David Blaikie debug_macro header is missing a length prefix Enhancement Open David Blaikie

Section 6.3.1, pg 166

Most DWARF section contributions now start with a length (with the usual 
DWARF32/DWARF64 encoding dance) followed by a version.

This feature makes it easy for consumers to skip over portions of the DWARF 
they do not understand - as long as the length can be read, even if the 
version is unknown (too new, for instance) the length can be used to skip 
over the contents.

debug_macro starts with a version instead of a length, which makes this 
technique not possible.

To change the format would require changing the section name (since there 
would be no way to know that a length must be read first, instead of a 
version). If it's not worth changing the section name again - perhaps in 
the next version of DWARF it could say "version then length" and we 
promise to never change that - then a consumer can check the version is 
>= 6, and then read the length unconditionally (even if it's a version it 
doesn't otherwise recognize) and skip the contents. Not perfect, but might 
be worth doing if/when the version is reving anyway.

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