我想在Linux(Ubuntu)上使用gcov来查看每行源代码的执行频率。gcov没有显示任何覆盖率数据
我加入以下标志我的gcc编译器和连接器选项,
CCFLAGS = -fprofile-arcs -ftest-coverage
LDFLAGS = -fprofile-arcs -lgcov
但在编译和运行该程序后,我看到创建任何* .gcda文件。其结果是,当我运行
gcov --object-directory <path to the *.gcno/*.gcda files> myfile.cpp
显示错误:
myfile.gcda:cannot open data file, assuming not executed
File '../../../../../code/myfile.cpp'
Lines executed:0.00% of 2625
我失去了一些东西。如何解决这个问题?
的可用列表中没有程序运行成功完成是ATLEAST? –
另外,当你运行'strings compiled_prog | grep gcda'? –
@Shawn - 它不返回的服务/守护进程。所以基本上我必须CTRL-C终端中的可执行文件来阻止它。这会影响gcov的行为吗?我知道gprof不会为不退出()的进程生成分析数据。 gcov是否也有这个限制。 – goldenmean