top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

gcov shared library without building main executable program

+2 votes
157 views

I need to use gcov to test coverage of a shared library where I have ownership of the source code for the library, but I do not have the source code for the executable test program that uses the library. Is there a way for gcov to provide coverage analysis of a shared library without building the main() program that uses the shared library?

All the examples I have seen show the main() program is built with gcov. I have used gcov to build the .gcno files that correspond to the .so file. I have been able to use gcov to build a test program that I have source code for that uses the shared library and get it to generate execution trace .gcda files for the shared library objects.

However, I have external users of the library that have their own executable programs that use the library and I need to test code coverage with those programs but I do not have access to their source code.

posted Aug 30, 2013 by Jai Prakash

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

Similar Questions
+1 vote

Is there a way for gcov to provide coverage analysis of a shared library without building the main() program that uses the shared library?

I have external users of the library that have their own executable programs that use the library and I need to test code coverage with those programs but I do not have access to their source code.

0 votes

My static library is present on path /root/xxx/lib and contains libabc.a libefg.a liblmn.a file and my shared library is present in /root/xxx named as libshared.so

I want to link shared library with static library. Please share the gcc command for the same.

0 votes

I'm working with a project that needs on air reprogramming on a cortexm3 architecture with gcc 4.8.1, target arm-none-eabi.

The final outcome of the project would have to be a user application that relies on a shared library that I can dynamically update.

For the purpose, I'd need
- the shared library code to be position independent (all addresses and jumps should have to be relative and not absolute[right?]),
- the user application to be able to fetch the required symbols addresses from a table that allow library symbols remapping without the app having to be aware of that.

By fulfilling these requisites, I would have the user application rely on a fixed place symbols table, with a fixed number of symbols, that would target arbitrary locations. when updating the library I would
rewrite the symbols table with the new positions of the library functions in the memory. Relative addressing (position independency) would allow me to place the library at arbitrary position in flash while
preserving jumping instructions coherence.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...