iPhone:无法获得模拟器来生成.gcda分析数据文件 [英] iPhone: Cannot get simulator to generate .gcda profiling data files

查看:133
本文介绍了iPhone:无法获得模拟器来生成.gcda分析数据文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用iPhone模拟器来分析我的代码.我已启用 Generate Test Coverage File (生成测试覆盖文件)和 Instrument Program Flow (仪器程序流),并将 -lgcov 添加到了链接器标志.根据我读到的所有内容,这应该是我在设置时需要做的所有事情.

I'm attempting to profile my code using the iPhone simulator. I've enabled Generate Test Coverage File and Instrument Program Flow and added -lgcov to the linker flags. According to everything I've read that should be all I need to do in terms of setup.

更新:生成测试覆盖率文件触发 -ftest-coverage 标志,仪器程序流触发 -fprofile-arcs 标志.我检查了构建日志,并在编译时进行了设置.

Update: Generate Test Coverage File triggers the -ftest-coverage flag and Instrument Program Flow triggers the -fprofile-arcs flag. I've checked the build logs and they are being set when compiling.

执行程序,我可以看到 .gcno 文件出现在build/.build/Debug中的 .o 编译代码的旁边. -iphonesimulator/.build/Objects-normal/i386目录.

Executing the program I can see the .gcno files appearing along side the .o compiled code in the build/.build/Debug-iphonesimulator/.build/Objects-normal/i386 directory.

但是当我在模拟器中运行该应用程序时,没有出现任何 *.gcda 文件.

But when I run the app in the simulator I do not get any *.gcda files appearing.

我的理解是,这些文件包含来自检测的数据.但是我无法在计算机上的任何地方找到它们.

My understanding is that these files contain the data from the instrumentation. But I cannot find them anywhere on the computer.

我知道它们可以生成并与 *.gcno 文件一起出现,因为我有一个包含它们的旧垃圾目录.我只是不知道该怎么办才能使它们出现并记录运行.

I know they can be produced and appear along side the *.gcno files because I have an old trashed buil directory which does have them. I just cannot figure out what I have to do to get them to appear and record the run.

任何帮助表示赞赏.

推荐答案

我希望这个链接会给您一些想法.探索我找到的链接

I hope this link would give you some idea. Exploring the link I found

.gcno文件是在 源文件是使用GCC编译的 -ftest-coverage选项.它包含重建基本信息的信息 框图并分配源线 数字到块.

The .gcno file is generated when the source file is compiled with the GCC -ftest-coverage option. It contains information to reconstruct the basic block graphs and assign source line numbers to blocks.

.gcda文件在以下情况下生成 包含目标文件的程序 使用GCC -fprofile-arcs选项是 被执行.一个单独的.gcda文件是 为每个编译的目标文件创建 使用此选项.它包含弧 转换计数,以及一些摘要 信息.

The .gcda file is generated when a program containing object files built with the GCC -fprofile-arcs option is executed. A separate .gcda file is created for each object file compiled with this option. It contains arc transition counts, and some summary information.

所以可能您正在使用一些错误的设置进行构建.该信息在 http://gcc中提到.gnu.org/onlinedocs/gcc/Gcov-Data-Files.html#Gcov-Data-Files

So may be you are building with some wrong settings. The information is mentioned on http://gcc.gnu.org/onlinedocs/gcc/Gcov-Data-Files.html#Gcov-Data-Files

这篇关于iPhone:无法获得模拟器来生成.gcda分析数据文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆