public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* arm-elf-gcc with gcov option do not work
@ 2006-02-15 16:43 Franz Kaufleitner
  2006-02-20 18:07 ` Nathan Sidwell
  0 siblings, 1 reply; 4+ messages in thread
From: Franz Kaufleitner @ 2006-02-15 16:43 UTC (permalink / raw)
  To: gcc-help

Hi all,

We're trying to use GCOV together with the ARM-ELF development 
environment.
 
Our installation is:
arm-elf-gcc: 3.4.3
arm-elf-ld:  2.15
arm-elf-ar, binutils: 2.15
 
 
(1) First we've compiled with the following standard gcc command line
    gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
    Running the image will create the expected gcov data file sample.da.

(2) After them, we've tried it with the arm-elf-gcc
    arm-elf-gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
    Running the image in the arm emulation arm-elf-run, no gcov data
    file sample.gda has been created.
 
(3) Next, we've tried to manipulate the gcov internals by putting a
    debugging printf to the fuctions gcov_init and gcov_flush, but
    it seems, that the code of these functions isn't entered.
 
What do we do wrong ? 

thanks you,

Franz Kaufleitner

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

* Re: arm-elf-gcc with gcov option do not work
  2006-02-15 16:43 arm-elf-gcc with gcov option do not work Franz Kaufleitner
@ 2006-02-20 18:07 ` Nathan Sidwell
  2006-02-27 11:55   ` Antwort: " Franz Kaufleitner
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Sidwell @ 2006-02-20 18:07 UTC (permalink / raw)
  To: Franz Kaufleitner; +Cc: gcc-help

Franz Kaufleitner wrote:
> Hi all,
> 
> We're trying to use GCOV together with the ARM-ELF development 
> environment.
>  
> Our installation is:
> arm-elf-gcc: 3.4.3
> arm-elf-ld:  2.15
> arm-elf-ar, binutils: 2.15
>  
>  
> (1) First we've compiled with the following standard gcc command line
>     gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
>     Running the image will create the expected gcov data file sample.da.
> 
> (2) After them, we've tried it with the arm-elf-gcc
>     arm-elf-gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
>     Running the image in the arm emulation arm-elf-run, no gcov data
>     file sample.gda has been created.
>  
> (3) Next, we've tried to manipulate the gcov internals by putting a
>     debugging printf to the fuctions gcov_init and gcov_flush, but
>     it seems, that the code of these functions isn't entered.

It seems like ctor functions are not being run.  Have you tried a C++ program 
which requires dynamic initializtion of a global variable?  Something like

struct Foo { Foo () {printf ("ctoring\n");}
	    ~Foo () {printf ("dtoring\n");}};

Foo object;

int main () {}

what does that do?

If it doesn't print those two strings, then something's awry with process 
startup.  That is somewhat system dependent and it sounds like you're running on 
a bare board.  You'll need to examine your crt0 to see how it starts things up.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

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

* Antwort: Re: arm-elf-gcc with gcov option do not work
  2006-02-20 18:07 ` Nathan Sidwell
@ 2006-02-27 11:55   ` Franz Kaufleitner
  2006-02-27 12:08     ` Nathan Sidwell
  0 siblings, 1 reply; 4+ messages in thread
From: Franz Kaufleitner @ 2006-02-27 11:55 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: gcc-help

Hi Nathan,

we do not use c++, we use simple c, so I'm not sure if your hint with the 
ctor function matches our problem.

But I've looked for crt0 and I've seen, that there is a gcrt0 (which 
sounds for gcov) within the standard gcc environmont but no gcrt0 within 
the am-elf-gcc environment.

Can you give me information, from where I can get a gcrt0 for the 
am-elf-gcc
OR
what is the different between crt0 and gcrt0 ?

thank you

Franz




Nathan Sidwell <nathan@codesourcery.com> 
20.02.2006 19:06

An
Franz Kaufleitner <Franz.Kaufleitner@br-automation.com>
Kopie
gcc-help@gcc.gnu.org
Thema
Re: arm-elf-gcc with gcov option do not work






Franz Kaufleitner wrote:
> Hi all,
> 
> We're trying to use GCOV together with the ARM-ELF development 
> environment.
> 
> Our installation is:
> arm-elf-gcc: 3.4.3
> arm-elf-ld:  2.15
> arm-elf-ar, binutils: 2.15
> 
> 
> (1) First we've compiled with the following standard gcc command line
>     gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
>     Running the image will create the expected gcov data file sample.da.
> 
> (2) After them, we've tried it with the arm-elf-gcc
>     arm-elf-gcc -fprofile-arcs ?ftest-coverage ?o sample sample.c
>     Running the image in the arm emulation arm-elf-run, no gcov data
>     file sample.gda has been created.
> 
> (3) Next, we've tried to manipulate the gcov internals by putting a
>     debugging printf to the fuctions gcov_init and gcov_flush, but
>     it seems, that the code of these functions isn't entered.

It seems like ctor functions are not being run.  Have you tried a C++ 
program 
which requires dynamic initializtion of a global variable?  Something like

struct Foo { Foo () {printf ("ctoring\n");}
                     ~Foo () {printf ("dtoring\n");}};

Foo object;

int main () {}

what does that do?

If it doesn't print those two strings, then something's awry with process 
startup.  That is somewhat system dependent and it sounds like you're 
running on 
a bare board.  You'll need to examine your crt0 to see how it starts 
things up.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   :: CodeSourcery
nathan@codesourcery.com    ::     
http://www.planetfall.pwp.blueyonder.co.uk




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

* Re: Antwort: Re: arm-elf-gcc with gcov option do not work
  2006-02-27 11:55   ` Antwort: " Franz Kaufleitner
@ 2006-02-27 12:08     ` Nathan Sidwell
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Sidwell @ 2006-02-27 12:08 UTC (permalink / raw)
  To: Franz Kaufleitner; +Cc: gcc-help

Franz Kaufleitner wrote:
> Hi Nathan,
> 
> we do not use c++, we use simple c, so I'm not sure if your hint with the 
> ctor function matches our problem.

gcov uses the same machinery that supports c++ dynamic initialization of static 
objects, which is why I asked you to try the C++ example.  Did you try it?  What 
happened? If it did work, have you tried using gcov on a C++ program?  What happens?

> But I've looked for crt0 and I've seen, that there is a gcrt0 (which 
> sounds for gcov) within the standard gcc environmont but no gcrt0 within 
> the am-elf-gcc environment.

no, gcrt0 is not specific to gcov.  gcrt0 is not provided by gcc.  Where is it 
located?

> Can you give me information, from where I can get a gcrt0 for the 
> am-elf-gcc
> OR
> what is the different between crt0 and gcrt0 ?
I do not know.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

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

end of thread, other threads:[~2006-02-27 12:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-15 16:43 arm-elf-gcc with gcov option do not work Franz Kaufleitner
2006-02-20 18:07 ` Nathan Sidwell
2006-02-27 11:55   ` Antwort: " Franz Kaufleitner
2006-02-27 12:08     ` Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).