This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcov on gdb


I have run gcov on a testsuite run of gdb on my laptop (stock RHL 7.2).
It is really easy, in case somebody wants to try, you just need to compile
gdb like this:

make CFLAGS='-O0 -fprofile-arcs -ftest-coverage'

then, after the run, you'll notice all these *.bb, *.bbg, *.da files
in your objdir.  For each source file, then you can say 'gcov blah.c'
and this will produce the actually interesting data, in the form of a
copy of the source file (with a .gcov extension) with each line
annotated with the number of times it was executed, or with '###' if
it was never run.

For instance:
[ezannoni@localhost gdb]$ gcov stabsread.c
 52.76% of 2280 source lines executed in file /home/ezannoni/sources/src/gdb/stabsread.c
Creating stabsread.c.gcov.

In doing so, I've noticed that a lot of lines in the stabread.c file
are never executed because they are old functions (1996) to support
cfront.  I think we could obsolete this stuff.  I've not found anything
in a google search for cfront that was more recent than 1995.

Anyway, I think the gcov data is too bulky to post. But it could be a good
way to spot stuff that is old, or stuff that is untested.
Don't know of a script that can convert the gcov into html so that it is web browsable?

Anyway, what about putting it on the ftp server?

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]