Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse Oxygen.3, CDT 9.4.3, Gcov plugin, and cygwin GCC 6.4.0(Can't find .gcno file for cygwin gcov run on Eclipse.)
Eclipse Oxygen.3, CDT 9.4.3, Gcov plugin, and cygwin GCC 6.4.0 [message #1786993] Thu, 17 May 2018 01:27 Go to next message
Befuddled Forever is currently offline Befuddled ForeverFriend
Messages: 2
Registered: May 2018
Junior Member
I have encountered a rather unfortunate effect of what I think the cygwin's drive mapping when running a Gcov profiler.

The setup:
1. New hello world project. Use Managed CDT.
2. Turn on profiling (C/C++ Build, Settings, Debugging, Generate gcov information).
3. Build successful, .gcno created.
4. Under Profiling Tool Configurations, create new. Click Profile.

After the code runs, the following is observed:
1. The gcov output window is blank.
2. Double click the .gcda / .gcno, Eclipse request binary file that was run. Point to the .exe.
3.Eclipse then shows a window with title 'c:ygdrive\c\Users\....\eclipse\test\Debug\src\test-gcov.gcno not found. Please enter location of test-gcov.gcno'.
4. After I point to the right location, if I click the .cpp file, it would display correct coverage highlighting, but the gcov output window is still blank.
5. Every time I close the .cpp file and reopen it again, it would ask me where .gcno file again.

Cygwin typically maps c: to /cygdrive/c, so the path generated within object files, etc. has /cygdrive/c. I tried adding in under Profiling Tools Configurations a new "Path Mapping: /cygdrive/c - C:\", but I still have error.

I don't have this issue on the same setup of Eclipse + CDT + Linux GCC on another VM, so I suspect this is very cygwin specific. In the Linux version, everything is automatically highlighted.

Has anyone run into this and know how to fix it?

Thanks!!
Re: Eclipse Oxygen.3, CDT 9.4.3, Gcov plugin, and cygwin GCC 6.4.0 [message #1787411 is a reply to message #1786993] Fri, 25 May 2018 00:34 Go to previous message
Befuddled Forever is currently offline Befuddled ForeverFriend
Messages: 2
Registered: May 2018
Junior Member
Hi all,

I did a little more sleuthing on this matter, and a cross-post in the StackOverflow pointed me to the right direction: the path of gcov must be the same path of the Cygwin GCC.
So this setup works if I ensure the Cygwin GCC path as the first entry in the Windows path.

But this alone did not make sense originally, if Eclipse can detect (or get configured) to use Cygwin GCC at certain path, surely the gcov used is also the same path?

Looking at detailed the error log (Show View -> Other -> Error Log):
at org.eclipse.linuxtools.internal.gcov.parser.CovManager.openTraceFileStream(CovManager.java:332)
at org.eclipse.linuxtools.internal.gcov.parser.CovManager.processCovFiles(CovManager.java:128)
...

You can then go to the file http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/tree/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/CovManager.java.

Call goes from openTraceFileStream() -> getTransformedPathString() -> getWinOSType().
The implementation of getWinOSType launches a shell and read the OSTYPE. Based on this OSTYPE, the gcov plugin will determine how to alias the data in gcno/gcda, e.g. replacing '/cygdrive/c/xxx' to 'C:/xxx'

To test this in your Windows system, launch a normal command prompt, and run 'sh -c "echo $OSTYPE" '.
Mine showed msys, instead of cygwin.

I will ask the gcov plugin author(s) to provide perhaps a settings we can use to perform a manual path mapping.
Previous Topic:use of MQTT C++ library in my project
Next Topic:Code Templates
Goto Forum:
  


Current Time: Fri Apr 26 08:05:56 GMT 2024

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

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

Back to the top