[Dwarf-Discuss] Doubts in DWARF spec 4

Ian Lance Taylor iant@google.com
Tue Nov 12 14:48:56 GMT 2013


On Mon, Nov 11, 2013 at 7:15 PM, Malu Sasi <malu.sasi at nestgroup.net> wrote:
>
> We are having some doubts while building elf's using new GCC (4.8.1) with DWARF-4. When we build elfs with "-gdwarf-4", and analyzed the parsed details using "readelf",
>
> 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?


When you use newer versions of GCC with newer versions of the GNU
binutils, GCC does not generate the DWARF line or frame information
directly.  Instead it adds pseudo-ops to the assembly code and the
assembler emits the actual debug info.  This is better because the
assembler has better information about exact PC values than the
compiler does.

The assembler currently always generates DWARF version 2 line number
information.  I don't know of any problems that might cause, but I am
not an expert.


> ***** Confidentiality Statement/Disclaimer *****
>
> This message and any attachments is intended for the sole use of the intended recipient. It may contain confidential information. Any unauthorized use, dissemination or modification is strictly prohibited. If you are not the intended recipient, please notify the sender immediately then delete it from all your systems, and do not copy, use or print. Internet communications are not secure and it is the responsibility of the recipient to make sure that it is virus/malicious code exempt.
> The company/sender cannot be responsible for any unauthorized alterations or modifications made to the contents. If you require any form of confirmation of the contents, please contact the company/sender. The company/sender is not liable for any errors or omissions in the content of this message.

Speaking as someone who maintains various public e-mail lists (though
not dwarf-discuss), please do not add this kind of threatening
disclaimer to e-mail messages sent to public mailing lists.  If your
company requires the disclaimer, please consider sending your e-mail
messages from a webmail account.  Thanks.

Ian




More information about the Dwarf-discuss mailing list