我有两个工作站,其中一个运行 Debian Wheezy 并且有 gcc 4.9.2
第二个运行 RHEL 5.5,gcc 版本为 4.8.2
当我使用相同的选项编译相同的代码时:
$gcc -O3 -DNDEBUG -g -o test test.c
我在 Debian 机器上获得了 gcc 4.9 的所有必要调试信息,但是在 RHEL 机器上 objdump 说:
$ objdump --debugging test test: file format elf64-x86-64 objdump: test: no recognized debugging information
我做错了什么?
最佳答案
环顾四周,这似乎是 objdump 中的一个已知错误或限制:
- https://bugzilla.redhat.com/show_bug.cgi?id=118383
- https://sourceware.org/bugzilla/show_bug.cgi?id=6483
- How can I tell if a library was compiled with -g?
建议的解决方法是使用 objdump -W
、readelf -w
或 gcc -gstabs
。
关于linux - gcc 4.8.2 没有可识别的调试信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31323343/