GCov with GCC 3.3.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I recently started working on a new code base that consists of thousands
of C source files, and a somewhat complicated Makefile structure. One of
my team's requirements was to be able to use code coverage tools on the
new code base. Over the last few days, I have been working to try and
get GCov working on the new image, but I've hit some snags. First, let
me give an overview of how the image is built.

The source code is broken up into distinct modules. Each source file is
compiled into an object file (.o). The object files for a given module
are then compiled into a static library (.a). Finally, all of the static
libraries are linked together to create the executable.

In order to obtain coverage information, I compiled a few of the object
files with the "-fprofile-arcs -ftestcoverage" options (we're using GCC
3.3.6). Originally, the coverage data was not getting created, which led
me to discover that the build was using ccache. Thus, to bypass "ccache"
and ensure that the object files were compiled locally, I set the
"CCACHE_DISABLE" environment variable to 1. After rebuilding, I
discovered that the appropriate "*.bb" and "*.bbg" files were created.

Now, I need to run the executable on a different machine than my build
machine. We can call the new machine "the simulator." The simulator has
my entire workspace mounted. Thus, the simulator still has access to all
of the object files, static libraries, and source code. When executing I
must log into the simulator as root. Thus, I have different permissions
(i.e. root doesn't have write access to all of my object directories). I
have tried addressing this by doing a "chmod 777" on the object file
directories that contain my *.bb and *.bbg files to ensure that root is
able to write to that directory.

After running the image, the necessary *.da files are not getting
created. I've read some suggestions that I may need to use the -lgcov
flag when linking the static libraries to the main executable.  When
adding this flag, I started getting an error saying that the linker
"cannot find -lgcov."  I looked around our source tree, and I couldn't
find a version of libgcov.a for our gcc 3.3.6  Is including "-lgcov"
when linking all of our static libraries into the executable required
with gcc 3.3.6?  If so, can anyone point me to where I can obtain this
library?  I downloaded and checked the gcc-3.3.6.tar, but I didn't find
a libgcov.a file.

Does anyone have any other suggestions besides including "-lgcov?"

Thanks,
Ryan



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux