On Tue, Oct 11, 2005 at 06:01:07PM +0100, Nathan Sidwell wrote:
> Astroman (sent by Nabble.com) wrote:
> >  I am working on a piece of software that never exits and I am trying to 
> >  use -fprofile-arcs and gcov to gather coverage data on it.
> >The code looks like this:
> >int main(){
> >   while(1){
> >      foo();
> >      nanosleep(50);
> >    }
> >}
> >  This is a child process that as you can see will never exit on its own 
> >  so eventually it is just signal killed by the parent process.  This code 
> >  could be changed to exit properly but that is not an option in this 
> >  case.  I am compiling the code with -fprofile-arcs and -ftest-coverage 
> >  and I am able to obtain accurate coverage data for all the files in the 
> >  project that exit normally.  Is there any way to collect the .da file 
> >  data before exit?  Is it temporarily stored anywhere or could I alter 
> >  the gcc library to store this information more often?
> 
> call __gcov_flush

It seems you could just invoke that function from gdb, and not change
the program at all, right?

Reply via email to