Changeset cb018bc in rtems-tools


Ignore:
Timestamp:
Aug 26, 2017, 8:15:53 AM (22 months ago)
Author:
Hermann Felbinger <hermann19829@…>
Branches:
master
Children:
9534157
Parents:
b857151
git-author:
Hermann Felbinger <hermann19829@…> (08/26/17 08:15:53)
git-committer:
Chris Johns <chrisj@…> (08/29/17 08:05:51)
Message:

covoar: Add information to improve diagnostics.

Location:
tester/covoar
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • tester/covoar/CoverageMap.cc

    rb857151 rcb018bc  
    1111
    1212  CoverageMap::CoverageMap(
    13     uint32_t low,
    14     uint32_t high
    15   ) : CoverageMapBase(low, high)
     13    const std::string& exefileName,
     14    uint32_t           low,
     15    uint32_t           high
     16  ) : CoverageMapBase(exefileName, low, high)
    1617  {
    1718  }
  • tester/covoar/CoverageMap.h

    rb857151 rcb018bc  
    2828     */
    2929    CoverageMap(
    30       uint32_t low,
    31       uint32_t high
     30      const std::string& exefileName,
     31      uint32_t           low,
     32      uint32_t           high
    3233    );
    3334
  • tester/covoar/CoverageMapBase.cc

    rb857151 rcb018bc  
    1717
    1818  CoverageMapBase::CoverageMapBase(
    19     uint32_t low,
    20     uint32_t high
     19    const std::string& exefileName,
     20    uint32_t           low,
     21    uint32_t           high
    2122  )
    2223  {
     
    2425    AddressRange_t range;
    2526
     27    range.fileName    = exefileName;
    2628    range.lowAddress  = low;
    2729    range.highAddress = high;
  • tester/covoar/CoverageMapBase.h

    rb857151 rcb018bc  
    2929    typedef struct {
    3030      /*!
     31       *  This is the file from which this originated.
     32       */
     33      std::string fileName;
     34
     35      /*!
    3136       *  This is the low address of the address map range.
    3237       */
     
    4954     *  This method constructs a CoverageMapBase instance.
    5055     *
     56     *  @param[in] exefileName specifies the executable this originated in
    5157     *  @param[in] low specifies the lowest address of the coverage map
    5258     *  @param[in] high specifies the highest address of the coverage map
    5359     */
    5460    CoverageMapBase(
    55       uint32_t low,
    56       uint32_t high
     61      const std::string& exefileName,
     62      uint32_t           low,
     63      uint32_t           high
    5764    );
    5865
  • tester/covoar/DesiredSymbols.cc

    rb857151 rcb018bc  
    336336
    337337  void DesiredSymbols::createCoverageMap(
     338    const std::string& exefileName,
    338339    const std::string& symbolName,
    339340    uint32_t           size
     
    364365      if (itr->second.stats.sizeInBytes != size) {
    365366
     367        // Changed ERROR to INFO because size mismatch is not treated as
     368        // error anymore.
     369        // Set smallest size as size and continue.
     370        // Update value for longer byte size.
     371        // 2015-07-22
    366372        fprintf(
    367373          stderr,
    368           "ERROR: DesiredSymbols::createCoverageMap - Attempt to create "
    369           "unified coverage maps for %s with different sizes (%d != %d)\n",
     374          "INFO: DesiredSymbols::createCoverageMap - Attempt to create "
     375          "unified coverage maps for %s with different sizes (%s/%d != %s/%d)\n",
     376
    370377          symbolName.c_str(),
     378          exefileName.c_str(),
    371379          itr->second.stats.sizeInBytes,
     380          itr->second.sourceFile->getFileName().c_str(),
    372381          size
    373382        );
     383
    374384        if ( itr->second.stats.sizeInBytes < size )
    375385          itr->second.stats.sizeInBytes = size;
    376386        else
    377387          size = itr->second.stats.sizeInBytes;
    378         // exit( -1 );
    379388      }
    380389    }
     
    385394      highAddress = size - 1;
    386395
    387       aCoverageMap = new CoverageMap( 0, highAddress );
     396      aCoverageMap = new CoverageMap( exefileName, 0, highAddress );
    388397      if (!aCoverageMap) {
    389398
     
    391400          stderr,
    392401          "ERROR: DesiredSymbols::createCoverageMap - Unable to allocate "
    393           "coverage map for %s\n",
     402          "coverage map for %s:%s\n",
     403          exefileName.c_str(),
    394404          symbolName.c_str()
    395405        );
     
    654664    // Ensure that the source and destination coverage maps
    655665    // are the same size.
     666    // Changed from ERROR msg to INFO, because size mismatch is not
     667    // treated as error anymore. 2015-07-20
    656668    dMapSize = itr->second.stats.sizeInBytes;
    657669    sBaseAddress = sourceCoverageMap->getFirstLowAddress();
     
    661673      fprintf(
    662674        stderr,
    663         "ERROR: DesiredSymbols::mergeCoverageMap - Unable to merge "
     675        "INFO: DesiredSymbols::mergeCoverageMap - Unable to merge "
    664676        "coverage map for %s because the sizes are different\n",
    665677        symbolName.c_str()
    666678      );
    667679      return;
    668       // exit( -1 );
    669680    }
    670681
  • tester/covoar/DesiredSymbols.h

    rb857151 rcb018bc  
    2121
    2222
    23   /*! 
    24    * 
     23  /*!
     24   *
    2525   *  This class defines the statistics that are tracked.
    2626   */
     
    3535
    3636    /*!
    37      *  This member variable contains the total number of branches where 
     37     *  This member variable contains the total number of branches where
    3838     *  one or more paths were executed.
    3939     */
     
    5656     */
    5757    uint32_t sizeInBytes;
    58    
     58
    5959    /*!
    6060     *  This member contains the size in Bytes.
     
    9494    /*!
    9595     *  This method constructs a Statistics instance.
    96      */   
     96     */
    9797     Statistics():
    9898       branchesAlwaysTaken(0),
     
    138138    /*!
    139139     *  This member contains the statistics kept on each symbol.
    140      */   
     140     */
    141141    Statistics stats;
    142142
     
    187187
    188188    /*!
    189      *  This variable contains a map of symbol sets for each 
     189     *  This variable contains a map of symbol sets for each
    190190     *  symbol in the system keyed on the symbol name.
    191191     */
    192192    symbolSet_t set;
    193193
    194     /*! 
     194    /*!
    195195     *  This method constructs a DesiredSymbols instance.
    196196     */
    197197    DesiredSymbols();
    198198
    199     /*! 
     199    /*!
    200200     *  This method destructs a DesiredSymbols instance.
    201201     */
     
    204204    /*!
    205205     *  This method loops through the coverage map and
    206      *  calculates the statistics that have not already 
     206     *  calculates the statistics that have not already
    207207     *  been filled in.
    208208     */
     
    219219     *  using the specified size.
    220220     *
     221     *  @param[in] exefileName specifies the executable from which the
     222     *             coverage map is being created
    221223     *  @param[in] symbolName specifies the symbol for which to create
    222224     *             a coverage map
     
    224226     */
    225227    void createCoverageMap(
     228      const std::string& exefileName,
    226229      const std::string& symbolName,
    227230      uint32_t           size
     
    317320    /*!
    318321     *  This member contains the statistics kept on each symbol.
    319      */   
     322     */
    320323    Statistics stats;
    321324
  • tester/covoar/ExecutableInfo.cc

    rb857151 rcb018bc  
    9090
    9191  CoverageMapBase* ExecutableInfo::createCoverageMap (
     92    const std::string& fileName,
    9293    const std::string& symbolName,
    9394    uint32_t           lowAddress,
     
    100101    itr = coverageMaps.find( symbolName );
    101102    if ( itr == coverageMaps.end() ) {
    102       theMap = new CoverageMap( lowAddress, highAddress );
     103      theMap = new CoverageMap( fileName, lowAddress, highAddress );
    103104      coverageMaps[ symbolName ] = theMap;
    104105    } else {
  • tester/covoar/ExecutableInfo.h

    rb857151 rcb018bc  
    9494     *  This method creates a coverage map for the specified symbol.
    9595     *
     96     *  @param[in] exefileName specifies the source of the information
    9697     *  @param[in] symbolName specifies the name of the symbol
    9798     *  @param[in] lowAddress specifies the low address of the coverage map
     
    101102     */
    102103    CoverageMapBase* createCoverageMap (
     104      const std::string& exefileName,
    103105      const std::string& symbolName,
    104106      uint32_t           lowAddress,
  • tester/covoar/ObjdumpProcessor.cc

    rb857151 rcb018bc  
    44 *  This file contains the implementation of the functions supporting
    55 *  the reading of an objdump output file and adding nops to a
    6  *  coverage map. 
     6 *  coverage map.
    77 */
    88
     
    9898    // Create a coverage map for the symbol.
    9999    aCoverageMap = executableInfo->createCoverageMap(
    100       symbolName, lowAddress, endAddress
     100      executableInfo->getFileName().c_str(), symbolName, lowAddress, endAddress
    101101    );
    102102
     
    113113      // Create a unified coverage map for the symbol.
    114114      SymbolsToAnalyze->createCoverageMap(
    115         symbolName, endAddress - lowAddress + 1
     115        executableInfo->getFileName().c_str(), symbolName,
     116        endAddress - lowAddress + 1
    116117      );
    117118    }
     
    171172      if ( tmp.find( Library ) != tmp.npos ) {
    172173        // fprintf( stderr, "%s - 0x%08x\n", inLibName, offset );
    173         address = offset; 
     174        address = offset;
    174175        break;
    175176      }
     
    183184
    184185  bool ObjdumpProcessor::IsBranch(
    185     const char *instruction 
    186   )
    187   { 
     186    const char *instruction
     187  )
     188  {
    188189    if ( !TargetInfo ) {
    189190      fprintf(
     
    231232  }
    232233
    233   FILE* ObjdumpProcessor::getFile( std::string fileName ) 
     234  FILE* ObjdumpProcessor::getFile( std::string fileName )
    234235  {
    235236    char               dumpFile[128];
     
    239240
    240241    sprintf( dumpFile, "%s.dmp", fileName.c_str() );
    241      
     242
    242243    // Generate the objdump.
    243244    if (FileIsNewer( fileName.c_str(), dumpFile )) {
     
    260261        exit( -1 );
    261262      }
    262     } 
     263    }
    263264
    264265    // Open the objdump file.
     
    284285      return 0;
    285286    }
    286    
     287
    287288    itr++;
    288289    if (itr == objdumpList.end()) {
Note: See TracChangeset for help on using the changeset viewer.