|
From: Benoit P. <ben...@en...> - 2005-04-25 15:09:06
|
Le ven 22/04/2005 =E0 18:52, Josef Weidendorfer a =E9crit : > On Friday 22 April 2005 16:59, Benoit Peccatte wrote: > > > How do you detect source lines with code never executed? > > > > Valgrind reads a part of the dwarf informations (which are available > > when you compile with -g option). Debug informations contain a list of > > locations where code can be found. I read all of them for each segment > > and thus know what could be run. >=20 > Ah, good. I didn't know you can iterate over debug info in a Valgrind too= l. Well, I didn't use directly valgrind functions. I copied needed structures from vg_symtab.h into the tool's header. I know that's not perfectly clean, but it works for now.=20 > > How can I specify or get values for summary such as percentage=20 > > of executed code by function, by file or by soname ? >=20 > As said above, cg_annotate sums up this itself. The same with KCachegrind= . > The formula could be specified on the command line, or given in the data = file. > KCachegrind supports this by adding a line in the header like > event: Coverage =3D Executed / DebugInfo > and will calculate everything itself. But note that currently there is no= =20 > support for parsing "/" in formulas. Ok, I understand now. Yes I would need the '/' then, but I can't see where the '+' is parsed.=20 As the format is extensible, I'd like to keep a new information associated with each file name : the soname where it has been found. Can I add a so=3D... before fl=3D... ? > I just looked, and I think it was for STABS. > See http://kcachegrind.sourceforge.net/patch-0.2b-valgrind-1.0.4.gz, the = part=20 > for vg_symtab2.c. Thanks. > > Yes it is, I work on a big project with many sub directories. I don't > > want the user to find himself where is each source file, especially if > > the software can do it automaticly. >=20 > With KCachegrind, you only have to specify the base of the source tree, i= t=20 > will recurse into subdirs automatically. I thought the same is true for=20 > cg_annotate, but if not, this should be easy to add. The project I'm working on have several files with the same name. This is not sufficient. |