DwarfError: wrongversionincompilationunitheader (is4,

Source: Internet
Author: User
Problem description: The following error occurs when gdb is started in gcc4.9 and gdb7.0: DwarfError: wrongversionincompilationunitheader (is4, shouldbe2) [inmoduledawnfsusers: The main cause of this error is that the debugging information generated by gcc4.9 is dawnfs4, while gdb7.0 supports dawnfs2.

Problem description: The following Error occurs when gdb is started in gcc4.9 and gdb7.0: Dwarf Error: wrong version in compilation unit header (is 4, shocould be 2) [in module/dawnfs/users/the cause of this error is that the debugging information generated by gcc4.9 is dawnfs4, while gdb7.0 supports dawnfs2.

Problem description:In gcc4.9 and gdb7.0, the following Error occurs when gdb is started: Dwarf Error: wrong version in compilation unit header (is 4, shocould be 2) [in module/dawnfs/users/the cause of this error is that the debugging information generated by gcc4.9 is dawnfs4, while gdb7.0 supports dawnfs2.


Solution:This problem is actually a problem with the compiling environment. You can change the gcc and gdb versions, and you need to find the appropriate version. Of course, you can also add compilation parameters for gcc to generate dawnfs2 debugging information, the main parameter is-gdwarf-2-gstrict-dwarf, the approach is as follows:

Add alias gcc = 'gcc-gdwarf-2-gstrict-dwarf' to. bashrc and restart the terminal to make it take effect.

In this way, gdb can be used without the above errors.


Refer to gcc documentation: https://gcc.gnu.org/gcc-4.5/changes.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.