Test Coverage not on whole execution (gcov)
Fabien Baron
fabien.baron@gmail.com
Wed May 7 08:05:00 GMT 2008
Thank you for your answer.
But I want to know if it is possible to start the program, to break it
and set a flag (or something like that) to start coverage counter.
Then resume the execution to have a coverage count.
The aim of that is to count the number of line executed when one
special action is done in my software !
Best Regards,
Fabien
2008/5/1, Ben Elliston <bje@au1.ibm.com>:
> On Wed, 2008-04-30 at 11:01 +0200, Fabien Baron wrote:
>
> > I'm working on a big project in C code, and I want to profile it so I
> > used gcc with the options -ftest-coverage and -fprofile-arcs, and gcov
> > to analyze the results. It works very well but on the whole project
> > and the whole execution !!
> > My question is :
> > Is it possible to start and stop profiling/coverage during the program
> > execution ? If it is how I can do that ?
>
> You should not need to compile every object file in the project with
> those options. Just compile the ones you want to generate coverage data
> for (of course you will need those options to link).
>
> By the way, you really should use --coverage to preserve your
> sanity. ;-)
>
> Cheers, Ben
>
>
More information about the Gcc
mailing list