Re: Question about the coverage statistics of Gcov

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

 




> 在 2021年4月8日,上午4:35,Jim Wilson <jimw@xxxxxxxxxx> 写道:
> 
> On Tue, Apr 6, 2021 at 8:34 AM heng zhang <byone.heng@xxxxxxxxx <mailto:byone.heng@xxxxxxxxx>> wrote:
> As you said, the 8th line has some unexecuted parts, i.e., “ i++ ” so why is not the execution time of the 8th line 1*?
> 
> The process of mapping source lines to object file basic blocks and back again is very complicated, depends on compiler optimizations and the source code, and we don't always do a perfect job of it.  The gcov output should always be considered reasonable estimates.  If you want better answers, try lowering the optimization level, or adding more newlines to your code so you have fewer statements on each source line.
 
Actually, I am testing the latest gcov and want to confirm whether this situation is a bug. I don't optimize my program(-O0) when compiling it. The gcov output makes me confused. So Don't you think it is a bug? It is a feature?



[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