GDB Dwarf Error

调试时显示如下报错
This GDB was configured as "x86_64-redhat-linux-gnu"...Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /home/work/users/xushuda/video-middlepage-online/rank_run_time/new_recomm_online/bin/middlepage]

无法载入符号表
(gdb) bt

0 0x00007f3385a829cd in __nanosleep_nocancel () from /opt/compiler/gcc-4.8.2/lib/libc.so.6

1 0x00007f3385aac6f4 in usleep () from /opt/compiler/gcc-4.8.2/lib/libc.so.6

2 0x000000000087b337 in ?? ()

3 0x0000000001571944 in ?? ()

4 0x0000000000000000 in ?? ()

原因:
gdb使用dwarf的版本为2,而编译的gcc使用版本为4

解决办法:
1.升级gdb
2.编译的时候加入dwarf2的信息-gdwarf-2 -gstrict-dwarf

你可能感兴趣的:(GDB Dwarf Error)