How to use gcov?

Kiran C kiranc at
Tue Aug 28 11:02:41 UTC 2001

    I want to use gcov for genrating  code coverage information.I tried
using the gcov flags along with the psim BSp.But it seems certain functions
required are not implemnted in the psim libgcc.a .
So what options do I have?
I tried using the UNIX BSP.( so that I can use gcov)But here also I am
facing problems.
When a declare an array for partition like this
rtems_unsigned8 Partition[512]  CPU_STRUCTURE_ALIGNMENT;
I get a warining the it is out of bound of the limits of the object file.
The CPU_STRUCTURE_ALIGNMENT macro stand for this , __attribute__ ((aligned
What does this mean?
Later I tried changing the 32 with 16.And incremented the ptr to the array
base by 4( ie of Partition by 4)
Then all partition sys calls work.
What is actually happening?IS what I have done the right thing to do?
I am facing problems using Message Queue also.The message queue is
created,and a message is sent to the use success fuuly.
But when I call the rtems_message_queue_receive sys call.
I get the follwing error
Stray signal 11
      0 [sig] tca 665 open_stackdumpfile: Dumping stack trace to
Aborted (core dumped)
I tried debugging into rtems_message_queue_receive
gdb) n
7      ../../../../../posix/lib/include/rtems/rtems/message.inl: No such
file or director
       in ../../../../../posix/lib/include/rtems/rtems/message.inl
gdb) n
5        switch ( location ) {
gdb) n
8            _CORE_message_queue_Seize(
gdb) n
3            if ( _Options_Is_no_wait( option_set ) )
gdb) n
8            _CORE_message_queue_Seize(
gdb) n
3            if ( _Options_Is_no_wait( option_set ) )
gdb) n
8            _CORE_message_queue_Seize(
gdb) n

rogram received signal SIGSEGV, Segmentation fault.
CORE_message_queue_Seize (the_message_queue=0xa20ca9c, id=469827585,
   buffer=0x60f71c, size=0x4, wait=0, timeout=0)
   at /rtems-4.5.0/c/src/exec/score/src/coremsgseize.c:81
1          *size = the_message->Contents.size;
Why is it receiving a Segmentation fault?
Here is my code that I used to test it...
typedef struct _msg
 int x;
msg x,y;

  printf("MSG Q CREATED\n");
 if  (rtems_message_queue_send(id,&x,sizeof(msg))==RTEMS_SUCCESSFUL)
  printf("MSG SENT\n");
 {  printf("MESSAGE RECVDED\n");
ps: This code works fine the psim and pc386 BSP

More information about the users mailing list