From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15749 invoked by alias); 7 Jan 2003 02:22:22 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 15742 invoked from network); 7 Jan 2003 02:22:21 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 7 Jan 2003 02:22:21 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h071sYB05491 for ; Mon, 6 Jan 2003 20:54:34 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h072M9a01935 for ; Mon, 6 Jan 2003 21:22:09 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h072M7n12573 for ; Mon, 6 Jan 2003 21:22:07 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 2FF57FF79; Mon, 6 Jan 2003 21:26:27 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15898.15058.796649.984375@localhost.redhat.com> Date: Tue, 07 Jan 2003 02:22:00 -0000 To: gdb@sources.redhat.com Subject: gcov on gdb X-SW-Source: 2003-01/txt/msg00056.txt.bz2 I have run gcov on a testsuite run of gdb on my laptop (stock RHL 7.2). It is really easy, in case somebody wants to try, you just need to compile gdb like this: make CFLAGS='-O0 -fprofile-arcs -ftest-coverage' then, after the run, you'll notice all these *.bb, *.bbg, *.da files in your objdir. For each source file, then you can say 'gcov blah.c' and this will produce the actually interesting data, in the form of a copy of the source file (with a .gcov extension) with each line annotated with the number of times it was executed, or with '###' if it was never run. For instance: [ezannoni@localhost gdb]$ gcov stabsread.c 52.76% of 2280 source lines executed in file /home/ezannoni/sources/src/gdb/stabsread.c Creating stabsread.c.gcov. In doing so, I've noticed that a lot of lines in the stabread.c file are never executed because they are old functions (1996) to support cfront. I think we could obsolete this stuff. I've not found anything in a google search for cfront that was more recent than 1995. Anyway, I think the gcov data is too bulky to post. But it could be a good way to spot stuff that is old, or stuff that is untested. Elena