gprof给出了矮人错误

时间:2014-01-06 05:42:27

标签: apache gcc debian gprof dwarf

我已经使用gcc选项

在不同的服务器上编译了我的apache2
-pg -DGPROF -g -DNO_USE_SIGACTION

我将这个apache2二进制文件复制到不同的服务器并执行一次并得到gmon.out

但是在使用命令创建分析文件时,

gprof /usr/sbin/apache2 /gmon.out > /tmp/apa.txt

我得到以下错误,

BFD: Dwarf Error: found dwarf version '4', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '715', this reader only handles version 2 and 3 information.
BFD: Dwarf Error: found dwarf version '59393', this reader only handles version 2 and 3 information.

大约100行类似的错误。 如何摆脱这种情况来生成gprof分析文件?

编译操作系统:

cat /etc/debian_version
6.0.7

gcc version 4.8.1 (crosstool-NG 1.19.0)

执行操作系统:

cat /etc/debian_version
6.0.8

1 个答案:

答案 0 :(得分:0)

你有一个较新版本的GCC,但听起来你有一个旧版本的gprof。

一个修复方法是构建和安装自己的gprof。这不太难。

另一个解决方法是使用“-gdwarf-3”重建,这将告诉GCC使用DWARF 3.