Issue 040308.1: Version Numbering
Jason Molenda
Ron Brender
Todd Allen
David Anderson
had a long email discussion titled
CFI parsing questions
and a clear outcome of that discussion was
a reminder that version numbering is difficult to find in the
document.
PROPOSAL:
Add a new appendix, informative,
Appendix F Version Numbering
Dwarf2 and dwarf 3 sections have a 'version number' embedded
so consumer code can tell what it is reading.
Version numbers are 2 byte unsigned integers.
This table shows what version numbers are in use for each section.
The version number changes where there is an 'incompatible change
in layout' so that a consumer can correctly determine the contents.
dwarf2: July 1993 public review document
dwarf3: Draft 8, Nov 2001
- means a version number is not applicable.
x means that section was not defined
(so a version number is not applicable)
dwarf2 dwarf3
ver ver
.debug_info 2 3
.debug_abbrev - -
.debug_frame 1 3
.debug_str - -
.debug_loc - -
.debug_line 2 3
.debug_aranges 2 2
.debug_ranges x -
.debug_pubtypes x 2
.debug_pubnames 2 2
.debug_macinfo - -
For .debug_frame, version 2 is unused.
Higher numbers are reserved for future use.
========================================================================
Revised text:
Version Numbering
Most Dwarf sections have a version number in the section header. This
version number is not tied to the Dwarf standard revision numbers, but
instead is incremented when incompatible changes to that section are made.
The Dwarf standard that a producer is generating to is not explicitly encoded
in the file. Version numbers in the section headers are represented as two
byte unsigned integers. This table shows what version numbers are in use
for each section.
There are sections with no version number encoded in them; they are only
accessed via the .debug_info section and so an incompatible change in
those sections' format would be represented by the .debug_info's version
number changing.
"dwarf2" is the July 1993 public review document. "dwarf3" is the DWARF 3
standard.
"-" means that a version number is not applicable (the section's header
does not include a version).
"x" means that the section was not defined in that version of the Dwarf
standard.
dwarf2 dwarf3
ver ver
.debug_info 2 3
.debug_abbrev - -
.debug_frame 1 3
.debug_str - -
.debug_loc - -
.debug_line 2 3
.debug_aranges 2 2
.debug_ranges x -
.debug_pubtypes x 2
.debug_pubnames 2 2
.debug_macinfo - -
For .debug_frame, version 2 is unused.
Higher numbers are reserved for future use.