Osman, Ahmed wrote:
> I'm facing a strange behavior from LCOV. Down you can find that LCOV is
> reporting that function div_iter has 0 hit but when you click on it( the
> bottom snapshot) you will find that the function has been hit many
There are some reasons why this might happen:
- the source code changed between tests
- the compiler was changed between tests
- gcc was used with optimization flags enabled (-Ox)
- the function was inlined
My suggestion would be to turn of optimization. If that doesn't work,
you can try to run the gcov tool (see man pages) on the file in question
and see if gcov produces the same incorrect output. If that is the case,
you'll need to contact gcc development.
Alternatively, you can try out the latest experimental feature of lcov
which will derive function coverage data from line coverage data,
meaning that in your case, the function would have been marked as hit.
To try that, get the latest version of lcov from CVS [*] (all binaries)
and use the --derive-func-data switch while capturing data. Note that
this feature is still not fully tested and may contain bugs.
[*] see http://ltp.sf.net/coverage/lcov.php for instructions