Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Code Coverage source mapping for external shared library (IDE7): (2 Items)
   
Code Coverage source mapping for external shared library (IDE7)  
Dear QNX team!
Could you please describe, what is the right way to analyze code coverage for external library? (under 'external' i mean
 that is not a part of current IDE's workspace).

Example 1 (working):
- two projects in Workspace: projectApp and projectSharedLib, both compiled with Code Coverage enabled. 
- i set up "Source", "Upload" and "Libraries" tabs in Lauch Configuration
- Profit! In "QNX Analysis" perspective i see both application and shared library, can even F3 to shared library's code 
from application's code, code coverage information is available for both app and library.

Example 2 (considered non-working):
- projectApp project using external mylib.so library (library was also built with Code Coverage, but only .so and source
 code available in some separate directory. E.g. /data/mylib.so, /data/mylib.gcno, /data/src/mylib.c and /data/src/mylib
.h)
- i attach library to project using -l/-L in Makefile (or Linker tab when using QNX Legacy Recursive Makefile projects)
- i set up "Source" (see comments below), "Upload" and "Libraries" tabs in Lauch Configuration
- No profit. Application is executed, code coverage info itself is generated at target platform (i see all required .
gcda files in target's /tmp/projectApp@host/... directory), but in "QNX Analysis" i see only projectApp and its source, 
neither i can F3 to shared library's function.

I've tried almost all "Source Lookup Path" variants at "Source" tab (Compilation Directory, File System Directory, Path 
Mapping...), but with no result. It's also not possible to set path to external sources at "Coverage" tab within "
Collect data for..." section (only this workspace's projects are available for choice).

It would be great if you could help with some brief instruction or (even better) principles IDE follows when it searches
 for .c/.gcno files for executable being analyzed (or maybe there's some QDE debugging mode where it shows all - even 
unsuccessful - attempts to open required files)

Thank you in advance!
Regards,
Igor
Re: Code Coverage source mapping for external shared library (IDE7)  
Igor,

From what I understand, you want to view the coverage results for a shared library without the project for that library 
having to be imported in the workspace. The source code is unfortunately required to generate the .gcda file that is 
produced on the target and then used by the IDE. The closest you will be able to get to your request is linking the 
shared library with -L/-l as you mentioned, add the library project to the workspace, and under the coverage tab of the 
launch configuration uncheck “All sources compiled with code coverage”, click the “Select…” button and select the 
referenced library project.

Best,
Adam