[Dwarf-Discuss] Doubts in DWARF spec 4

Cary Coutant ccoutant at google.com
Tue Nov 12 10:54:20 PST 2013

> 1. It was seen that the ".debug_line" section always shows the version as "2". But from Appendix F of DWARF 4 spec(page 289, figure 97), we expect it to be "4". Can anyone please clarify why version number of ".debug_line" section is "2" instead of "4". Is it that we need to manually add some other option while building elf?

As Ian explained, the Gnu assembler still generates version 2 of the
line number table. DWARF-4 introduced some new features that changed
the format of the line number table header, but the Gnu toolchain does
not yet need those new features, and has not been updated to generate
the new format. (It has been discussed, but there are no current plans
to update it.)

DWARF consumers should, in general, support old versions of all the
tables (going back to DWARF-2, but not DWARF-1).

> 2. Also, the new section ".debug_types"  was not there, when the elf was built with option "-fdebug-types-section".  We were using a simple CPP program without any structures/enum etc in it. Could this be the reason?

That is likely. GCC generates .debug_types sections for some types
(e.g., structs, classes, unions), but not for others (e.g., base


More information about the Dwarf-Discuss mailing list