我想查看注释的源使用$ valgrind --tool=callgrind ./myProgram
其次$ kcachegrind
使用Ubuntu 12.04(和我有与使用Mac OSX $ qcachegrind
相同的问题)。kcachegrind:没有来源可用于以下功能
C++脚本myProgram.cpp
调用文件中的函数(通过#include "../include/myHeader.hpp"
等)。我编译myProgram.cpp
这样的:
g++ -g -o myProgram myProgram.o -l<some third party lib>
,我不关心观看注明出处为第三方库。
我想看到的是myHeader.hpp
和myProgram.cpp
中功能的注释源。
相反,我看到 kcachegrind的扁平型窗口的那个被调用的所有功能,包括功能myHeader.hpp
列表 - 这是伟大的。现在,kcachegrind报告从myHeader.hpp
的功能位置从myProgram
- 这是奇数。最后,当我选择平面型材窗,并请求查看源代码的任何功能,我会见了:
There is no source available for the following function
<name of the selected function>
This is because no debug information is present.
Recompile the source and redo the profile run.
The function is located in the ELF object:
<some location...>
我已经试过:
添加目录使用kcachegrind的GUI将
myHeader.hpp
保存到注释列表中。使用-O0删除编译器优化
提供一个独立的示例,可以复制,粘贴,编译并通过valgrind运行。我们不可能在''处检查''有什么问题。 –
你懂了!谢谢。 –