Changeset d7f433a in rtems-testing


Ignore:
Timestamp:
May 10, 2010, 6:10:16 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
9373b94
Parents:
a19fec9
Message:

2010-05-10 Jennifer Averett <Jennifer.Averett@…>

Location:
rtems-coverage
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    ra19fec9 rd7f433a  
     12010-05-10      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * CoverageRanges.cc, CoverageRanges.h, ReportsBase.cc, ReportsBase.h,
     4        ReportsHtml.cc, ReportsHtml.h, ReportsText.cc, ReportsText.h: Added
     5        anchors and links between branch-annotated and uncovered-annotated
     6        reports.
     7
    182010-05-10      Joel Sherrill <joel.sherrilL@OARcorp.com>
    29
  • rtems-coverage/CoverageRanges.cc

    ra19fec9 rd7f433a  
    1111
    1212#include "CoverageRanges.h"
     13#include <stdio.h>
    1314
    1415namespace Coverage {
     
    1617  CoverageRanges::CoverageRanges()
    1718  {
     19    id_m = 0;
    1820  }
    1921
     
    3032    coverageRange_t c;
    3133
     34    id_m++;
     35    c.id          = id_m;
    3236    c.lowAddress  = lowAddressArg;
    3337    c.highAddress = highAddressArg;
     
    3539    set.push_back(c);
    3640  }
     41
     42  uint32_t  CoverageRanges::getId( uint32_t lowAddress )
     43  {
     44    Coverage::CoverageRanges::ranges_t::iterator    ritr;
     45    uint32_t                                        result = 0;
     46
     47    for (ritr =  set.begin() ;
     48         ritr != set.end() ;
     49         ritr++ ) {
     50      if ( ritr->lowAddress == lowAddress ) {
     51        result = ritr->id;
     52        break;
     53      }
     54    }
     55
     56    return result;
     57  }
     58
    3759}
  • rtems-coverage/CoverageRanges.h

    ra19fec9 rd7f433a  
    4343     */
    4444    typedef struct {
     45      uint32_t          id;
    4546      uint32_t          lowAddress;
    4647      std::string       lowSourceLine;
     
    7980      uncoveredReason_t why
    8081    );
     82 
     83
     84    /*!
     85     *  This method returns the index of a range given the low address.
     86     *  Upon failure on finding the adress 0 is returned.
     87     */
     88    uint32_t getId( uint32_t lowAddress );
     89 
     90    protected:
     91
     92      /*!
     93       *  This member variable tracks a unique index for the ranges_t block.
     94       */
     95      uint32_t  id_m;
    8196
    8297  };
  • rtems-coverage/ReportsBase.cc

    ra19fec9 rd7f433a  
    116116  const char* const fileName
    117117) {
    118   FILE*                                           aFile = NULL;
    119   Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
    120   std::list<Coverage::ObjdumpProcessor::objdumpLine_t>* theInstructions;
     118  FILE*                                                          aFile = NULL;
     119  Coverage::DesiredSymbols::symbolSet_t::iterator                ditr;
     120  Coverage::CoverageRanges*                                      theBranches;
     121  Coverage::CoverageRanges*                                      theRanges;
     122  Coverage::CoverageMapBase*                                     theCoverageMap = NULL;
     123  uint32_t                                                       bAddress = 0;
     124  AnnotatedLineState_t                                           state;
     125  std::list<Coverage::ObjdumpProcessor::objdumpLine_t>*          theInstructions;
    121126  std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator itr;
    122   Coverage::CoverageMapBase*                      theCoverageMap = NULL;
    123   uint32_t                                        bAddress = 0;
    124   AnnotatedLineState_t                            state;
    125127
    126128  aFile = OpenAnnotatedFile(fileName);
     
    148150    bAddress = ditr->second.baseAddress;
    149151    theInstructions = &(ditr->second.instructions);
     152    theRanges = ditr->second.uncoveredRanges;
     153    theBranches = ditr->second.uncoveredBranches;
    150154
    151155    // Add annotations to each line where necessary
     
    154158         itr++ ) {
    155159
     160      uint32_t     id = 0;
    156161      std::string  annotation = "";
    157162      std::string  line;
     
    162167      if ( itr->isInstruction ) {
    163168        if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
    164           annotation = "<== NOT EXECUTED";
     169          annotation = "<== NOT EXECUTED";           
    165170          state = A_NEVER_EXECUTED;
     171          id = theRanges->getId( itr->address );
    166172        } else if (theCoverageMap->isBranch( itr->address - bAddress )) {
     173          id = theBranches->getId( itr->address );
    167174          if (theCoverageMap->wasAlwaysTaken( itr->address - bAddress )){
    168175            annotation = "<== ALWAYS TAKEN";
     
    180187      line = textLine + annotation;
    181188     
    182       PutAnnotatedLine( aFile, state, line);
     189      PutAnnotatedLine( aFile, state, line, id);
    183190    }
    184191  }
  • rtems-coverage/ReportsBase.h

    ra19fec9 rd7f433a  
    203203      FILE*                aFile,
    204204      AnnotatedLineState_t state,
    205       std::string          line
     205      std::string          line,
     206      uint32_t             id
    206207    )=0;
    207208
  • rtems-coverage/ReportsHtml.cc

    ra19fec9 rd7f433a  
    6868  fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
    6969  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
     70  fprintf( aFile, "<th class=\"covoar-th\">Index</th>\n");
    7071  fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
    7172  fprintf( aFile, "<th class=\"covoar-th\">Line</th>\n");
     
    104105  fprintf( aFile, "<tbody class=\"covoar-tbody\">\n");
    105106  fprintf( aFile, "<tr class=\"covoar-tr covoar-tr-first\">\n");
     107  fprintf( aFile, "<th class=\"covoar-th\">Index</th>\n");
    106108  fprintf( aFile, "<th class=\"covoar-th\">Symbol</th>\n");
    107109  fprintf( aFile, "<th class=\"covoar-th\">Range</th>\n");
     
    142144  FILE*                aFile,
    143145  AnnotatedLineState_t state,
    144   std::string          line
     146  std::string          line,
     147  uint32_t             id
    145148)
    146149{
     
    156159      break;
    157160    case  A_NEVER_EXECUTED:
    158       stateText = "</pre>\n<pre class=\"codeNotExecuted\">\n";
     161      stateText = "</pre>\n";
     162      stateText += "<a name=\"notExecuted";
     163      stateText += ('0' + id);
     164      stateText += "\"></a><pre class=\"codeNotExecuted\">\n";
    159165      break;
    160166    case  A_BRANCH_TAKEN:
    161       stateText = "</pre>\n<pre class=\"codeAlwaysTaken\">\n";
     167      stateText = "</pre>\n";
     168      stateText += "<a name=\"branches";
     169      stateText += ('0' + id);
     170      stateText += "\"></a><pre class=\"codeAlwaysTaken\">\n";
    162171      break;
    163172    case  A_BRANCH_NOT_TAKEN:
    164       stateText = "</pre>\n<pre class=\"codeNeverTaken\">\n";
     173      stateText = "</pre>\n";
     174      stateText += "<a name=\"branches";
     175      stateText += ('0' + id);
     176      stateText += "\"></a><pre class=\"codeNeverTaken\">\n";
    165177      break;
    166178    default:
     
    215227  else
    216228    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
     229
     230  // index
     231  fprintf(
     232    report,
     233    "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#branches%d\">%d</td>\n",
     234     rangePtr->id,
     235     rangePtr->id
     236   );
    217237
    218238  // symbol
     
    310330    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
    311331
     332  // index
     333  fprintf(
     334    report,
     335    "<td class=\"covoar-td\" align=\"center\"></td>\n"
     336   );
     337
    312338  // symbol
    313339  fprintf(
     
    368394  else
    369395    fprintf( report, "<tr class=\"covoar-tr covoar-tr-odd\">\n");
     396
     397  // index
     398  fprintf(
     399    report,
     400    "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#notExecuted%d\">%d</td>\n",
     401     rangePtr->id,
     402     rangePtr->id
     403   );
    370404
    371405  // symbol
  • rtems-coverage/ReportsHtml.h

    ra19fec9 rd7f433a  
    9090      FILE*                aFile,
    9191      AnnotatedLineState_t state,
    92       std::string          line
     92      std::string          line,
     93      uint32_t             id
    9394    );
    9495
  • rtems-coverage/ReportsText.cc

    ra19fec9 rd7f433a  
    2525  FILE*                aFile,
    2626  AnnotatedLineState_t state,
    27   std::string          line
     27  std::string          line,
     28  uint32_t             id
    2829)
    2930{
     
    142143    report,
    143144    "============================================\n"
     145    "Index         : %d\n"
    144146    "Symbol        : %s (0x%x)\n"
    145147    "Starting Line : %s (0x%x)\n"
    146148    "Ending Line   : %s (0x%x)\n"
    147149    "Size in Bytes : %d\n\n",
     150    ritr->id,
    148151    ditr->first.c_str(),
    149152    ditr->second.baseAddress,
  • rtems-coverage/ReportsText.h

    ra19fec9 rd7f433a  
    6060      FILE*                aFile,
    6161      AnnotatedLineState_t state,
    62       std::string          line
     62      std::string          line,
     63      uint32_t             id
    6364    );
    6465
Note: See TracChangeset for help on using the changeset viewer.