From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11703 invoked by alias); 21 Nov 2001 08:31:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 11594 invoked from network); 21 Nov 2001 08:31:17 -0000 Received: from unknown (HELO NTsvr-H1.telfin.it) (213.26.238.195) by sourceware.cygnus.com with SMTP; 21 Nov 2001 08:31:17 -0000 Received: from VENTO ([217.59.137.231]) by NTsvr-H1.telfin.it (Build 98 8.9.3/NT-8.9.3) with SMTP id JAA02049; Wed, 21 Nov 2001 09:26:22 +0100 Message-ID: <002d01c17267$3633ffe0$0215a8c0@VENTO> From: "Marc Schafer" To: , Subject: -fprofile-arcs Date: Sun, 11 Nov 2001 07:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-SW-Source: 2001-11/txt/msg00502.txt.bz2 I am using gcc as a cross compiler (386-linux to powerpc-eabi) to generate code for an embedded power pc app. There is no operating system running on the target and I am using newlib instead of glibc, but I would still like to do code coverage analysis. Adding -ftest-coverage to the compile options generates the necessary .bb and .bbg files. Adding -fprofile-arcs causes the output code to contain space for the counts and each basic block has the necessary instructions for properly incrementing the counts. Of course, this doesn't work because I get a few unresolved symbols like "__bb_init_func" My target doesn't have a filesystem so there is no way to write the .da files. What I would like to do is supply my own library of functions to support -fprofile-arcs so the counts still end up being generated correctly in memory. I can then send the .da files over a serial port back to the host or use the gdb remote protocol to retrieve then and run gcov. I tried to figure out how to do this by looking at the assembly and map files generated for a simple program using the native compiler (running RedHat 7.1). However, I am having a hard time figuring out what functions I need to supply and what they should do. I found some of it in the gcc source code but there aren't many comments. Is there some documentation of how this works somewhere? Can somebody help me figure it out? thanks, marc