change log for gcc-testing (2010-05-07)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri May 7 18:10:04 UTC 2010


 *jennifer*:
2010-05-07	Jennifer Averett <Jennifer.Averett>

	* Makefile, ReportsBase.cc, ReportsBase.h, ReportsText.cc,
	ReportsText.h: Added HTML reports.
	* ReportsHtml.cc, ReportsHtml.h, covoar.css: New files.

M  1.203  rtems-coverage/ChangeLog
M   1.20  rtems-coverage/Makefile
M    1.2  rtems-coverage/ReportsBase.h
M    1.2  rtems-coverage/ReportsBase.cc
A    1.1  rtems-coverage/ReportsHtml.h
A    1.1  rtems-coverage/ReportsHtml.cc
M    1.2  rtems-coverage/ReportsText.h
M    1.2  rtems-coverage/ReportsText.cc
A    1.1  rtems-coverage/covoar.css

diff -u gcc-testing/rtems-coverage/ChangeLog:1.202 gcc-testing/rtems-coverage/ChangeLog:1.203
--- gcc-testing/rtems-coverage/ChangeLog:1.202	Thu May  6 15:34:32 2010
+++ gcc-testing/rtems-coverage/ChangeLog	Fri May  7 13:01:50 2010
@@ -1,3 +1,9 @@
+2010-05-07	Jennifer Averett <Jennifer.Averett>
+
+	* Makefile, ReportsBase.cc, ReportsBase.h, ReportsText.cc,
+	ReportsText.h: Added HTML reports.
+	* ReportsHtml.cc, ReportsHtml.h, covoar.css: New files.
+
 2010-05-06	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* Makefile: Account for file rename.

diff -u gcc-testing/rtems-coverage/Makefile:1.19 gcc-testing/rtems-coverage/Makefile:1.20
--- gcc-testing/rtems-coverage/Makefile:1.19	Thu May  6 15:34:32 2010
+++ gcc-testing/rtems-coverage/Makefile	Fri May  7 13:01:51 2010
@@ -27,6 +27,7 @@
   ObjdumpProcessor.o \
   ReportsBase.o \
   ReportsText.o \
+  ReportsHtml.o \
   SymbolTable.o \
   Target_arm.o  \
   TargetBase.o  \
@@ -121,6 +122,7 @@
   TargetBase.h TargetFactory.h
 ReportsBase.o: ReportsBase.cc ReportsBase.h CoverageRanges.h DesiredSymbols.h \
   Explanations.h ObjdumpProcessor.h
+ReportsHtml.o: ReportsHtml.h ReportsText.cc
 ReportsText.o: ReportsBase.h ReportsText.cc
 SymbolTable.o: SymbolTable.cc SymbolTable.h
 Target_arm.o: Target_arm.cc Target_arm.h TargetBase.h

diff -u gcc-testing/rtems-coverage/ReportsBase.h:1.1 gcc-testing/rtems-coverage/ReportsBase.h:1.2
--- gcc-testing/rtems-coverage/ReportsBase.h:1.1	Thu May  6 12:54:13 2010
+++ gcc-testing/rtems-coverage/ReportsBase.h	Fri May  7 13:01:51 2010
@@ -24,53 +24,62 @@
 
   public:
     ReportsBase();
-   ~ReportsBase();
+    ~ReportsBase();
 
-  /*!
-   *  This method produces an annotated assembly listing report containing
-   *  the disassembly of each symbol that was not completely covered.
-   *
-   *  @param[in] fileName identifies the annotated report file name
-   */
-  void WriteAnnotatedReport(
-    const char* const fileName
-  );
-
-  /*!
-   *  This method produces a report that contains information about each
-   *  uncovered branch statement.
-   *
-   *  @param[in] fileName identifies the branch report file name
-   */
-  void WriteBranchReport(
-    const char* const fileName
-  );
+    /*!
+     *  This method produces an annotated assembly listing report containing
+     *  the disassembly of each symbol that was not completely covered.
+     *
+     *  @param[in] fileName identifies the annotated report file name
+     */
+    void WriteAnnotatedReport(
+      const char* const fileName
+    );
 
-  /*!
-   *  This method produces a report that contains information about each
-   *  uncovered range of bytes.
-   *
-   *  @param[in] fileName identifies the coverage report file name
-   */
-  void WriteCoverageReport(
-    const char* const fileName
-  );
+    /*!
+     *  This method produces a report that contains information about each
+     *  uncovered branch statement.
+     *
+     *  @param[in] fileName identifies the branch report file name
+     */
+    void WriteBranchReport(
+      const char* const fileName
+    );
 
-  /*!
-   *  This method produces a summary report that lists each uncovered
-   *  range of bytes.
-   *
-   *  @param[in] fileName identifies the size report file name
-   */
-  void WriteSizeReport(
-    const char* const fileName
-  );
+    /*!
+     *  This method produces a report that contains information about each
+     *  uncovered range of bytes.
+     *
+     *  @param[in] fileName identifies the coverage report file name
+     */
+    void WriteCoverageReport(
+      const char* const fileName
+    );
 
+    /*!
+     *  This method produces a summary report that lists each uncovered
+     *  range of bytes.
+     *
+     *  @param[in] fileName identifies the size report file name
+     */
+    void WriteSizeReport(
+      const char* const fileName
+    );
 
-  std::string ReportExtension() { return reportExtension_m; }
+    /*!
+     *  This method returns the unique extension for the Report
+     *  type.  If the extension is ".txt" files will be 
+     *  named "annotated.txt", "branch.txt" ......
+     *
+     *  @param[in] fileName identifies the size report file name
+     */
+    std::string ReportExtension() { return reportExtension_m; }
 
   protected:
 
+    /*!
+     * This type is used to track a state during the annotated output.
+     */
     typedef enum {
       A_SOURCE,
       A_EXECUTED,
@@ -79,82 +88,180 @@
       A_BRANCH_NOT_TAKEN
     }AnnotatedLineState_t;
 
+    /*!
+     *  This member variable contains the extension used for all reports.
+     */
     std::string reportExtension_m;
 
 
-    FILE* OpenFile(
+  /*!
+   *  This method Opens a report file and verifies that it opended
+   *  correctly.  Upon failure NULL is returned.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
+     virtual FILE* OpenFile(
       const char* const fileName
     );
 
+  /*!
+   *  This method d Opens a report file and verifies that it opended.
+   *  Then appedns any necessary header information onto the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual FILE* OpenAnnotatedFile(
       const char* const fileName
     );
 
+  /*!
+   *  This method d Opens a report file and verifies that it opended.
+   *  Then appedns any necessary header information onto the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual FILE* OpenBranchFile(
       const char* const fileName
     );
 
+  /*!
+   *  This method d Opens a report file and verifies that it opended.
+   *  Then appedns any necessary header information onto the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual FILE* OpenCoverageFile(
       const char* const fileName
     );
 
+  /*!
+   *  This method d Opens a report file and verifies that it opended.
+   *  Then appedns any necessary header information onto the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual FILE* OpenSizeFile(
       const char* const fileName
     );
 
+  /*!
+   *  This method Closes a report file. 
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     void CloseFile(
       FILE*  aFile
     );
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void CloseAnnotatedFile(
       FILE*  aFile
     );
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void CloseBranchFile(
       FILE*  aFile
     );
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void CloseCoverageFile(
       FILE*  aFile
     );
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void CloseSizeFile(
       FILE*  aFile
     );
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void PutAnnotatedLine( 
       FILE*                aFile, 
       AnnotatedLineState_t state, 
       std::string          line 
     )=0;
 
+  /*!
+   *  This method puts any necessary footer information into
+   *  the report then closes the file.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual bool PutNoBranchInfo(
       FILE* report
     ) = 0;
 
+  /*!
+   *  This method puts a branch entry into the branch report. 
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual bool PutBranchEntry(
-      FILE*                                       report,
+      FILE*                                            report,
+      unsigned int                                     number,
       Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
       Coverage::CoverageRanges::ranges_t::iterator     rangePtr
     )=0;
 
+  /*!
+   *  This method reports when no range is available for 
+   *  a symbol in the coverage report.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual void putCoverageNoRange(
-      FILE*       report,
-      std::string symbol
+      FILE*        report,
+      unsigned int number,
+      std::string  symbol
     )=0;
 
+  /*!
+   *  This method puts a line in the coverage report.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual bool PutCoverageLine(
-      FILE*                                      report,
+      FILE*                                           report,
+      unsigned int                                    number,
       Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
       Coverage::CoverageRanges::ranges_t::iterator    ritr
     )=0;
 
+  /*!
+   *  This method method puts a line into the size report.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
     virtual bool PutSizeLine(
-      FILE*                                      report,
+      FILE*                                           report,
+      unsigned int                                    number,
       Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
       Coverage::CoverageRanges::ranges_t::iterator    range
     )=0;
-
 };
 
 void GenerateReports();

diff -u gcc-testing/rtems-coverage/ReportsBase.cc:1.1 gcc-testing/rtems-coverage/ReportsBase.cc:1.2
--- gcc-testing/rtems-coverage/ReportsBase.cc:1.1	Thu May  6 12:54:13 2010
+++ gcc-testing/rtems-coverage/ReportsBase.cc	Fri May  7 13:01:51 2010
@@ -14,6 +14,7 @@
 
 
 #include "ReportsText.h"
+#include "ReportsHtml.h"
 
 namespace Coverage {
 
@@ -153,20 +154,21 @@
          itr++ ) {
 
       std::string  annotation = "";
-      std::string  line; 
+      std::string  line;
+      char         textLine[100];
 
       state = A_SOURCE;
 
       if ( itr->isInstruction ) {
         if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
-          annotation = "\t<== NOT EXECUTED";
+          annotation = "<== NOT EXECUTED";
           state = A_NEVER_EXECUTED;
         } else if (theCoverageMap->isBranch( itr->address - bAddress )) {
           if (theCoverageMap->wasAlwaysTaken( itr->address - bAddress )){
-            annotation = "\t<== ALWAYS TAKEN";
+            annotation = "<== ALWAYS TAKEN";
             state = A_BRANCH_TAKEN;
           } else if (theCoverageMap->wasNeverTaken( itr->address - bAddress )){
-            annotation = "\t<== NEVER TAKEN";
+            annotation = "<== NEVER TAKEN";
             state = A_BRANCH_NOT_TAKEN;
           }
         } else {
@@ -174,8 +176,9 @@
         }
       }
 
+      sprintf( textLine, "%-70s", itr->line.c_str() );
+      line = textLine + annotation;
       
-      line = itr->line + annotation;
       PutAnnotatedLine( aFile, state, line); 
     }
   }
@@ -193,6 +196,7 @@
   FILE*                                           report = NULL;
   Coverage::CoverageRanges::ranges_t::iterator    ritr;
   Coverage::CoverageRanges*                       theBranches;
+  unsigned int                                    count;
 
   // Open the branch report file
   report = OpenBranchFile( fileName );
@@ -207,6 +211,7 @@
   else {
 
     // Process uncovered branches for each symbol.
+    count = 0;
     for (ditr = SymbolsToAnalyze->set.begin();
          ditr != SymbolsToAnalyze->set.end();
          ditr++) {
@@ -218,7 +223,8 @@
         for (ritr =  theBranches->set.begin() ;
              ritr != theBranches->set.end() ;
              ritr++ ) {
-          PutBranchEntry( report, ditr, ritr );
+          count++;
+          PutBranchEntry( report, count, ditr, ritr );
         }
       }
     }
@@ -237,15 +243,16 @@
   FILE*                                           report;
   Coverage::CoverageRanges::ranges_t::iterator    ritr;
   Coverage::CoverageRanges*                       theRanges;
+  unsigned int                                    count;
 
   // Open the coverage report file.
-  report = fopen( fileName, "w" );
+  report = OpenCoverageFile( fileName );
   if ( !report ) {
-    fprintf( stderr, "Unable to open %s\n\n", fileName );
     return;
   }
 
   // Process uncovered ranges for each symbol.
+  count = 0;
   for (ditr = SymbolsToAnalyze->set.begin();
        ditr != SymbolsToAnalyze->set.end();
        ditr++) {
@@ -257,21 +264,20 @@
     // desired symbols list or with the executables so put something
     // in the report.
     if (theRanges == NULL) {
-      putCoverageNoRange( report, ditr->first );
-    }
-
-    else if (!theRanges->set.empty()) {
+      putCoverageNoRange( report, count, ditr->first );
+      count++;
+    }  else if (!theRanges->set.empty()) {
 
       for (ritr =  theRanges->set.begin() ;
            ritr != theRanges->set.end() ;
            ritr++ ) {
-
-        PutCoverageLine( report, ditr, ritr );
+        PutCoverageLine( report, count, ditr, ritr );
+        count++;
       }
     }
   }
 
-  fclose( report );
+  CloseCoverageFile( report );
 }
 
 /*
@@ -285,6 +291,7 @@
   FILE*                                           report;
   Coverage::CoverageRanges::ranges_t::iterator    ritr;
   Coverage::CoverageRanges*                       theRanges;
+  unsigned int                                    count;
 
   // Open the report file.
   report = OpenSizeFile( fileName );
@@ -293,6 +300,7 @@
   }
 
   // Process uncovered ranges for each symbol.
+  count = 0;
   for (ditr = SymbolsToAnalyze->set.begin();
        ditr != SymbolsToAnalyze->set.end();
        ditr++) {
@@ -304,7 +312,8 @@
       for (ritr =  theRanges->set.begin() ;
            ritr != theRanges->set.end() ;
            ritr++ ) {
-        PutSizeLine( report, ditr, ritr );
+        PutSizeLine( report, count, ditr, ritr );
+        count++;
       }
     }
   }
@@ -323,7 +332,8 @@
 
   reports = new ReportsText();
   reportList.push_back(reports);
-
+  reports = new ReportsHtml();
+  reportList.push_back(reports);
 
   for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
     reports = *ritr;

diff -u /dev/null gcc-testing/rtems-coverage/ReportsHtml.h:1.1
--- /dev/null	Fri May  7 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsHtml.h	Fri May  7 13:01:51 2010
@@ -0,0 +1,134 @@
+/*
+ *   $Id$
+ */
+
+/*! @file Reports.h
+ *  @brief Reports Specification
+ *
+ *  This file contains the specification of the Reports methods.  This
+ *  collection of methods is used to generate the various reports of
+ *  the analysis results.
+ */
+
+#ifndef __REPORTSHTML_H__
+#define __REPORTSHTML_H__
+
+#include <stdint.h>
+#include "ReportsBase.h"
+
+namespace Coverage {
+
+class ReportsHtml: public ReportsBase {
+
+  public:
+    ReportsHtml();
+   ~ReportsHtml();
+
+  /*!
+   *  This method produces a report that contains information about each
+   *  uncovered branch statement.
+   *
+   *  @param[in] fileName identifies the branch report file name
+   */
+  void WriteBranchReport(
+    const char* const fileName
+  );
+
+  /*!
+   *  This method produces a report that contains information about each
+   *  uncovered range of bytes.
+   *
+   *  @param[in] fileName identifies the coverage report file name
+   */
+  void WriteCoverageReport(
+    const char* const fileName
+  );
+
+  /*!
+   *  This method produces a summary report that lists each uncovered
+   *  range of bytes.
+   *
+   *  @param[in] fileName identifies the size report file name
+   */
+  void WriteSizeReport(
+    const char* const fileName
+  );
+
+  protected:
+
+    AnnotatedLineState_t lastState_m;
+
+    virtual FILE* OpenBranchFile(
+      const char* const fileName
+    );
+
+    virtual FILE* OpenCoverageFile(
+      const char* const fileName
+    );
+
+    virtual FILE* OpenSizeFile(
+      const char* const fileName
+    );
+
+    virtual void CloseAnnotatedFile(
+      FILE*  aFile
+    );
+
+    virtual void CloseBranchFile(
+      FILE*  aFile
+    );
+
+    virtual void CloseCoverageFile(
+      FILE*  aFile
+    );
+
+    virtual void CloseSizeFile(
+      FILE*  aFile
+    );
+
+    virtual void PutAnnotatedLine( 
+      FILE*                aFile, 
+      AnnotatedLineState_t state, 
+      std::string          line 
+    );
+
+    virtual bool PutNoBranchInfo(
+      FILE* report
+    );
+
+    virtual bool PutBranchEntry(
+      FILE*                                            report,
+      unsigned int                                     number,
+      Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
+      Coverage::CoverageRanges::ranges_t::iterator     rangePtr
+    );
+
+    virtual void putCoverageNoRange(
+      FILE*        report,
+      unsigned int number,
+      std::string  symbol
+    );
+
+    virtual bool PutCoverageLine(
+      FILE*                                           report,
+      unsigned int                                    number,
+      Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
+      Coverage::CoverageRanges::ranges_t::iterator    ritr
+    );
+
+    virtual bool PutSizeLine(
+      FILE*                                           report,
+      unsigned int                                    number,
+      Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
+      Coverage::CoverageRanges::ranges_t::iterator    range
+    );
+
+    virtual FILE* OpenFile(
+      const char* const fileName
+    );
+
+};
+
+}
+
+#endif

diff -u /dev/null gcc-testing/rtems-coverage/ReportsHtml.cc:1.1
--- /dev/null	Fri May  7 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsHtml.cc	Fri May  7 13:01:51 2010
@@ -0,0 +1,527 @@
+/*
+ *   $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "ReportsHtml.h"
+#include "app_common.h"
+#include "CoverageRanges.h"
+#include "DesiredSymbols.h"
+#include "Explanations.h"
+#include "ObjdumpProcessor.h"
+
+
+namespace Coverage {
+
+ReportsHtml::ReportsHtml():
+  ReportsBase()
+{
+  reportExtension_m = ".html";
+}
+
+ReportsHtml::~ReportsHtml()
+{
+}
+
+FILE* ReportsHtml::OpenFile(
+  const char* const fileName
+)
+{
+  FILE*  aFile;
+  
+  // Open the file
+  aFile = ReportsBase::OpenFile( fileName );
+
+  // Put Header information on the file
+  fprintf( aFile, "<html>\n");
+  fprintf( aFile, "<meta http-equiv=\"Content-Language\" content=\"English\" >\n");
+  fprintf( 
+    aFile, 
+    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" >\n"
+  );
+  fprintf( 
+    aFile, 
+    "<link rel=\"stylesheet\" type=\"text/css\" href=\"covoar.css\" media=\"screen\" >\n"
+  );
+  fprintf( aFile, "<body>\n");
+
+  lastState_m = A_SOURCE;
+  fprintf( aFile, "<pre class=\"code\">\n" );
+
+  return aFile;
+}
+
+FILE* ReportsHtml::OpenBranchFile(
+  const char* const fileName
+)
+{
+  FILE *aFile;
+
+  // Open the file
+  aFile = OpenFile(fileName);
+
+  // Put header information into the file
+  fprintf( aFile, "<table class=\"covoar-table\">\n");
+  fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
+  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Line</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Reason</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Classification</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Explanation</th>\n");
+  fprintf( aFile, "</tr>\n");
+
+  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
+  fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Bytes</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Instructions</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\"></th>\n");
+  fprintf( aFile, "</tr>\n");
+ 
+  return aFile;
+}
+
+FILE*  ReportsHtml::OpenCoverageFile(
+  const char* const fileName
+)
+{
+  FILE *aFile;
+
+  // Open the file
+  aFile = OpenFile(fileName);
+
+
+  // Put header information into the file
+  fprintf( aFile, "<table class=\"covoar-table\">\n");
+  fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
+  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Range</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Size</br>Bytes</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Size</br>Instructions</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Classification</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Explanation</th>\n");
+  fprintf( aFile, "</tr>\n");
+
+  return aFile;
+}
+
+FILE*  ReportsHtml::OpenSizeFile(
+  const char* const fileName
+)
+{
+  FILE *aFile;
+
+  // Open the file
+  aFile = OpenFile(fileName);
+
+
+  // Put header information into the file
+  fprintf( aFile, "<table class=\"covoar-table\">\n");
+  fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
+  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Size</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
+  fprintf( aFile, "<th class=\"covoar-th\">File</th>\n");
+  fprintf( aFile, "</tr>\n");
+
+
+
+  return aFile;
+}
+
+void ReportsHtml::PutAnnotatedLine( 
+  FILE*                aFile, 
+  AnnotatedLineState_t state, 
+  std::string          line 
+)
+{
+  std::string stateText;
+  
+  // Set the stateText based upon the current state.
+  switch (state) {
+    case  A_SOURCE:
+      stateText = "</pre>\n<pre class=\"code\">\n";
+      break;
+    case  A_EXECUTED:
+      stateText = "</pre>\n<pre class=\"codeExecuted\">\n";
+      break;
+    case  A_NEVER_EXECUTED:
+      stateText = "</pre>\n<pre class=\"codeNotExecuted\">\n";
+      break;
+    case  A_BRANCH_TAKEN:
+      stateText = "</pre>\n<pre class=\"codeAlwaysTaken\">\n";
+      break;
+    case  A_BRANCH_NOT_TAKEN:
+      stateText = "</pre>\n<pre class=\"codeNeverTaken\">\n";
+      break;
+    default:
+      fprintf(stderr, "ERROR:  ReportsHtml::PutAnnotatedLine Unknown state\n");
+      exit( -1 );
+      break;
+  }
+
+  // If the state has not changed there is no need to change the text block
+  // format.  If it has changed close out the old format and open up the
+  // new format.
+  if ( state != lastState_m ) {
+    fprintf( aFile, stateText.c_str() );
+    lastState_m = state;
+  }
+
+  // For all the characters in the line replace html reserved special characters
+  // and output the line. Note that for a /pre block this is only a '<' symbol.
+  for (unsigned int i=0; i<line.size(); i++ )
+  {
+    if ( line[i] == '<' )
+      fprintf( aFile, "<" );
+    else
+      fprintf( aFile, "%c", line[i] );
+  }
+  fprintf( aFile, "\n");
+}
+
+bool ReportsHtml::PutNoBranchInfo(
+  FILE* report
+)
+{
+  fprintf( report, "No branch information found\n" );
+  return true;
+}
+
+
+bool ReportsHtml::PutBranchEntry(
+  FILE*                                            report,
+  unsigned int                                     count,
+  Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
+  Coverage::CoverageRanges::ranges_t::iterator     rangePtr
+)
+{
+  const Coverage::Explanation* explanation;
+
+
+  // Mark the background color different for odd and even lines.
+  fprintf( report, "</tr>\n");
+  if ( ( count%2 ) == 0 )
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-even\">\n");
+  else
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
+
+  // symbol
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    symbolPtr->first.c_str()
+  );
+
+  // line
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    rangePtr->lowSourceLine.c_str()
+  );
+  
+  // Size in bytes
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
+    rangePtr->highAddress - rangePtr->lowAddress + 1
+  );
+
+  // Size in instructions
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">XXX</td>\n"
+  ); 
+
+  // Reason Branch was uncovered
+  if (rangePtr->reason ==
+    Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN)
+    fprintf( 
+      report,
+      "<td class=\"covoar-td\" align=\"center\">Always Taken</td>\n"
+    );
+  else if (rangePtr->reason ==
+    Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN)
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">Never Taken</td>\n"
+    );
+
+  // See if an explanation is available
+  explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
+  if ( !explanation ) {
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
+    );
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">No Explanation</td>\n"
+    );
+  } else {
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
+      explanation->classification.c_str()
+    );
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">FILL ME IN</td>\n"
+    );
+#if 0
+    for ( unsigned int i=0 ;
+          i < explanation->explanation.size();
+          i++) {
+      fprintf(
+        report,
+        "%s\n",
+        explanation->explanation[i].c_str()
+      );
+    }
+#endif
+  }
+
+  fprintf( report, "</tr>\n");
+
+  return true;
+}
+
+void ReportsHtml::putCoverageNoRange(
+  FILE*         report,
+  unsigned int  count,
+  std::string   symbol
+)
+{
+
+  // Mark the background color different for odd and even lines.
+  fprintf( report, "</tr>\n");
+  if ( ( count%2 ) == 0 )
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-even\">\n");
+  else
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
+
+  // symbol
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    symbol.c_str()
+  );
+
+  // starting line
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\"></td>\n"
+   );
+   
+  // Size in bytes
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\"></td>\n"
+  );
+
+  // Size in instructions
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\"></td>\n"
+  ); 
+
+  // See if an explanation is available
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\"></td>\n"
+  );
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">"
+    "This symbol was never referenced by an analyzed executable.  "
+    "Therefore there is no size or disassembly for this symbol.  "
+    "This could be due to symbol misspelling or lack of a test for"
+    "this symbol.</td>\n"
+  );
+
+  fprintf( report, "</tr>\n");
+}
+
+bool ReportsHtml::PutCoverageLine(
+  FILE*                                            report,
+  unsigned int                                     count,
+  Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
+  Coverage::CoverageRanges::ranges_t::iterator     rangePtr
+)
+{
+  const Coverage::Explanation*   explanation;
+
+
+  // Mark the background color different for odd and even lines.
+  fprintf( report, "</tr>\n");
+  if ( ( count%2 ) == 0 )
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-even\">\n");
+  else
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
+
+  // symbol
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    symbolPtr->first.c_str()
+  );
+
+  // starting line
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s(0x%x)</br>%s(0x%x)</td>\n",
+    rangePtr->lowSourceLine.c_str(),
+    rangePtr->lowAddress,
+    rangePtr->highSourceLine.c_str(),
+    rangePtr->highAddress
+   );
+   
+  // Size in bytes
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
+    rangePtr->highAddress - rangePtr->lowAddress + 1
+  );
+
+  // Size in instructions
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">XXX</td>\n"
+  ); 
+
+  // See if an explanation is available
+  explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
+  if ( !explanation ) {
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
+    );
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">No Explanation</td>\n"
+    );
+  } else {
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
+      explanation->classification.c_str()
+    );
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">FILL ME IN</td>\n"
+    );
+
+
+    #if  0
+    for ( unsigned int i=0; i < explanation->explanation.size(); i++) {
+      fprintf( report,"%s\n", explanation->explanation[i].c_str() );
+    }
+    #endif
+  }
+
+  fprintf( report, "</tr>\n");
+
+  return true;
+}
+
+bool  ReportsHtml::PutSizeLine(
+  FILE*                                           report,
+  unsigned int                                    count,
+  Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
+  Coverage::CoverageRanges::ranges_t::iterator    range
+)
+{
+  // Mark the background color different for odd and even lines.
+  fprintf( report, "</tr>\n");
+  if ( ( count%2 ) == 0 )
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-even\">\n");
+  else
+    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
+
+  // size
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
+    range->highAddress - range->lowAddress + 1
+  );
+
+  // symbol
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    symbol->first.c_str()
+  );
+
+  // file
+  fprintf( 
+    report, 
+    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+    range->lowSourceLine.c_str()
+  );
+
+
+
+  return true;
+}
+
+void ReportsHtml::CloseAnnotatedFile(
+  FILE*  aFile
+)
+{
+  fprintf( aFile,"</pre>\n");
+  fprintf( aFile,"</body>\n");
+  fprintf( aFile,"</html>");
+
+  CloseFile(aFile);
+}
+
+void ReportsHtml::CloseBranchFile(
+  FILE*  aFile
+)
+{
+  fprintf( aFile, "</tbody>\n" );
+  fprintf( aFile, "</table>\n" );
+  fprintf( aFile, "</pre>\n" );
+  fprintf( aFile, "</body>\n");
+  fprintf( aFile, "</html>");
+
+  CloseFile(aFile);
+}
+
+void ReportsHtml::CloseCoverageFile(
+  FILE*  aFile
+)
+{
+  fprintf( aFile, "</tbody>\n" );
+  fprintf( aFile, "</table>\n" );
+  fprintf( aFile, "</pre>\n" );
+  fprintf( aFile,"</body>\n");
+  fprintf( aFile,"</html>");
+
+  CloseFile(aFile);
+}
+
+void ReportsHtml::CloseSizeFile(
+  FILE*  aFile
+)
+{
+  fprintf( aFile, "</tbody>\n" );
+  fprintf( aFile, "</table>\n" );
+  fprintf( aFile, "</pre>\n" );
+  fprintf( aFile, "</pre>\n" );
+  fprintf( aFile,"</body>\n");
+  fprintf( aFile,"</html>");
+
+  CloseFile( aFile );
+}
+
+}

diff -u gcc-testing/rtems-coverage/ReportsText.h:1.1 gcc-testing/rtems-coverage/ReportsText.h:1.2
--- gcc-testing/rtems-coverage/ReportsText.h:1.1	Thu May  6 12:54:13 2010
+++ gcc-testing/rtems-coverage/ReportsText.h	Fri May  7 13:01:51 2010
@@ -68,23 +68,27 @@
 
     virtual bool PutBranchEntry(
       FILE*                                            report,
+      unsigned int                                     number,
       Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
       Coverage::CoverageRanges::ranges_t::iterator     rangePtr
     );
 
     virtual void putCoverageNoRange(
-      FILE*       report,
-      std::string symbol
+      FILE*        report,
+      unsigned int number,
+      std::string  symbol
     );
 
     virtual bool PutCoverageLine(
-      FILE*                                      report,
+      FILE*                                           report,
+      unsigned int                                    number,
       Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
       Coverage::CoverageRanges::ranges_t::iterator    ritr
     );
 
     virtual bool PutSizeLine(
-      FILE*                                      report,
+      FILE*                                           report,
+      unsigned int                                    number,
       Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
       Coverage::CoverageRanges::ranges_t::iterator    range
     );

diff -u gcc-testing/rtems-coverage/ReportsText.cc:1.1 gcc-testing/rtems-coverage/ReportsText.cc:1.2
--- gcc-testing/rtems-coverage/ReportsText.cc:1.1	Thu May  6 12:54:13 2010
+++ gcc-testing/rtems-coverage/ReportsText.cc	Fri May  7 13:01:51 2010
@@ -31,7 +31,7 @@
 }
 
 bool ReportsText::PutNoBranchInfo(
-  FILE* report
+  FILE*           report
 )
 {
   fprintf( report, "No branch information found\n" );
@@ -41,6 +41,7 @@
 
 bool ReportsText::PutBranchEntry(
   FILE*   report,
+  unsigned int                                     number,
   Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
   Coverage::CoverageRanges::ranges_t::iterator     rangePtr
 )
@@ -109,8 +110,9 @@
 }
 
 void ReportsText::putCoverageNoRange(
-  FILE*       report,
-  std::string symbol
+  FILE*         report,
+  unsigned int  number,
+  std::string   symbol
 )
 {
       fprintf(
@@ -129,6 +131,7 @@
 
 bool ReportsText::PutCoverageLine(
   FILE*                                       report,
+  unsigned int                                     number,
   Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
   Coverage::CoverageRanges::ranges_t::iterator    ritr
 )
@@ -181,6 +184,7 @@
 
 bool  ReportsText::PutSizeLine(
   FILE*                                      report,
+  unsigned int                                     number,
   Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
   Coverage::CoverageRanges::ranges_t::iterator    range
 )
@@ -195,4 +199,6 @@
   return true;
 }
 
+
+
 }

diff -u /dev/null gcc-testing/rtems-coverage/covoar.css:1.1
--- /dev/null	Fri May  7 13:10:04 2010
+++ gcc-testing/rtems-coverage/covoar.css	Fri May  7 13:01:51 2010
@@ -0,0 +1,288 @@
+body { 
+    background: rgb(253,253,253);
+    color: rgb(0,0,0);
+    font-family: helvetica, sans-serif;
+    font-size: 1em;
+    line-height: 1.4;
+    margin: 5px, 5px, 5px, 5px;
+    padding: 0;
+}
+
+a:link { 
+    color: rgb(180, 50, 50);
+    font-family: helvetica, sans-serif;
+    font-size: 1.0em;
+}
+
+a:visited { 
+    color: purple; 
+    font-family: helvetica, sans-serif;
+    font-size: 1.0em;
+}
+
+a:hover {
+    color: rgb(0, 0, 0);
+    font-family: helvetica, sans-serif;
+    font-size: 1.0em;
+}
+
+a:active {
+    color: red; 
+    font-family: helvetica, sans-serif;
+    font-size: 1.0em;
+}
+
+.code {
+    background: rgb(255,255,255);
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    font-weight: bold;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.codeExecuted {
+    background: rgb(255,255,255);
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.codeNotExecuted {
+    background: rgb(255,255,255);
+    color: red;
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.codeAlwaysTaken {
+    background: rgb(255,255,255);
+    color: green;
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.codeNeverTaken {
+    background: rgb(255,255,255);
+    color: blue;
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.branchesEven {
+    background: rgb(255,255,255);
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.branchesOdd {
+    background: yellow;
+    font-family: courier, sans-serif;
+    font-size: 0.9em;
+    line-height: 0.9;
+    margin-top: 0.0;
+    margin-bottom: 0.4em;
+    text-align: left;
+    padding-right: 10px;
+}
+
+.covoar-table {
+    border-collapse: none;
+    background:black;
+    border:1px solid black;
+}
+
+.covoar-th {
+    text-align: center;
+}
+
+.covoar-tr-first {
+    color: #F8F8F8;
+    background: #A4BC92;
+}
+
+.covoar-tr-odd {
+    background: #CBE4B1;
+}
+
+.covoar-tr-even {
+    background: #DBE5C6;
+}
+
+.heading {
+    background: rgb(250,250,250);
+    background-image: url("http://www.rtems.org/logos/rtems_logo.jpg");
+    background-repeat: no-repeat;
+    color: rgb(55,55,55);
+    font-size: 1.5em;
+    height: 140px;
+    padding-top: 20px;
+    padding-left: 300px;
+}
+
+.heading-title {
+    text-align:  center;
+    color: rgb(0,0,0);
+    font-size: 0.9em;
+    font-weight: bold;
+    padding-top: 5px;
+    padding-left: 0px;
+    text-align:  center;
+    width: 100%;
+}
+
+.datetime {
+    color: rgb(55,55,55);
+    font-size: 0.8em;
+    padding-top: 5px;
+    padding-left: 0px;
+    text-align:  center;
+    width: 100%;
+}
+
+.info {
+    color: rgb(55,55,55);
+    font-size: 0.6em;
+    padding-top: 5px;
+    padding-left: 00px;
+    text-align:  center;
+    width: 100%;
+}
+
+.stats-table {
+    background: rgb(225,225,225);
+    font-size: 0.9em;
+    border: 1px solid rgb(200, 200, 200);
+    padding: 0;
+    margin-top: 3px;
+    margin-left: 10px;
+    width: 70%;
+}
+
+.stats-table-target {
+    background: rgb(243,243,243);
+    font-size: 1.2em;
+    padding-left: 10px;
+    text-align: left;
+}
+
+.stats-target-results {
+    background: rgb(243,243,243);
+    font-size: 0.9em;
+    text-align: right;
+    padding-right: 10px;
+}
+
+.stats-target-good {
+    background: rgb(30,230,30);
+    font-size: 0.9em;
+    text-align: right;
+    padding-right: 10px;
+}
+
+.stats-target-good {
+    background: rgb(50,180,50);
+    color: rgb(230,230,230);
+    font-size: 0.9em;
+    text-align: center;
+    padding-right: 10px;
+}
+
+.stats-target-bad {
+    background: rgb(180,50,50);
+    color: rgb(230,230,230);
+    font-size: 0.9em;
+    text-align: center;
+    padding-right: 10px;
+}
+
+.stats-table-top {
+    background: rgb(243,243,243);
+    color: rgb(0,0,0);
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.stats-table-row {
+    background: rgb(253,253,253);
+    font-size: 0.9em;
+    padding: 1px;
+    text-align: right;
+}
+
+.error-table {
+    font-size: 0.9em;
+    border: 1px solid rgb(200, 200, 200);
+    padding: 0;
+    margin-left: 10px;
+    width: 96%;
+}
+
+.error-table-top {
+    background: rgb(225,225,225);
+    color: rgb(0,0,0);
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.error-table-on {
+    background: rgb(225,225,225);
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.error-table-off {
+    background: rgb(253,253,253);
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.error-table-dups {
+    text-align: right;
+    padding-right: 2px;
+}
+
+.error-table-error {
+    background: rgb(255,150,150);
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.error-table-warning {
+    font-size: 0.9em;
+    padding-left: 2px;
+}
+
+.navbar {
+    margin-left: auto;
+    margin-right: auto;
+    margin-top: 10px;
+    width: 40%;
+}



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100507/7b5d4398/attachment.html>


More information about the vc mailing list