Problems with gcov - ADA

This is a discussion on Problems with gcov - ADA ; Hello, i`m trying to use the gcov tool to measure the code coverage of my ada- code, but it seems no to work. I tried to measure the following code: (helloworld.adb) with Ada.Text_IO; use Ada.Text_IO; procedure helloworld is begin Put_Line("Hello ...

+ Reply to Thread
Results 1 to 3 of 3

Problems with gcov

  1. Default Problems with gcov

    Hello,

    i`m trying to use the gcov tool to measure the code coverage of my ada-
    code, but it seems no to work.
    I tried to measure the following code: (helloworld.adb)

    with Ada.Text_IO;
    use Ada.Text_IO;
    procedure helloworld is
    begin
    Put_Line("Hello World");
    end helloworld;

    The next steps are:

    % gnatmake -fprofile-arcs -ftest-coverage helloworld.adb
    gnatgcc -c -fprofile-arcs -ftest-coverage helloworld.adb
    gnatbind -x helloworld.ali
    gnatlink helloworld.ali

    % ls
    helloworld helloworld.adb helloworld.ali helloworld.bb
    helloworld.bbg helloworld.o

    % ./helloworld
    Hello World

    % ls
    helloworld helloworld.adb helloworld.ali helloworld.bb
    helloworld.bbg helloworld.o


    There is no helloworld.gcno file.
    What am i doing wrong.

    Thanks

    flux


  2. Default Re: Problems with gcov

    igor.prakljacic@gmail.com wrote:
    > Hello,
    >
    > i`m trying to use the gcov tool to measure the code coverage of my ada-
    > code, but it seems no to work.
    > I tried to measure the following code: (helloworld.adb)
    >
    > with Ada.Text_IO;
    > use Ada.Text_IO;
    > procedure helloworld is
    > begin
    > Put_Line("Hello World");
    > end helloworld;
    >
    > The next steps are:
    >
    > % gnatmake -fprofile-arcs -ftest-coverage helloworld.adb
    > gnatgcc -c -fprofile-arcs -ftest-coverage helloworld.adb
    > gnatbind -x helloworld.ali
    > gnatlink helloworld.ali
    >
    > % ls
    > helloworld helloworld.adb helloworld.ali helloworld.bb
    > helloworld.bbg helloworld.o
    >
    > % ./helloworld
    > Hello World
    >
    > % ls
    > helloworld helloworld.adb helloworld.ali helloworld.bb
    > helloworld.bbg helloworld.o
    >
    >
    > There is no helloworld.gcno file.
    > What am i doing wrong.
    >
    > Thanks
    >
    > flux
    >


    Not sure. The same sequence of steps works for me on Centos.
    What GCC/GNAT version are you using and what OS?

  3. Default Re: Problems with gcov

    igor.prakljacic@gmail.com writes:

    > % gnatmake -fprofile-arcs -ftest-coverage helloworld.adb
    > gnatgcc -c -fprofile-arcs -ftest-coverage helloworld.adb
    > gnatbind -x helloworld.ali
    > gnatlink helloworld.ali
    >
    > % ls
    > helloworld helloworld.adb helloworld.ali helloworld.bb
    > helloworld.bbg helloworld.o
    >
    > % ./helloworld
    > Hello World
    >
    > % ls
    > helloworld helloworld.adb helloworld.ali helloworld.bb
    > helloworld.bbg helloworld.o


    GNATs based on GCC 2 (eg, GNAT 3.15p) use the .bb and .bbg files, and
    the output would be in .da files. GNAT GPL 2006 (on Mac OS X at any
    rate) uses the .gcno and .gcda files.

    Ah! On this machine I get

    $ gnatmake -fprofile-arcs -ftest-coverage helloworld.adb -f
    gcc -c -fprofile-arcs -ftest-coverage helloworld.adb
    gnatbind -x helloworld.ali
    gnatlink helloworld.ali -fprofile-arcs -ftest-coverage

    so the gnatlink call is different ...

+ Reply to Thread

Similar Threads

  1. Replies: 14
    Last Post: 12-16-2007, 09:42 PM
  2. python + gcov
    By Application Development in forum Python
    Replies: 3
    Last Post: 08-31-2007, 06:54 AM
  3. creating a da file in gcov if the program is terminated abruptly
    By Application Development in forum Software-Testing
    Replies: 1
    Last Post: 09-19-2006, 01:31 PM
  4. Help needed with gcov
    By Application Development in forum Compilers
    Replies: 1
    Last Post: 10-22-2005, 11:36 PM
  5. Replies: 7
    Last Post: 09-26-2005, 05:51 PM