Changeset 6517cde in rtems-testing


Ignore:
Timestamp:
Dec 1, 2011, 8:24:47 PM (7 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
f045b03
Parents:
ba5d55b
Message:

2011-11-06 Pawel Zagorski <pzagor@…>

  • DesiredSymbols?.cc, ExecutableInfo?.cc, SymbolTable?.cc, covoar.cc: Added methods dumpExecutableInfo( void ) and dumpSymbolTable( void ) that can dump cointainers to stdout for debug purposes. Covoar now accepts aditional command line argument -g GCNOS_LIST with list of xxx.gcno files. If non-empty list is provided gcov outputs will be craeated based on each file in the list.
Location:
covoar
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • covoar/ChangeLog

    rba5d55b r6517cde  
     12011-11-06      Pawel Zagorski <pzagor@agh.edu.pl>
     2
     3        * DesiredSymbols.cc, ExecutableInfo.cc, SymbolTable.cc, covoar.cc:
     4        Added methods dumpExecutableInfo( void ) and dumpSymbolTable( void )
     5        that can dump cointainers to stdout for debug purposes. Covoar now
     6        accepts aditional command line argument -g GCNOS_LIST with list of
     7        xxx.gcno files. If non-empty list is provided gcov outputs will be
     8        craeated based on each file in the list.
     9
    1102011-11-04      Joel Sherrill <joel.sherrill@oarcorp.com>
    211
  • covoar/CoverageMapBase.h

    rba5d55b r6517cde  
    4747     *  This type identifies a list of ranges.
    4848     */
    49     typedef std::list< AddressRange_t > AddressRange;
     49    typedef std::list< AddressRange_t >           AddressRange;
     50    typedef std::list< AddressRange_t >::iterator AddressRangeIterator_t;
    5051
    5152    /*!
  • covoar/DesiredSymbols.cc

    rba5d55b r6517cde  
    7373        inputBuffer2[0] = '\0';
    7474        cStatus = fscanf( sFile, "%s %s", inputBuffer, inputBuffer2 );
    75         //TODO: Store inputBuffer2 value containing symbol source file
    7675        if ( cStatus == EOF ) {
    7776          done = true;
     
    9897
    9998        // Add this to the set of symbols.
    100         else {
     99        else
    101100          set[ inputBuffer ] = *symInfo;
    102         }
    103101      }
    104102    }
     
    463461      "ranges2.tmp"
    464462    );
     463
    465464    if (system( command )) {
    466465      fprintf(
  • covoar/ExecutableInfo.cc

    rba5d55b r6517cde  
    4646      ((*itr).second)->dump();
    4747    }
     48  }
     49
     50  void ExecutableInfo::dumpExecutableInfo( void ){
     51    fprintf( stdout, "\n== Executable info ==\n");
     52    fprintf( stdout, "executableName = %s\n", executableName.c_str());
     53    fprintf( stdout, "libraryName = %s\n", libraryName.c_str());
     54    fprintf( stdout, "loadAddress = %u\n", loadAddress);
     55    theSymbolTable->dumpSymbolTable();
    4856  }
    4957
  • covoar/ExecutableInfo.h

    rba5d55b r6517cde  
    5151     */
    5252    void dumpCoverageMaps( void );
     53
     54    /*!
     55     *  This method prints the contents of Executable info containers
     56     */
     57    void dumpExecutableInfo( void );
    5358
    5459    /*!
  • covoar/Makefile

    rba5d55b r6517cde  
    2525  ExecutableInfo.o \
    2626  Explanations.o \
     27  GcovData.o \
     28  GcovFunctionData.o \
    2729  ObjdumpProcessor.o \
    2830  ReportsBase.o \
     
    126128  DesiredSymbols.h SymbolTable.h
    127129Explanations.o: Explanations.cc Explanations.h
     130GcovData.o: GcovData.h GcovData.cc
     131GcovFunctionData.o: GcovFunctionData.h GcovFunctionData.cc
    128132ObjdumpProcessor.o: ObjdumpProcessor.cc ObjdumpProcessor.h ExecutableInfo.h \
    129133  TargetBase.h TargetFactory.h
  • covoar/SymbolTable.cc

    rba5d55b r6517cde  
    105105  }
    106106
     107  void SymbolTable::dumpSymbolTable( void )
     108  {
     109    symbolInfo                  symbolTable;
     110    symbolInfoIterator_t        symbolIterator;
     111    infoIterator_t              infoIterator;
     112
     113    for (infoIterator = info.begin() ; infoIterator != info.end(); infoIterator++)
     114    {
     115      for (symbolIterator = infoIterator->second.begin() ; symbolIterator != infoIterator->second.end(); symbolIterator++)
     116      {
     117         fprintf( stdout, "%s:\tStarting address = %#x\tLength = %u\n", infoIterator->first.c_str(), symbolIterator->startingAddress, symbolIterator->length );
     118      }
     119    }
     120  }
     121
    107122}
  • covoar/SymbolTable.h

    rba5d55b r6517cde  
    3838 
    3939   typedef std::list< symbolInfo_t > symbolInfo;
     40   typedef std::list< symbolInfo_t >::iterator  symbolInfoIterator_t;
    4041 
    4142   
     
    99100    );
    100101
     102    /*!
     103     *  This method prints SymbolTable content to stdout
     104     *
     105     */
     106    void dumpSymbolTable( void );
     107
    101108  private:
    102109
     
    118125     */
    119126    typedef std::map<std::string, symbolInfo> info_t;
     127    typedef std::map<std::string, symbolInfo>::iterator infoIterator_t;
    120128    info_t info;
    121129
  • covoar/covoar.cc

    rba5d55b r6517cde  
    2626#include "ReportsBase.h"
    2727#include "TargetFactory.h"
     28#include "GcovData.h"
    2829
    2930/*
     
    4243char*                                progname;
    4344const char*                          symbolsFile = NULL;
     45const char*                          gcnosFileName = NULL;
     46char                                 gcnoFileName[FILE_NAME_LENGTH];
     47char                                 gcdaFileName[FILE_NAME_LENGTH];
     48char                                 gcovBashCommand[256];
    4449const char*                          target = NULL;
    4550const char*                          format = NULL;
     51FILE*                                gcnosFile = NULL;
     52Gcov::GcovData*                      gcovFile;
    4653
    4754/*
     
    6572    "  -e EXE_EXTENSION          - extension of the executables to analyze\n"
    6673    "  -c COVERAGEFILE_EXTENSION - extension of the coverage files to analyze\n"
     74    "  -g GCNOS_LIST             - name of file with list of *.gcno files\n"
    6775    "  -p PROJECT_NAME           - name of the project\n"
    6876    "  -C ConfigurationFileName  - name of configuration file\n"
     
    8997  { "executableExtension",  NULL },
    9098  { "coverageExtension",    NULL },
     99  { "gcnosFile",            NULL },
    91100  { "target",               NULL },
    92101  { "verbose",              NULL },
     
    128137  GET_STRING( "executableExtension",  executableExtension );
    129138  GET_STRING( "coverageExtension",    coverageFileExtension );
     139  GET_STRING( "gcnosFile",            gcnosFileName );
    130140  GET_STRING( "projectName",          projectName );
    131141
     
    161171  progname = argv[0];
    162172
    163   while ((opt = getopt(argc, argv, "C:1:L:e:c:E:f:s:T:O:p:v")) != -1) {
     173  while ((opt = getopt(argc, argv, "C:1:L:e:c:g:E:f:s:T:O:p:v")) != -1) {
    164174    switch (opt) {
    165175      case 'C': CoverageConfiguration->processFile( optarg ); break;
     
    168178      case 'e': executableExtension   = optarg; break;
    169179      case 'c': coverageFileExtension = optarg; break;
     180      case 'g': gcnosFileName         = optarg; break;
    170181      case 'E': explanations          = optarg; break;
    171182      case 'f': format                = optarg; break;
     
    349360  if (Verbose)
    350361    fprintf(
    351       stderr, "Analyzing %ld symbols\n", SymbolsToAnalyze->set.size()
     362      stderr, "Analyzing %u symbols\n", SymbolsToAnalyze->set.size()
    352363    );
    353364
     
    413424    (*eitr)->mergeCoverage();
    414425
     426    // DEBUG Print ExecutableInfo content
     427    //(*eitr)->dumpExecutableInfo();
     428
    415429    if (!singleExecutable)
    416430      eitr++;
     
    421435    fprintf( stderr, "Preprocess uncovered ranges and branches\n" );
    422436  SymbolsToAnalyze->preprocess();
     437
     438  //
     439  // Generate Gcov reports
     440  //
     441  if (Verbose)
     442    fprintf( stderr, "Generating Gcov reports...\n");
     443  gcnosFile = fopen ( gcnosFileName , "r" );   
     444
     445  if ( !gcnosFile ) {
     446    fprintf( stderr, "Unable to open %s\n", gcnosFileName );
     447  }
     448  else {
     449    while ( fscanf( gcnosFile, "%s", inputBuffer ) != EOF) {
     450      gcovFile = new Gcov::GcovData();
     451      strcpy( gcnoFileName, inputBuffer );
     452
     453      if ( Verbose )
     454        fprintf( stderr, "Processing file: %s\n", gcnoFileName );
     455
     456      if ( gcovFile->readGcnoFile( gcnoFileName ) ) {
     457        // Those need to be in this order
     458        gcovFile->processCounters();
     459        gcovFile->writeReportFile();
     460        gcovFile->writeGcdaFile();
     461        gcovFile->writeGcovFile();
     462      }
     463
     464      delete gcovFile;
     465    }
     466  fclose( gcnosFile );
     467  }
    423468
    424469  // Determine the uncovered ranges and branches.
Note: See TracChangeset for help on using the changeset viewer.