Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gcov on gdb
@ 2003-01-07  2:22 Elena Zannoni
  2003-01-07  4:26 ` Daniel Jacobowitz
  2003-01-09  0:42 ` Andrew Cagney
  0 siblings, 2 replies; 5+ messages in thread
From: Elena Zannoni @ 2003-01-07  2:22 UTC (permalink / raw)
  To: gdb


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcov on gdb
  2003-01-07  2:22 gcov on gdb Elena Zannoni
@ 2003-01-07  4:26 ` Daniel Jacobowitz
  2003-01-09  0:42 ` Andrew Cagney
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-01-07  4:26 UTC (permalink / raw)
  To: gdb

On Mon, Jan 06, 2003 at 09:26:26PM -0500, Elena Zannoni wrote:
> 
> 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.

I've done this once.  I was trying to write a full-coverage (or mostly
full coverage...) testsuite for c-typeprint.c; I'll get back to that
One Of These Days.

> 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.

I think this is a really, really, really good idea.  I can absolutely
guarantee that the C++ language support won't work with CFront any
more, and I've never seen a complaint, so I'm inclined to think it
doesn't have current users (or current users interested in GDB).

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcov on gdb
  2003-01-07  2:22 gcov on gdb Elena Zannoni
  2003-01-07  4:26 ` Daniel Jacobowitz
@ 2003-01-09  0:42 ` Andrew Cagney
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2003-01-09  0:42 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb

> 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.

Don't know of a script that can convert the gcov into html so that it is 
web browsable?

Anyway, what about putting it on the ftp server?

Andrew



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcov on gdb
  2003-01-07  4:17 Michael Elizabeth Chastain
@ 2003-01-07  4:24 ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2003-01-07  4:24 UTC (permalink / raw)
  To: gdb

On Mon, Jan 06, 2003 at 10:17:15PM -0600, Michael Elizabeth Chastain wrote:
> Elena Zannoni writes:
> > 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.
> 
> More generally, I wish gdb had documentation about which compilers,
> assemblers, and linkers that gdb supports, especially for C++.

C++: in practice, GNU GCC 2.95, and GNU GCC 3.x.  In theory, HP aCC
also, but I haven't gotten around to seeing how well it works; and
frankly, the HP debug info is so overengineered that it's a royal pain
to work with.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gcov on gdb
@ 2003-01-07  4:17 Michael Elizabeth Chastain
  2003-01-07  4:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2003-01-07  4:17 UTC (permalink / raw)
  To: ezannoni, gdb

Elena Zannoni writes:
> 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.

More generally, I wish gdb had documentation about which compilers,
assemblers, and linkers that gdb supports, especially for C++.

Personally, I take the view that I prefer to test-bed gdb with other
Free Software.  Specifically that means these licenses:

  http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
  http://www.gnu.org/licenses/license-list.html#GPLIncompatibleLicenses

I don't know what FSF policy is on this.

Michael C
apologies to elena z for the tangent on her thread


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-01-09  0:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07  2:22 gcov on gdb Elena Zannoni
2003-01-07  4:26 ` Daniel Jacobowitz
2003-01-09  0:42 ` Andrew Cagney
2003-01-07  4:17 Michael Elizabeth Chastain
2003-01-07  4:24 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox