Sorry for the noise, but I have a better patch that actually solves the root 
problem. I ran the full testsuite on sis and covoar against libscore.a like 
this:

$ sparc-rtems5-ar -rcs sparc-rtems5/c/leon3/cpukit/score/libscore.a 
sparc-rtems5/c/leon3/cpukit/score/src/*.o

$ rtems-test --rtems-bsp=leon3-sis-cov sparc-rtems5/c/leon3/testsuites

$ /opt/rtems/5/share/rtems/tester/bin/covoar -v -f TSIM -S 
/opt/rtems/5/share/rtems/tester/rtems/testing/coverage/score-symbols.ini -O 
coverage -E 
/opt/rtems/5/share/rtems/tester/rtems/testing/coverage/Explanations.txt -p 
RTEMS-5  sparc-rtems5/c/leon3/testsuites/*/*.exe

summary.txt:

Bytes Analyzed           : 39376 Bytes Not Executed       : 2864 Percentage 
Executed      : 92.73 Percentage Not Executed  : 7.273 Uncovered ranges found   
: 108 Total branches found     : 860 Uncovered branches found : 200    61 
branches always taken    139 branches never taken

All symbol sizes and ranges are now correctly reported/calculated in the 
reports. There are two remaining issues to be solved:

1. File names are printed as 'unknown' in reports (minor problem but useful)

2. We should add RISC-V support to covoar ...

Let me know if you agree to the patch ..
From 9212f0fa6add86929936f1f9ebff6a32ad41fc99 Mon Sep 17 00:00:00 2001
From: Jiri Gaisler <j...@gaisler.se>
Date: Fri, 25 Jan 2019 15:12:58 +0100
Subject: [PATCH] covoar: minor fixes to work with SIS/TSIM

	* enabled -f switch (QEMU was hardcoded)
	* wrong symbol size corrupted coverage calculations
	* debug print-out of addresses was in decimal rather than in hex
---
 tester/covoar/DesiredSymbols.cc   | 1 +
 tester/covoar/ExecutableInfo.cc   | 2 +-
 tester/covoar/ObjdumpProcessor.cc | 2 +-
 tester/covoar/covoar.cc           | 3 ++-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/DesiredSymbols.cc b/tester/covoar/DesiredSymbols.cc
index 7def2ce..b9a5bb7 100644
--- a/tester/covoar/DesiredSymbols.cc
+++ b/tester/covoar/DesiredSymbols.cc
@@ -296,6 +296,7 @@ namespace Coverage {
                 );
               if (Verbose)
                 std::cerr << "Branch never taken found in " << s.first
+                          << std::hex
                           << " (0x" << s.second.baseAddress + la
                           << " - 0x" << s.second.baseAddress + ha
                           << ")"
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index d93860b..c593e1d 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -47,7 +47,7 @@ namespace Coverage {
         for (auto& func : cu.get_functions()) {
           if (func.has_machine_code() && (!func.is_inlined() || func.is_external())) {
             createCoverageMap (cu.name(), func.name(),
-                               func.pc_low(), func.pc_high());
+                               func.pc_low(), func.pc_high() - 1);
           }
         }
       }
diff --git a/tester/covoar/ObjdumpProcessor.cc b/tester/covoar/ObjdumpProcessor.cc
index 05507de..56ee219 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -36,7 +36,7 @@ namespace Coverage {
 
     uint32_t lowAddress = coverageMap.getFirstLowAddress();
     uint32_t size = coverageMap.getSize();
-    uint32_t highAddress = lowAddress + size;
+    uint32_t highAddress = lowAddress + size - 1;
 
     // If there are NOT already saved instructions, save them.
     SymbolInformation* symbolInfo = SymbolsToAnalyze->find( symbolName );
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 36c24c3..cbb0e4f 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -163,7 +163,7 @@ int covoar(
   char                          gcdaFileName[FILE_NAME_LENGTH];
   char                          gcovBashCommand[256];
   std::string                   target;
-  const char*                   format = "html";
+  const char*                   format = "QEMU";
   FILE*                         gcnosFile = NULL;
   Gcov::GcovData*               gcovFile;
   const char*                   singleExecutable = NULL;
@@ -359,6 +359,7 @@ int covoar(
     AllExplanations->load( explanations );
 
   // Create coverage map reader.
+  coverageFormat = Coverage::CoverageFormatToEnum(format);
   coverageReader = Coverage::CreateCoverageReader(coverageFormat);
   if (!coverageReader)
     throw rld::error( "Unable to create coverage file reader", "covoar" );
-- 
2.17.1

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to