X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Andrew Wall" Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble with gpp/gcov Date: Sun, 1 Aug 2004 20:21:47 +0100 Lines: 37 Message-ID: <2n4u6bFsmhvrU1@uni-berlin.de> References: <2n26qfFsa6knU1 AT uni-berlin DOT de> <2n2bt7FsocrnU3 AT uni-berlin DOT de> X-Trace: news.uni-berlin.de Bew7zFsTPNYcPhVQWwHkcgjgGGUWzkYgPhtvIFzmNh7eHu0B7O X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thanks for the answer. I was hoping that I hadn't been running gcc/gcov properly. I had imagined that the compiler flags added code that would write a token to the output file for every line that the compiler could identify as it is run, but I'll report this to GCC. Andrew -Wall "Hans-Bernhard Broeker" wrote in message news:2n2bt7FsocrnU3 AT uni-berlin DOT de... | 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.