Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » gcov shows red even though debugger is reaching this particular statement(gcov shows red even though debugger is reaching this particular statement)
gcov shows red even though debugger is reaching this particular statement [message #1701866] Thu, 16 July 2015 06:14 Go to next message
Eclipse UserFriend
Hi,

My Eclipse IDE contains Eclipse Kepler version, MinGW compiler, binutils-2.25, GDB.

If you see the screenshot1, gcov hits are 0 at line no. 634, but line 636 has 16 hits.
Line 636 can have "n" no. of hits only when line 634 is executed.
index.php/fa/22535/0/

As a proof you see in the Screenshot2 that line 32 is been called 16 times only from the function that is showing a red line at 634.
index.php/fa/22536/0/

Is it bug in gcov?
If not how to interpret this red line?

I came across a case, where one of the statement in my C code was red and debugger was not able to reach, which a developer can come to conclusion that
there something logically wrong with the code.

But in this case where Debugger is able to reach this line 634 but still shown red by gcov tool, how to interpret this? As a proof Screenshot3 is been attached.
index.php/fa/22537/0/

Any help would be greatly appreciable!

Regards,
Rashmi Thimmaiah



Re: gcov shows red even though debugger is reaching this particular statement [message #1701992 is a reply to message #1701866] Fri, 17 July 2015 05:57 Go to previous message
Eclipse UserFriend
Hello,

please check the Gcov-manual:

https://gcc.gnu.org/onlinedocs/gcc/Gcov.html

About inline function:
Quote:
Inlineable functions can create unexpected line counts. Line counts are shown for the source code of the inlineable function, but what is shown depends on where the function is inlined, or if it is not inlined at all.

For measurement you could change the function (remove the inline) .

Also disable any compiler optimization:
Quote:
if you want to prove that every single line in your program was executed, you should not compile with optimization


regards
Previous Topic:GDB will be unable to debug shared library
Next Topic:Switching Build Configurations has no effects on folder Filters
Goto Forum:
  


Current Time: Mon Aug 04 21:48:56 EDT 2025

Powered by FUDForum. Page generated in 0.04469 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top