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

rtems-vc at rtems.org rtems-vc at rtems.org
Wed May 12 14:10:03 UTC 2010


 *joel*:
2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* covoar.cc: Fix off by one bug.

M  1.227  rtems-coverage/ChangeLog
M   1.21  rtems-coverage/covoar.cc

diff -u gcc-testing/rtems-coverage/ChangeLog:1.226 gcc-testing/rtems-coverage/ChangeLog:1.227
--- gcc-testing/rtems-coverage/ChangeLog:1.226	Wed May 12 07:26:28 2010
+++ gcc-testing/rtems-coverage/ChangeLog	Wed May 12 08:33:30 2010
@@ -1,5 +1,9 @@
 2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
+	* covoar.cc: Fix off by one bug.
+
+2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
 	* Target_sparc.cc: Size of nop is 4 not 2.
 
 2010-05-11	Joel Sherrill <joel.sherrilL at OARcorp.com>

diff -u gcc-testing/rtems-coverage/covoar.cc:1.20 gcc-testing/rtems-coverage/covoar.cc:1.21
--- gcc-testing/rtems-coverage/covoar.cc:1.20	Tue May 11 17:47:48 2010
+++ gcc-testing/rtems-coverage/covoar.cc	Wed May 12 08:33:30 2010
@@ -402,7 +402,7 @@
 
         endAddress = itr->second.size - 1;
 
-        for (a = 0; a < endAddress; a++) {
+        for (a = 0; a <= endAddress; a++) {
           totalBytes++;
           if (!theCoverageMap->wasExecuted( a ))
             notExecuted++;


 *joel*:
2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>

	* ReportsHtml.cc, ReportsHtml.h: Add separate html file for each
	explanation and link to it from the tables.

M  1.228  rtems-coverage/ChangeLog
M    1.4  rtems-coverage/ReportsHtml.h
M    1.5  rtems-coverage/ReportsHtml.cc

diff -u gcc-testing/rtems-coverage/ChangeLog:1.227 gcc-testing/rtems-coverage/ChangeLog:1.228
--- gcc-testing/rtems-coverage/ChangeLog:1.227	Wed May 12 08:33:30 2010
+++ gcc-testing/rtems-coverage/ChangeLog	Wed May 12 09:04:48 2010
@@ -1,5 +1,10 @@
 2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
+	* ReportsHtml.cc, ReportsHtml.h: Add separate html file for each
+	explanation and link to it from the tables.
+
+2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>
+
 	* covoar.cc: Fix off by one bug.
 
 2010-05-12	Joel Sherrill <joel.sherrilL at OARcorp.com>

diff -u gcc-testing/rtems-coverage/ReportsHtml.h:1.3 gcc-testing/rtems-coverage/ReportsHtml.h:1.4
--- gcc-testing/rtems-coverage/ReportsHtml.h:1.3	Tue May 11 16:21:25 2010
+++ gcc-testing/rtems-coverage/ReportsHtml.h	Wed May 12 09:04:48 2010
@@ -15,6 +15,7 @@
 
 #include <stdint.h>
 #include "ReportsBase.h"
+#include "Explanations.h"
 
 namespace Coverage {
 
@@ -130,7 +131,11 @@
       const char* const fileName
     );
 
-};
+    virtual bool WriteExplationFile(
+      const char*                  fileName,
+      const Coverage::Explanation* explanation
+    );
+  };
 
 }
 

diff -u gcc-testing/rtems-coverage/ReportsHtml.cc:1.4 gcc-testing/rtems-coverage/ReportsHtml.cc:1.5
--- gcc-testing/rtems-coverage/ReportsHtml.cc:1.4	Tue May 11 16:21:25 2010
+++ gcc-testing/rtems-coverage/ReportsHtml.cc	Wed May 12 09:04:48 2010
@@ -10,560 +10,578 @@
 #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():
+    ReportsBase()
+  {
+    reportExtension_m = ".html";
+  }
 
-ReportsHtml::~ReportsHtml()
-{
-}
+  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");
+  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"
+      "<meta http-equiv=\"Content-Language\" content=\"English\" >\n"
+      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" >\n"
+      "<link rel=\"stylesheet\" type=\"text/css\" href=\"covoar.css\" media=\"screen\" >\n"
+      "<body>\n"
+      "<pre class=\"code\">\n"
+    );
 
-  lastState_m = A_SOURCE;
-  fprintf( aFile, "<pre class=\"code\">\n" );
 
-  return aFile;
-}
+    return aFile;
+  }
 
-FILE* ReportsHtml::OpenBranchFile(
-  const char* const fileName,
-  bool              hasBranches
-)
-{
-  FILE *aFile;
+  FILE* ReportsHtml::OpenBranchFile(
+    const char* const fileName,
+    bool              hasBranches
+  )
+  {
+    FILE *aFile;
 
-  // Open the file
-  aFile = OpenFile(fileName);
+    // Open the file
+    aFile = OpenFile(fileName);
 
-  if ( hasBranches ) {
-    // 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\">Index</th>\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");
+    if ( hasBranches ) {
+      // Put header information into the file
+      fprintf(
+        aFile,
+        "<table class=\"covoar-table\">\n"
+        "<tbody class=\"covoar-tbody\">\n"
+        "<tr class=\"covoar-tr covoar-tr-first\">\n"
+        "<th class=\"covoar-th\">Index</th>\n"
+        "<th class=\"covoar-th\">Symbol</th>\n"
+        "<th class=\"covoar-th\">Line</th>\n"
+        "<th class=\"covoar-th\">Size</th>\n"
+        "<th class=\"covoar-th\">Size</th>\n"
+        "<th class=\"covoar-th\">Reason</th>\n"
+        "<th class=\"covoar-th\">Classification</th>\n"
+        "<th class=\"covoar-th\">Explanation</th>\n"
+        "</tr>\n"
+
+        "<tr class=\"covoar-tr covoar-tr-first\">\n"
+        "<th class=\"covoar-th\"></th>\n"
+        "<th class=\"covoar-th\"></th>\n"
+        "<th class=\"covoar-th\">Bytes</th>\n"
+        "<th class=\"covoar-th\">Instructions</th>\n"
+        "<th class=\"covoar-th\"></th>\n"
+        "<th class=\"covoar-th\"></th>\n"
+        "<th class=\"covoar-th\"></th>\n"
+        "</tr>\n"
+      );
+    }
+   
+    return aFile;
   }
- 
-  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\">Index</th>\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");
+  FILE*  ReportsHtml::OpenCoverageFile(
+    const char* const fileName
+  )
+  {
+    FILE *aFile;
 
-  return aFile;
-}
+    // Open the file
+    aFile = OpenFile(fileName);
 
-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");
+    // Put header information into the file
+    fprintf(
+      aFile,
+      "<table class=\"covoar-table\">\n"
+      "<tbody class=\"covoar-tbody\">\n"
+      "<tr class=\"covoar-tr covoar-tr-first\">\n"
+      "<th class=\"covoar-th\">Index</th>\n"
+      "<th class=\"covoar-th\">Symbol</th>\n"
+      "<th class=\"covoar-th\">Range</th>\n"
+      "<th class=\"covoar-th\">Size</br>Bytes</th>\n"
+      "<th class=\"covoar-th\">Size</br>Instructions</th>\n"
+      "<th class=\"covoar-th\">Classification</th>\n"
+      "<th class=\"covoar-th\">Explanation</th>\n"
+      "</tr>\n"
+    );
 
-  return aFile;
-}
+    return aFile;
+  }
 
-void ReportsHtml::PutAnnotatedLine( 
-  FILE*                aFile, 
-  AnnotatedLineState_t state, 
-  std::string          line, 
-  uint32_t             id 
-)
-{
-  std::string stateText;
-  char        number[10];
-
-  
-  sprintf(number,"%d", id);
-
-  // 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";
-      stateText += "<a name=\"range";
-      stateText += number;
-      stateText += "\"></a><pre class=\"codeNotExecuted\">\n";
-      break;
-    case  A_BRANCH_TAKEN:
-      stateText = "</pre>\n";
-      stateText += "<a name=\"range";
-      stateText += number;
-      stateText += "\"></a><pre class=\"codeAlwaysTaken\">\n";
-      break;
-    case  A_BRANCH_NOT_TAKEN:
-      stateText = "</pre>\n";
-      stateText += "<a name=\"range";
-      stateText += number;
-      stateText += "\"></a><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++ )
+  FILE*  ReportsHtml::OpenSizeFile(
+    const char* const fileName
+  )
   {
-    if ( line[i] == '<' )
-      fprintf( aFile, "<" );
-    else
-      fprintf( aFile, "%c", line[i] );
+    FILE *aFile;
+
+    // Open the file
+    aFile = OpenFile(fileName);
+
+    // Put header information into the file
+    fprintf(
+      aFile,
+      "<table class=\"covoar-table\">\n"
+      "<tbody class=\"covoar-tbody\">\n"
+      "<tr class=\"covoar-tr covoar-tr-first\">\n"
+      "<th class=\"covoar-th\">Size</th>\n"
+      "<th class=\"covoar-th\">Symbol</th>\n"
+      "<th class=\"covoar-th\">File</th>\n"
+      "</tr>\n"
+    );
+    return aFile;
   }
-  fprintf( aFile, "\n");
-}
 
-bool ReportsHtml::PutNoBranchInfo(
-  FILE* report
-)
-{
-  if ( BranchInfoAvailable )
-    fprintf( report, "All branch paths taken.\n" );
-  else
-    fprintf( report, "No branch information found.\n" );
-  return true;
-}
+  void ReportsHtml::PutAnnotatedLine( 
+    FILE*                aFile, 
+    AnnotatedLineState_t state, 
+    std::string          line, 
+    uint32_t             id 
+  )
+  {
+    std::string stateText;
+    char        number[10];
 
-bool ReportsHtml::PutBranchEntry(
-  FILE*                                            report,
-  unsigned int                                     count,
-  Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
-  Coverage::CoverageRanges::ranges_t::iterator     rangePtr
-)
-{
-  const Coverage::Explanation* explanation;
+    
+    sprintf(number,"%d", id);
 
+    // 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";
+        stateText += "<a name=\"range";
+        stateText += number;
+        stateText += "\"></a><pre class=\"codeNotExecuted\">\n";
+        break;
+      case  A_BRANCH_TAKEN:
+        stateText = "</pre>\n";
+        stateText += "<a name=\"range";
+        stateText += number;
+        stateText += "\"></a><pre class=\"codeAlwaysTaken\">\n";
+        break;
+      case  A_BRANCH_NOT_TAKEN:
+        stateText = "</pre>\n";
+        stateText += "<a name=\"range";
+        stateText += number;
+        stateText += "\"></a><pre class=\"codeNeverTaken\">\n";
+        break;
+      default:
+        fprintf(stderr, "ERROR:  ReportsHtml::PutAnnotatedLine Unknown state\n");
+        exit( -1 );
+        break;
+    }
 
-  // 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");
+    // 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;
+    }
 
-  // index
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%d</td>\n",
-     rangePtr->id,
-     rangePtr->id
-   );
+    // 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");
+  }
 
-  // symbol
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
-    symbolPtr->first.c_str()
-  );
+  bool ReportsHtml::PutNoBranchInfo(
+    FILE* report
+  )
+  {
+    if ( BranchInfoAvailable )
+      fprintf( report, "All branch paths taken.\n" );
+    else
+      fprintf( report, "No branch information found.\n" );
+    return true;
+  }
 
-  // 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
-  );
+  bool ReportsHtml::PutBranchEntry(
+    FILE*                                            report,
+    unsigned int                                     count,
+    Coverage::DesiredSymbols::symbolSet_t::iterator  symbolPtr,
+    Coverage::CoverageRanges::ranges_t::iterator     rangePtr
+  )
+  {
+    const Coverage::Explanation* explanation;
 
-  // Size in instructions
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\">XXX</td>\n"
-  ); 
+    // 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");
 
-  // 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)
+    // index
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">Never Taken</td>\n"
-    );
+      "<td class=\"covoar-td\" align=\"center\">"
+      "<a href =\"annotated.html#range%d\">%d</td>\n",
+      rangePtr->id,
+      rangePtr->id
+     );
 
-  // See if an explanation is available
-  explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
-  if ( !explanation ) {
+    // symbol
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
+      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+      symbolPtr->first.c_str()
     );
+
+    // line
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">No Explanation</td>\n"
+      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+      rangePtr->lowSourceLine.c_str()
     );
-  } else {
+    
+    // Size in bytes
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
-      explanation->classification.c_str()
+      "<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\">FILL ME IN</td>\n"
-    );
-#if 0
-    for ( unsigned int i=0 ;
-          i < explanation->explanation.size();
-          i++) {
-      fprintf(
+      "<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,
-        "%s\n",
-        explanation->explanation[i].c_str()
+        "<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\">No Explanation</td>\n"
+      );
+    } else {
+      char explanationFile[48];
+
+      sprintf( explanationFile, "explanation%d.html", rangePtr->id );
+      fprintf( 
+        report, 
+        "<td class=\"covoar-td\" align=\"center\">%s</td>\n"
+        "<td class=\"covoar-td\" align=\"center\">"
+        "<a href=\"%s\">Explanation</a></td>\n",
+        explanation->classification.c_str(),
+        explanationFile
+      );
+      WriteExplationFile( explanationFile, explanation );
     }
-#endif
+
+    fprintf( report, "</tr>\n");
+
+    return true;
   }
 
-  fprintf( report, "</tr>\n");
+  bool ReportsHtml::WriteExplationFile(
+    const char*                  fileName,
+    const Coverage::Explanation* explanation
+  )
+  {
+    FILE* report;
 
-  return true;
-}
+    report = OpenFile( fileName );
 
-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");
-
-  // index
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\"></td>\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"
-  );
+    for ( unsigned int i=0 ; i < explanation->explanation.size(); i++) {
+      fprintf(
+	report,
+	"%s\n",
+	explanation->explanation[i].c_str()
+      );
+    }
+    CloseFile( report );
+    return true;
+  }
 
-  fprintf( report, "</tr>\n");
-}
+  void ReportsHtml::putCoverageNoRange(
+    FILE*         report,
+    unsigned int  count,
+    std::string   symbol
+  )
+  {
 
-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");
-
-  // index
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%d</td>\n",
-     rangePtr->id,
-     rangePtr->id
-   );
-
-  // 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
-  );
+    // 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");
+
+    // index
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\"></td>\n"
+     );
 
-  // Size in instructions
-  fprintf( 
-    report, 
-    "<td class=\"covoar-td\" align=\"center\">XXX</td>\n"
-  ); 
+    // symbol
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
+      symbol.c_str()
+    );
 
-  // See if an explanation is available
-  explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
-  if ( !explanation ) {
+    // starting line
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\"></td>\n"
+     );
+     
+    // Size in bytes
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
+      "<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\">No Explanation</td>\n"
+      "<td class=\"covoar-td\" align=\"center\"></td>\n"
     );
-  } else {
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
-      explanation->classification.c_str()
+      "<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");
+
+    // index
     fprintf( 
       report, 
-      "<td class=\"covoar-td\" align=\"center\">FILL ME IN</td>\n"
+      "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%d</td>\n",
+       rangePtr->id,
+       rangePtr->id
+     );
+
+    // 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
+    );
 
-    #if  0
-    for ( unsigned int i=0; i < explanation->explanation.size(); i++) {
-      fprintf( report,"%s\n", explanation->explanation[i].c_str() );
+    // 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 {
+      char explanationFile[48];
+
+      sprintf( explanationFile, "explanation%d.html", rangePtr->id );
+      fprintf( 
+        report, 
+        "<td class=\"covoar-td\" align=\"center\">%s</td>\n"
+        "<td class=\"covoar-td\" align=\"center\">"
+        "<a href=\"%s\">Explanation</a></td>\n",
+        explanation->classification.c_str(),
+        explanationFile
+      );
+      WriteExplationFile( explanationFile, explanation );
     }
-    #endif
+
+    fprintf( report, "</tr>\n");
+
+    return true;
   }
 
-  fprintf( report, "</tr>\n");
+  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");
 
-  return true;
-}
+    // size
+    fprintf( 
+      report, 
+      "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
+      range->highAddress - range->lowAddress + 1
+    );
 
-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()
-  );
+    // 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>");
+    return true;
+  }
 
-  CloseFile(aFile);
-}
+  void ReportsHtml::CloseAnnotatedFile(
+    FILE*  aFile
+  )
+  {
+    fprintf(
+      aFile,
+      "</pre>\n"
+      "</body>\n"
+      "</html>"
+    );
 
-void ReportsHtml::CloseBranchFile(
-  FILE*  aFile,
-  bool   hasBranches
-)
-{
-  if ( hasBranches ) {
-    fprintf( aFile, "</tbody>\n" );
-    fprintf( aFile, "</table>\n" );
+    CloseFile(aFile);
   }
-  fprintf( aFile, "</pre>\n" );
-  fprintf( aFile, "</body>\n");
-  fprintf( aFile, "</html>");
 
-  CloseFile(aFile);
-}
+  void ReportsHtml::CloseBranchFile(
+    FILE*  aFile,
+    bool   hasBranches
+  )
+  {
+    if ( hasBranches ) {
+      fprintf(
+        aFile,
+        "</tbody>\n"
+        "</table>\n" 
+      );
+    }
+    fprintf(
+      aFile,
+      "</pre>\n" 
+      "</body>\n"
+      "</html>"
+    );
 
-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);
+  }
 
-  CloseFile(aFile);
-}
+  void ReportsHtml::CloseCoverageFile(
+    FILE*  aFile
+  )
+  {
+    fprintf(
+      aFile,
+      "</tbody>\n" 
+      "</table>\n" 
+      "</pre>\n" 
+      "</body>\n"
+      "</html>"
+    );
 
-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);
+  }
 
-  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 );
+  }
 
 }



--

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/20100512/a0255086/attachment-0001.html>


More information about the vc mailing list