X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble with gpp/gcov Date: 31 Jul 2004 19:57:27 GMT Lines: 24 Message-ID: <2n2bt7FsocrnU3@uni-berlin.de> References: <2n26qfFsa6knU1 AT uni-berlin DOT de> X-Trace: news.uni-berlin.de CVv2HKUwU1w53gjN8phj3w206rpvrScn84dl1scAnbNf4fCbsoUS2olmHA X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Andrew Wall wrote: > I'm trying to use gcov to show the coverage my unit tests manage on my > software. A good idea. Far too seldom is this exercise actually attempted. > I can get make/gpp to compile and link and the executables run OK, but gcov > doesn't always report the correct coverage. There may be no way it can do that. The key to your problem is that the calls to static constructors and destructors aren't done by any C or C++ code compiled as part of your project. They're actually made by low-level code in the runtime system (libgcc, *crt*.o), and organized by some linker script magic (the ctor and dtor sections). Which means there will be no, or at least no usable profiling information present for their invocations. This problem is almost certainly located in GCC itself, not in its DJGPP port, so it should be reported to the GCC people. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.