Re: Question about the coverage statistics of Gcov

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 2, 2021 at 1:50 AM heng zhang via Gcc-help <gcc-help@xxxxxxxxxxx>
wrote:

> Why is the executed time of the 8th line performed 1* and what does the
> symbol ‘*' means?  According to the explanation of the official web,
> executed basic blocks having a statement with zero execution_count end with
> ‘*’ character. For this case, there is not any unexecuted statement in for
> loop. When the 11th line is pruned, the executed time of the 8th line is
> only 1. so is it a bug?


The line
 12        1*:    8:     for(int i=0;i<2;i++)
is effectively more than one piece of code.  One of those pieces of code
wasn't executed.  If you put a newline after every ; and rerun gcov, the
results may make more sense.  But exactly attributing counts for some
complex statements like a for loop header is tricky, so it may always be a
little misleading.  Better is to just use the counts of the statements
inside the block and not worry about the for loop header.

Jim




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux