Changeset 7a7ba6e in rtems-testing


Ignore:
Timestamp:
May 19, 2010, 2:47:12 PM (9 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
8e777521
Parents:
7e2f6d0
Message:

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

Location:
rtems-coverage
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    r7e2f6d0 r7a7ba6e  
     12010-05-19      Jennifer Averett <Jennifer.Averett@OARcorp.com>
     2
     3        * ConfigFile.h, CoverageRanges.h, DesiredSymbols.h, Doxyfile,
     4        ObjdumpProcessor.h, ReportsBase.cc, ReportsBase.h, ReportsHtml.cc,
     5        ReportsHtml.h, ReportsText.cc, ReportsText.h, Target_lm32.h,
     6        Target_m68k.h, Target_powerpc.h, TraceList.h, qemu-log.h,
     7        rtemscov_header.h: Resolved doxygen warnings. Added a NoRange report
     8        which lists all symbols that are never accessed by an executable.
     9
    1102010-05-19      Joel Sherrill <joel.sherrilL@OARcorp.com>
    211
  • rtems-coverage/ConfigFile.h

    r7e2f6d0 r7a7ba6e  
    1616namespace Configuration {
    1717
     18  /*!
     19   * 
     20   *  This structure contains the configuration parameter
     21   *  name and value pair.
     22   */
    1823  typedef struct {
    1924    const char *option;
  • rtems-coverage/CoverageRanges.h

    r7e2f6d0 r7a7ba6e  
    4343     */
    4444    typedef struct {
     45      /*!
     46       *  This member contains an identification number for this
     47       *  coverage range.
     48       */
    4549      uint32_t          id;
     50
     51      /*!
     52       *  This member contains the low address of this coverage
     53       *  range.
     54       */
    4655      uint32_t          lowAddress;
     56
     57      /*!
     58       *  This member contains the source line associated with the
     59       *  low address for this coverage range.
     60       */
    4761      std::string       lowSourceLine;
     62
     63      /*!
     64       * This member contains the high address for this coverage range.
     65       */
    4866      uint32_t          highAddress;
     67
     68      /*!
     69       *  This member contains the high source line for this coverage range.
     70       */
    4971      std::string       highSourceLine;
     72
     73      /*!
     74       * This member contains an instruction count for this coverage
     75       * address range.
     76       */
    5077      uint32_t          instructionCount;
     78
     79      /*!
     80       *  This member contains the reason that this area was uncovered.
     81       */
    5182      uncoveredReason_t reason;
    5283    } coverageRange_t;
    5384
    5485    /*!
    55      *  This member variable contains a list of CoverageRange instances.
     86     *  This type contains a list of CoverageRange instances.
    5687     */
    5788    typedef std::list<coverageRange_t> ranges_t;
     89
     90    /*!
     91     *  This member contains a list of the CoverageRange instances.
     92     */
    5893    ranges_t set;
    5994
  • rtems-coverage/DesiredSymbols.h

    r7e2f6d0 r7a7ba6e  
    2525
    2626
    27   /*! @class Stats
     27  /*!
    2828   *
    2929   *  This class defines the statistics that are tracked.
     
    189189     */
    190190    typedef std::map<std::string, SymbolInformation> symbolSet_t;
     191
     192    /*!
     193     *  This variable contains a map of ymbol sets for each
     194     *  symbol in the system keyed on the symbol name.
     195     */
    191196    symbolSet_t set;
    192197
  • rtems-coverage/Doxyfile

    r7e2f6d0 r7a7ba6e  
    586586# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
    587587
    588 FILE_PATTERNS          =
     588FILE_PATTERNS          = *.h
    589589
    590590# The RECURSIVE tag can be used to turn specify whether or not subdirectories
  • rtems-coverage/ObjdumpProcessor.h

    r7e2f6d0 r7a7ba6e  
    7373    } objdumpLine_t;
    7474
     75    /*!
     76     *  This object defines a list of object dump lines
     77     *  for a file.
     78     */
    7579    typedef std::list<objdumpLine_t> objdumpLines_t;
    7680
     81   
     82    /*!
     83     *  This object defines a list of instruction addresses
     84     *  that will be extracted from the objdump file.
     85     */
    7786    typedef std::list<uint32_t> objdumpFile_t;
    7887
     
    136145  private:
    137146
     147    /*!
     148     *  This variable consists of a list of all instruction addresses
     149     *  extracted from the obj dump file.
     150     */
    138151    objdumpFile_t       objdumpList;
    139152
  • rtems-coverage/ReportsBase.cc

    r7e2f6d0 r7a7ba6e  
    8585}
    8686
     87FILE* ReportsBase::OpenNoRangeFile(
     88  const char* const fileName
     89)
     90{
     91  return OpenFile(fileName);
     92}
     93
     94
    8795FILE* ReportsBase::OpenSizeFile(
    8896  const char* const fileName
     
    122130
    123131void  ReportsBase::CloseCoverageFile(
     132  FILE*  aFile
     133)
     134{
     135  CloseFile( aFile );
     136}
     137
     138void  ReportsBase::CloseNoRangeFile(
    124139  FILE*  aFile
    125140)
     
    290305  Coverage::CoverageRanges::ranges_t::iterator    ritr;
    291306  Coverage::CoverageRanges*                       theRanges;
    292   unsigned int                                    count;
     307  unsigned int                                    count, count2;
     308  FILE*                                           NoRangeFile;
     309  std::string                                     NoRangeName;
     310
     311  // Open special file that captures NoRange informaiton
     312  NoRangeName = "no_range_";
     313  NoRangeName +=  fileName;
     314  NoRangeFile = OpenNoRangeFile ( NoRangeName.c_str() );
     315  if (!NoRangeFile) {
     316    return;
     317  }
    293318
    294319  // Open the coverage report file.
     
    311336    // in the report.
    312337    if (theRanges == NULL) {
    313       putCoverageNoRange( report, count, ditr->first );
     338      putCoverageNoRange( report, NoRangeFile, count, ditr->first );
    314339      count++;
    315340    }  else if (!theRanges->set.empty()) {
     
    324349  }
    325350
     351  CloseNoRangeFile( NoRangeFile );
    326352  CloseCoverageFile( report );
     353
    327354}
    328355
  • rtems-coverage/ReportsBase.h

    r7e2f6d0 r7a7ba6e  
    2020namespace Coverage {
    2121
    22 
     22/*!
     23 *   This class contains the base information to create a report
     24 *   set.  The report set may be text based, html based or some
     25 *   other format to be defined at a future time.
     26 */
    2327class ReportsBase {
    2428
     
    9094     *  type.  If the extension is ".txt" files will be
    9195     *  named "annotated.txt", "branch.txt" ......
    92      *
    93      *  @param[in] fileName identifies the report file name
    9496     */
    9597    std::string ReportExtension() { return reportExtension_m; }
     
    154156      const char* const fileName
    155157    );
     158   
     159    /*!
     160     *  This method opens a report file and verifies that it opened.
     161     *  Then appends any necessary header information onto the file.
     162     *
     163     *  @param[in] fileName identifies the report file name
     164     */
     165    virtual FILE* OpenNoRangeFile(
     166      const char* const fileName
     167    );
    156168
    157169    /*!
     
    178190     *  This method Closes a report file.
    179191     *
    180      *  @param[in] fileName identifies the report file name
     192     *  @param[in] aFile identifies the report file name
    181193     */
    182194    void CloseFile(
     
    188200     *  the report then closes the file.
    189201     *
    190      *  @param[in] fileName identifies the report file name
     202     *  @param[in] aFile identifies the report file name
    191203     */
    192204    virtual void CloseAnnotatedFile(
     
    198210     *  the report then closes the file.
    199211     *
    200      *  @param[in] fileName identifies the report file name
     212     *  @param[in] aFile identifies the report file name
    201213     *  @param[in] hasBranches indicates if there are branches to report
    202214     */
     
    210222     *  the report then closes the file.
    211223     *
    212      *  @param[in] fileName identifies the report file name
     224     *  @param[in] aFile identifies the report file name
    213225     */
    214226    virtual void CloseCoverageFile(
     
    220232     *  the report then closes the file.
    221233     *
    222      *  @param[in] fileName identifies the report file name
     234     *  @param[in] aFile identifies the report file name
     235     */
     236    void  CloseNoRangeFile(
     237      FILE*  aFile
     238    );
     239
     240    /*!
     241     *  This method puts any necessary footer information into
     242     *  the report then closes the file.
     243     *
     244     *  @param[in] aFile identifies the report file name
    223245     */
    224246    virtual void CloseSizeFile(
     
    230252     *  the report then closes the file.
    231253     *
    232      *  @param[in] fileName identifies the report file name
     254     *  @param[in] aFile identifies the report file name
    233255     */
    234256    virtual void CloseSymbolSummaryFile(
     
    240262     *  the report then closes the file.
    241263     *
    242      *  @param[in] fileName identifies the report file name
     264     *  @param[in] aFile identifies the report file name
     265     *  @param[in] state identifies the state machine state
     266     *  @param[in] line identifies the string to print 
     267     *  @param[in] id identifies the branch or range id.
    243268     */
    244269    virtual void PutAnnotatedLine(
     
    253278     *  the report then closes the file.
    254279     *
    255      *  @param[in] fileName identifies the report file name
     280     *  @param[in] report identifies the report file name
    256281     */
    257282    virtual bool PutNoBranchInfo(
     
    262287     *  This method puts a branch entry into the branch report.
    263288     *
    264      *  @param[in] fileName identifies the report file name
     289     *  @param[in] report identifies the report file name
     290     *  @param[in] number identifies the line number.
     291     *  @param[in] symbolPtr is a pointer to the symbol information
     292     *  @param[in] rangePtr is a pointer to the range information.
    265293     */
    266294    virtual bool PutBranchEntry(
     
    275303     *  a symbol in the coverage report.
    276304     *
    277      *  @param[in] fileName identifies the report file name
     305     *  @param[in] report identifies the report file name
     306     *  @param[in] number identifies the line number.
     307     *  @param[in] symbol is a pointer to the symbol information
    278308     */
    279309    virtual void putCoverageNoRange(
    280310      FILE*        report,
     311      FILE*        noRangeFile,
    281312      unsigned int number,
    282313      std::string  symbol
     
    286317     *  This method puts a line in the coverage report.
    287318     *
    288      *  @param[in] fileName identifies the report file name
     319     *  @param[in] report identifies the report file name
     320     *  @param[in] number identifies the line number.
     321     *  @param[in] ditr is a iterator to the symbol information
     322     *  @param[in] ritr is a iterator to the range information.
    289323     */
    290324    virtual bool PutCoverageLine(
     
    298332     *  This method method puts a line into the size report.
    299333     *
    300      *  @param[in] fileName identifies the size report file name
     334     *  @param[in] report identifies the size report file name
     335     *  @param[in] number identifies the line number.
     336     *  @param[in] symbol is a pointer to the symbol information
     337     *  @param[in] range is a iterator to the range information.
    301338     */
    302339    virtual bool PutSizeLine(
     
    310347     *  This method method puts a line into the symbol summary report.
    311348     *
    312      *  @param[in] fileName identifies the report file name
     349     *  @param[in] report identifies the report file name
     350     *  @param[in] number identifies the line number.
     351     *  @param[in] symbol is a pointer to the symbol information
    313352     */
    314353    virtual bool PutSymbolSummaryLine(
     
    319358};
    320359
     360/*!
     361 *  This method iterates over all report set types and generates
     362 *  all reports.
     363 */
    321364void GenerateReports();
    322365
  • rtems-coverage/ReportsHtml.cc

    r7e2f6d0 r7a7ba6e  
    118118    fprintf(
    119119      aFile,
     120      "<title>Annotated Report</title>\n"
    120121      "<pre class=\"heading-title\">Annotated Report</pre>\n"
    121122      "<body>\n"
     
    140141      fprintf(
    141142        aFile,
     143        "<title>Branch Report</title\n"
    142144        "<pre class=\"heading-title\">Branch Report</pre>\n"
    143145        "<body>\n"
     
    173175    fprintf(
    174176      aFile,
     177        "<title>Coverage Report</title>\n"
    175178        "<pre class=\"heading-title\">Coverage Report</pre>\n"
    176179        "<body>\n"
     
    193196  }
    194197
     198  FILE* ReportsHtml::OpenNoRangeFile(
     199    const char* const fileName
     200  )
     201  {
     202    FILE *aFile;
     203
     204    // Open the file
     205    aFile = OpenFile(fileName);
     206
     207    // Put header information into the file
     208    fprintf(
     209      aFile,
     210        "<title> Report</title>\n"
     211        "<pre class=\"heading-title\">No Range Report</pre>\n"
     212        "<body>\n"
     213      "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
     214           TABLE_HEADER_CLASS "\">\n"
     215      "<thead>\n"
     216      "<tr>\n"
     217      "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
     218      "</tr>\n"
     219      "</thead>\n"
     220      "<tbody>\n"
     221     );
     222
     223    return aFile;
     224   }
     225
     226
     227
    195228  FILE*  ReportsHtml::OpenSizeFile(
    196229    const char* const fileName
     
    205238    fprintf(
    206239      aFile,
     240      "<title>Size Report</title>\n"
    207241      "<pre class=\"heading-title\">Size Report</pre>\n"
    208242      "<body>\n"
     
    233267    fprintf(
    234268      aFile,
     269      "<title>Symbol Summary Report</title>\n"
    235270      "<pre class=\"heading-title\">Symbol Summary Report</pre>\n"
    236271      "<body>\n"
     
    345380    if ( ( count%2 ) != 0 )
    346381      fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
     382    else
     383      fprintf( report, "<tr>\n");
    347384
    348385    // symbol
     
    433470  void ReportsHtml::putCoverageNoRange(
    434471    FILE*         report,
     472    FILE*         noRangeFile,
    435473    unsigned int  count,
    436474    std::string   symbol
     
    449487
    450488    // Mark the background color different for odd and even lines.
    451     if ( ( count%2 ) != 0 )
     489    if ( ( count%2 ) != 0 ){
    452490      fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
     491      fprintf( noRangeFile,  "<tr class=\"covoar-tr-odd\">\n");
     492    } else {
     493      fprintf( report, "<tr>\n");
     494      fprintf( noRangeFile,  "<tr>\n");
     495    }
    453496
    454497    // symbol
    455498    fprintf(
    456499      report,
     500      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
     501      symbol.c_str()
     502    );
     503    fprintf(
     504      noRangeFile,
    457505      "<td class=\"covoar-td\" align=\"center\">%s</td>\n",     
    458506      symbol.c_str()
     
    487535
    488536    fprintf( report, "</tr>\n");
     537    fprintf( noRangeFile, "</tr>\n");
    489538  }
    490539
     
    502551    if ( ( count%2 ) != 0 )
    503552      fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
     553    else
     554      fprintf( report, "<tr>\n");
    504555
    505556    // symbol
     
    574625    if ( ( count%2 ) != 0 )
    575626      fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
     627    else
     628      fprintf( report, "<tr>\n");
    576629
    577630    // size
     
    611664    if ( ( count%2 ) != 0 )
    612665      fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
     666    else
     667      fprintf( report, "<tr>\n");
    613668
    614669    // symbol
     
    761816  }
    762817
    763   void ReportsHtml::CloseSizeFile(
     818  void ReportsHtml::CloseNoRangeFile(
    764819    FILE*  aFile
    765820  )
     
    775830    );
    776831
     832    CloseFile(aFile);
     833  }
     834
     835
     836  void ReportsHtml::CloseSizeFile(
     837    FILE*  aFile
     838  )
     839  {
     840    fprintf(
     841      aFile,
     842      TABLE_FOOTER
     843      "</tbody>\n"
     844      "</table>\n"
     845      "</pre>\n"
     846      "</body>\n"
     847      "</html>"
     848    );
     849
    777850    CloseFile( aFile );
    778851  }
  • rtems-coverage/ReportsHtml.h

    r7e2f6d0 r7a7ba6e  
    2020namespace Coverage {
    2121
     22/*!
     23 *   This class contains all methods and data necessary to
     24 *   do all of the HTML style reports.
     25 */
    2226class ReportsHtml: public ReportsBase {
    2327
     
    6771  protected:
    6872
     73    /*!
     74     *  This variable tracks the annotated state at the time the
     75     *  last line was output.  This allows the text formating to change
     76     *  based upon the type of lines being put out: source code or assembly
     77     *  object dump line....
     78     */
    6979    AnnotatedLineState_t lastState_m;
    7080
     81    /* Inherit documentation from base class. */
    7182    virtual FILE* OpenAnnotatedFile(
    7283      const char* const fileName
    7384    );
    7485
     86    /* Inherit documentation from base class. */
    7587    virtual FILE* OpenBranchFile(
    7688      const char* const fileName,
     
    7890    );
    7991
     92    /* Inherit documentation from base class. */
    8093    virtual FILE* OpenCoverageFile(
    8194      const char* const fileName
    8295    );
    8396
     97    /* Inherit documentation from base class. */
     98    FILE* OpenNoRangeFile(
     99      const char* const fileName
     100    );
     101
     102    /* Inherit documentation from base class. */
    84103    virtual FILE* OpenSizeFile(
    85104      const char* const fileName
    86105    );
    87106
     107    /* Inherit documentation from base class. */
    88108    virtual FILE* OpenSymbolSummaryFile(
    89109      const char* const fileName
    90110    );
    91111
     112    /* Inherit documentation from base class. */
    92113    virtual void CloseAnnotatedFile(
    93114      FILE*  aFile
    94115    );
    95116
     117    /* Inherit documentation from base class. */
    96118    virtual void CloseBranchFile(
    97119      FILE*  aFile,
     
    99121    );
    100122
     123    /* Inherit documentation from base class. */
    101124    virtual void CloseCoverageFile(
    102125      FILE*  aFile
    103126    );
    104127
     128    /* Inherit documentation from base class. */
     129    void CloseNoRangeFile(
     130      FILE*  aFile
     131    );
     132
     133    /* Inherit documentation from base class. */
    105134    virtual void CloseSizeFile(
    106135      FILE*  aFile
    107136    );
    108137
     138    /* Inherit documentation from base class. */
    109139    virtual void CloseSymbolSummaryFile(
    110140      FILE*  aFile
    111141    );
    112142
     143    /* Inherit documentation from base class. */
    113144    virtual void PutAnnotatedLine(
    114145      FILE*                aFile,
     
    118149    );
    119150
     151    /* Inherit documentation from base class. */
    120152    virtual bool PutNoBranchInfo(
    121153      FILE* report
    122154    );
    123155
     156    /* Inherit documentation from base class. */
    124157    virtual bool PutBranchEntry(
    125158      FILE*                                            report,
     
    129162    );
    130163
     164    /* Inherit documentation from base class. */
    131165    virtual void putCoverageNoRange(
    132166      FILE*        report,
     167      FILE*        noRangeFile,
    133168      unsigned int number,
    134169      std::string  symbol
    135170    );
    136171
     172    /* Inherit documentation from base class. */
    137173    virtual bool PutCoverageLine(
    138174      FILE*                                           report,
     
    142178    );
    143179
     180    /* Inherit documentation from base class. */
    144181    virtual bool PutSizeLine(
    145182      FILE*                                           report,
     
    149186    );
    150187
     188    /* Inherit documentation from base class. */
    151189    virtual bool PutSymbolSummaryLine(
    152190      FILE*                                           report,
     
    155193    );
    156194
     195    /* Inherit documentation from base class. */
    157196    virtual FILE* OpenFile(
    158197      const char* const fileName
    159198    );
    160199
     200    /* Inherit documentation from base class. */
    161201    virtual bool WriteExplationFile(
    162202      const char*                  fileName,
  • rtems-coverage/ReportsText.cc

    r7e2f6d0 r7a7ba6e  
    116116void ReportsText::putCoverageNoRange(
    117117  FILE*         report,
     118  FILE*         noRangeFile,
    118119  unsigned int  number,
    119120  std::string   symbol
     
    132133        symbol.c_str()
    133134      );
     135      fprintf( noRangeFile, "%s\n", symbol.c_str() );
    134136}
    135137
  • rtems-coverage/ReportsText.h

    r7e2f6d0 r7a7ba6e  
    1919namespace Coverage {
    2020
     21/*!
     22 *   This class contains all methods and data necessary to
     23 *   produce all text style reports.
     24 */
    2125class ReportsText: public ReportsBase {
    2226
     
    7781    virtual void putCoverageNoRange(
    7882      FILE*        report,
     83      FILE*        noRangeFile,
    7984      unsigned int number,
    8085      std::string  symbol
  • rtems-coverage/Target_lm32.h

    r7e2f6d0 r7a7ba6e  
    1919namespace Target {
    2020
    21   /*! @class TargetBase
     21  /*!
    2222   *
    2323   *  This class is the class for the m68k Target.
  • rtems-coverage/Target_m68k.h

    r7e2f6d0 r7a7ba6e  
    1919namespace Target {
    2020
    21   /*! @class TargetBase
     21  /*!
    2222   *
    2323   *  This class is the class for the m68k Target.
  • rtems-coverage/Target_powerpc.h

    r7e2f6d0 r7a7ba6e  
    1919namespace Target {
    2020
    21   /*! @class TargetBase
     21  /*!
    2222   *
    2323   *  This class is the class for the powerpc target.
  • rtems-coverage/TraceList.h

    r7e2f6d0 r7a7ba6e  
    2626  public:
    2727
     28    /*!
     29     *  This enumberated type defines an exit reason
     30     *  for the end of a section.
     31     */
    2832    typedef enum {
    2933      EXIT_REASON_BRANCH_TAKEN,
     
    3640     */
    3741    typedef struct {
     42      /*!
     43       *  This member variable contains the low address for the
     44       *  trace range.
     45       */
    3846      uint32_t          lowAddress;
     47
     48      /*!
     49       *  This member variable contains the length of the trace
     50       *  range.
     51       */
    3952      uint16_t          length;
     53
     54      /*!
     55       *  This member variable contains the reason that this
     56       *  trace range ended.
     57       */
    4058      exitReason_t      exitReason;
    4159    } traceRange_t;
     
    4563     */
    4664    typedef std::list<traceRange_t> ranges_t;
     65
     66    /*!
     67     *  This member variable contains a list of coverageRange
     68     *  instaces.
     69     */
    4770    ranges_t set;
    4871
  • rtems-coverage/qemu-log.h

    r7e2f6d0 r7a7ba6e  
    1414#define QEMU_LOG_IN_KEY         "IN: "
    1515
     16/*!
     17 *   This structure breaks apart the log line information
     18 *   into the components address, instruction and data.
     19 */
    1620typedef struct {
    1721  unsigned long address;
  • rtems-coverage/rtemscov_header.h

    r7e2f6d0 r7a7ba6e  
    1616#define MAX_DESC_STR 32
    1717
     18/*!
     19 *
     20 *   This structure contains XXX
     21 */
     22
    1823typedef struct prof_header_s{
    1924  /** the version of header file */
Note: See TracChangeset for help on using the changeset viewer.