[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] gcov


On lauantai 05 helmikuu 2011, Vincent Rivière wrote:
> Eero Tamminen wrote:
> > What about the "gcov" and the GCC "-fprofile-arcs -ftest-coverage"
> > compilation options needed for it?  Do those work better?
> I see that gcov is provided by gcc, while gprof is provided by the
> binutils.
> Normally, a program compiled with "-fprofile-arcs -ftest-coverage" should
> produce a .gcda file when it is run.
> This does not occur on MiNT.
> I believe some support is missing from the MiNTLib.
> Also, the libgcov.a shipped with my binaries is almost empty, this is
> because I didn't use --with-sysroot or --with-headers while configuring
> gcc to indicate where is the MiNTlib.

On Linux with GCC v4.4:

$ ar t /usr/lib/gcc/i486-linux-gnu/4.4/libgcov.a

When I disassembled "-fprofile-arcs -ftest-coverage" compiled test program,
it included or referred to following gcov functions:

"_init" called:
 804869d:       e8 8e 00 00 00          call   8048730 <__gmon_start__@plt>
 80486a2:       e8 49 02 00 00          call   80488f0 <frame_dummy>
 80486a7:       e8 74 18 00 00          call   8049f20 

"main" didn't do anything interesting, but "_GLOBAL__I_65535_0_main" (?)
called "__gcov_init" which called "__i686.get_pc_thunk.bx" and "atexit",
latter called C-library atexit.  Former was just:
08049e18 <__i686.get_pc_thunk.bx>:
 8049e18:       8b 1c 24                mov    (%esp),%ebx
 8049e1b:       c3                      ret

> So additional work needs to be done in order to have a working gcov for
> MiNT.

	- Eero