<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello, <br>
    <br>
    I am doing a coverage analysis for a software code which is based on
    RTEMS 4.10 and runs on a sparc-leon3 platform from Gaisler. I have
    problem with the coverage of switch-case structures. <br>
    <br>
    The software mostly processes the commands that are send to it, and
    do the actions associated to the them. To do the coverage, I have
    added some wrappers and compiled the software as a static library. 
    <br>
    <br>
    And finally a set of test application do the call to the library and
    check the coverage.<br>
    <br>
    My framework uses:<br>
    <br>
        - TSIM/LEON3 SPARC simulator, version 2.0.19 (professional
    version).<br>
        - covoar tool and leon3 simulation script  from  rtems-testing
    tools.<br>
        - sparc-rtems-gcov, lcov and genhtml.<br>
    <br>
    I am not able to cover the switch-case structures. The coverage
    shows that the execution always hit the first case of the
    switch-case. <br>
    <br>
    Does anyone seen this behavior before? <br>
    <br>
    Many thanks, Juanma.<br>
    <br>
    <b>$ </b>sparc-rtems-gcc -v <br>
            Reading specs from
    /opt/rtems-4.10/lib/gcc/sparc-rtems/4.4.6/specs<br>
            Target: sparc-rtems<br>
            Configured with: ../../gcc/configure --target=sparc-rtems
    --with-gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads
    --enable-languages=c,c++ --disable-nls        
    --prefix=/opt/rtems-4.10 --enable-version-specific-runtime-libs
    --with-system-zlib --disable-libstdcxx-pch --disable-win32-registry
    --without-included-gettext<br>
            Thread model: rtems<br>
            gcc version 4.4.6 (GCC) <br>
    <br>
    <br>
    <b>$</b> sparc-rtems-gcov -v<br>
        gcov (GCC) 4.4.6<br>
        Copyright (C) 2010 Free Software Foundation, Inc.<br>
        This is free software; see the source for copying conditions.<br>
        There is NO warranty; not even for MERCHANTABILITY or <br>
        FITNESS FOR A PARTICULAR PURPOSE.<br>
    <br>
    The tests are compiled wth the flags<br>
    <br>
            CCFLAGS =  -fprofile-arcs -ftest-coverage<br>
            LDFLAGS = -lgcov -coverage<br>
    <br>
    <br>
    My coverage script:<br>
    <br>
    ./leon3 -c -l 120 simpletest.exe<br>
    echo "Cleaning counters and create intial..."<br>
    lcov --zerocounters --directory "$SOURCE_DIR" > log/gcov.log
    2>&1<br>
    lcov --capture --initial --directory "$SOURCE_DIR" --output-file 
    "$OUTPUT_DIR/coverage.info" --gcov-tool "$GCOV" >>
    log/gcov.log 2>&1<br>
    <br>
    covoar -v -C config $TESTSUITE >> log/gcov.log 2>&1<br>
    lcov --no-checksum -d $SOURCE_DIR  --capture --output-file
    "$OUTPUT_DIR/coverage.info" --gcov-tool $GCOV --config-file 
    ../rtemsNOMAD/sfs.lcovrc >> log/gcov.log 2>&1<br>
    <br>
    echo "Generating report $OUTPUT_DIR/$REPORTDIR"<br>
    genhtml --highlight --legend --output-directory
    "$OUTPUT_DIR"/"$REPORTDIR"  coverage.info --config-file 
    ../rtemsNOMAD/sfs.lcovrc >> log/gcov.log 2>&1<br>
    <br>
    <br>
    <br>
  </body>
</html>