2

My build directory contains .gcno and .gcda files. When I open the directory with CoverStory, everything shows up fine.

My ultimate goal is to read the gcov output (.gcno and .gcda files), but these two file types are in binary format. Is there a way to read them via Terminal so that I can save the text equivalent to a text file?

Thanks!

titusmagnus
  • 2,014
  • 3
  • 23
  • 23
  • My question is similar, but more along the lines as if anyone knew where the spec on the gcda/gcno format was located? – Hazok Jun 23 '12 at 04:52

4 Answers4

3

There is no trivial way to convert these files to an ASCII form. The specification of the file format can be found here, if you are interested:

http://src.gnu-darwin.org/src/contrib/gcc/gcov-io.h.html

The gcov program can show you a processed version of these files (in the form of a coverage analysis of a source file).

rjpower
  • 463
  • 4
  • 13
2

Try this:

gcov -dump ***.gcno ;  gcov -dump ***.gcda


gcov: LLVM code coverage tool

USAGE: gcov [options] SOURCEFILE

-dump:- Dump the gcov file to stderr

for more detail message,use gcov -help

xuezhulian
  • 21
  • 2
0

I know this is old post but if you are looking for html ouput, look at zekel's response at

XCode - Code Coverage?

You will have to install lcov on you mac for this. Here is how you can install lcov.

  1. Download lcov-1.10.tar.gz from sourceforge
  2. Un archive by double clicking it.
  3. edit install.sh in bin dir in extracted folder, Go to line 34 (install -D $SOURCE $TARGET) and remove the -D switch
  4. sudo make install
Community
  • 1
  • 1
dev
  • 2,180
  • 2
  • 30
  • 46
0

When using the GCC compiler, use -fdump-rtl-all -fdump-tree-all -fdump-ipa-all to see some information in textual format. You will see some files with names terminating with .profile_estimate

Also you should be able to see how the compiler uses the profiles. The catch here is that dump files are numerous.

Cherry Vanc
  • 781
  • 1
  • 4
  • 19