change log for gcc-testing (2010-05-06)
rtems-vc at rtems.org
rtems-vc at rtems.org
Thu May 6 18:10:04 UTC 2010
*jennifer*:
2010-05-06 Jennifer.Averett <Jennifer.Averett>
* Makefile, covoar.cc: Split Reports into a Report Base and Report Text
file to make room for a design allowing multiple types of reported
files.
* ReportsBase.cc, ReportsBase.h, ReportsText.cc, ReportsText.h: New
files.
* Reports.cc, Reports.h: Removed.
M 1.201 rtems-coverage/ChangeLog
M 1.18 rtems-coverage/Makefile
R 1.2 rtems-coverage/Reports.h
R 1.3 rtems-coverage/Reports.cc
A 1.1 rtems-coverage/ReportsBase.h
A 1.1 rtems-coverage/ReportsBase.cc
A 1.1 rtems-coverage/ReportsText.h
A 1.1 rtems-coverage/ReportsText.cc
M 1.13 rtems-coverage/covoar.cc
diff -u gcc-testing/rtems-coverage/ChangeLog:1.200 gcc-testing/rtems-coverage/ChangeLog:1.201
--- gcc-testing/rtems-coverage/ChangeLog:1.200 Thu May 6 10:10:45 2010
+++ gcc-testing/rtems-coverage/ChangeLog Thu May 6 12:54:12 2010
@@ -1,3 +1,12 @@
+2010-05-06 Jennifer.Averett <Jennifer.Averett>
+
+ * Makefile, covoar.cc: Split Reports into a Report Base and Report Text
+ file to make room for a design allowing multiple types of reported
+ files.
+ * ReportsBase.cc, ReportsBase.h, ReportsText.cc, ReportsText.h: New
+ files.
+ * Reports.cc, Reports.h: Removed.
+
2010-05-06 Joel Sherrill <joel.sherrill at oarcorp.com>
* covoar.cc: Fix typo that gives core dump.
diff -u gcc-testing/rtems-coverage/Makefile:1.17 gcc-testing/rtems-coverage/Makefile:1.18
--- gcc-testing/rtems-coverage/Makefile:1.17 Wed May 5 18:09:36 2010
+++ gcc-testing/rtems-coverage/Makefile Thu May 6 12:54:12 2010
@@ -25,7 +25,8 @@
ExecutableInfo.o \
Explanations.o \
ObjdumpProcessor.o \
- Reports.o \
+ ReportsBase.o \
+ ReportsText.o \
SymbolTable.o \
Target_arm.o \
TargetBase.o \
@@ -118,8 +119,9 @@
Explanations.o: Explanations.cc Explanations.h
ObjdumpProcessor.o: ObjdumpProcessor.cc ObjdumpProcessor.h ExecutableInfo.h \
TargetBase.h TargetFactory.h
-Reports.o: Reports.cc Reports.h CoverageRanges.h DesiredSymbols.h \
+ReportsBase.o: ReportsBase.cc ReportsBase.h CoverageRanges.h DesiredSymbols.h \
Explanations.h ObjdumpProcessor.h
+ReportsText.o: ReportsBase.h ReportsText.cc
SymbolTable.o: SymbolTable.cc SymbolTable.h
Target_arm.o: Target_arm.cc Target_arm.h TargetBase.h
TargetBase.o: TargetBase.cc TargetBase.h
diff -u /dev/null gcc-testing/rtems-coverage/ReportsBase.h:1.1
--- /dev/null Thu May 6 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsBase.h Thu May 6 12:54:13 2010
@@ -0,0 +1,164 @@
+/*
+ * $Id$
+ */
+
+/*! @file Reports.h
+ * @brief Reports Specification
+ *
+ * This file contains the specification of the Reports methods. This
+ * collection of methods is used to generate the various reports of
+ * the analysis results.
+ */
+
+#ifndef __REPORTSBASE_H__
+#define __REPORTSBASE_H__
+
+#include <stdint.h>
+#include <string>
+#include "DesiredSymbols.h"
+
+namespace Coverage {
+
+
+class ReportsBase {
+
+ public:
+ ReportsBase();
+ ~ReportsBase();
+
+ /*!
+ * This method produces an annotated assembly listing report containing
+ * the disassembly of each symbol that was not completely covered.
+ *
+ * @param[in] fileName identifies the annotated report file name
+ */
+ void WriteAnnotatedReport(
+ const char* const fileName
+ );
+
+ /*!
+ * This method produces a report that contains information about each
+ * uncovered branch statement.
+ *
+ * @param[in] fileName identifies the branch report file name
+ */
+ void WriteBranchReport(
+ const char* const fileName
+ );
+
+ /*!
+ * This method produces a report that contains information about each
+ * uncovered range of bytes.
+ *
+ * @param[in] fileName identifies the coverage report file name
+ */
+ void WriteCoverageReport(
+ const char* const fileName
+ );
+
+ /*!
+ * This method produces a summary report that lists each uncovered
+ * range of bytes.
+ *
+ * @param[in] fileName identifies the size report file name
+ */
+ void WriteSizeReport(
+ const char* const fileName
+ );
+
+
+ std::string ReportExtension() { return reportExtension_m; }
+
+ protected:
+
+ typedef enum {
+ A_SOURCE,
+ A_EXECUTED,
+ A_NEVER_EXECUTED,
+ A_BRANCH_TAKEN,
+ A_BRANCH_NOT_TAKEN
+ }AnnotatedLineState_t;
+
+ std::string reportExtension_m;
+
+
+ FILE* OpenFile(
+ const char* const fileName
+ );
+
+ virtual FILE* OpenAnnotatedFile(
+ const char* const fileName
+ );
+
+ virtual FILE* OpenBranchFile(
+ const char* const fileName
+ );
+
+ virtual FILE* OpenCoverageFile(
+ const char* const fileName
+ );
+
+ virtual FILE* OpenSizeFile(
+ const char* const fileName
+ );
+
+ void CloseFile(
+ FILE* aFile
+ );
+
+ virtual void CloseAnnotatedFile(
+ FILE* aFile
+ );
+
+ virtual void CloseBranchFile(
+ FILE* aFile
+ );
+
+ virtual void CloseCoverageFile(
+ FILE* aFile
+ );
+
+ virtual void CloseSizeFile(
+ FILE* aFile
+ );
+
+ virtual void PutAnnotatedLine(
+ FILE* aFile,
+ AnnotatedLineState_t state,
+ std::string line
+ )=0;
+
+ virtual bool PutNoBranchInfo(
+ FILE* report
+ ) = 0;
+
+ virtual bool PutBranchEntry(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
+ Coverage::CoverageRanges::ranges_t::iterator rangePtr
+ )=0;
+
+ virtual void putCoverageNoRange(
+ FILE* report,
+ std::string symbol
+ )=0;
+
+ virtual bool PutCoverageLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
+ Coverage::CoverageRanges::ranges_t::iterator ritr
+ )=0;
+
+ virtual bool PutSizeLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
+ Coverage::CoverageRanges::ranges_t::iterator range
+ )=0;
+
+};
+
+void GenerateReports();
+
+}
+
+#endif
diff -u /dev/null gcc-testing/rtems-coverage/ReportsBase.cc:1.1
--- /dev/null Thu May 6 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsBase.cc Thu May 6 12:54:13 2010
@@ -0,0 +1,352 @@
+/*
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "ReportsBase.h"
+#include "app_common.h"
+#include "CoverageRanges.h"
+#include "DesiredSymbols.h"
+#include "Explanations.h"
+#include "ObjdumpProcessor.h"
+
+
+#include "ReportsText.h"
+
+namespace Coverage {
+
+ReportsBase::ReportsBase():
+ reportExtension_m("")
+{
+}
+
+ReportsBase::~ReportsBase()
+{
+}
+
+
+FILE* ReportsBase::OpenFile(
+ const char* const fileName
+)
+{
+ FILE* aFile;
+
+ // Open the file.
+ aFile = fopen( fileName, "w" );
+ if ( !aFile ) {
+ fprintf(
+ stderr, "Unable to open %s\n", fileName
+ );
+ }
+ return aFile;
+}
+
+FILE* ReportsBase::OpenAnnotatedFile(
+ const char* const fileName
+)
+{
+ return OpenFile(fileName);
+}
+
+FILE* ReportsBase::OpenBranchFile(
+ const char* const fileName
+)
+{
+ return OpenFile(fileName);
+}
+
+FILE* ReportsBase::OpenCoverageFile(
+ const char* const fileName
+)
+{
+ return OpenFile(fileName);
+}
+
+FILE* ReportsBase::OpenSizeFile(
+ const char* const fileName
+)
+{
+ return OpenFile(fileName);
+}
+
+
+void ReportsBase::CloseFile(
+ FILE* aFile
+)
+{
+ fclose( aFile );
+}
+
+void ReportsBase::CloseAnnotatedFile(
+ FILE* aFile
+)
+{
+ CloseFile( aFile );
+}
+
+void ReportsBase::CloseBranchFile(
+ FILE* aFile
+)
+{
+ CloseFile( aFile );
+}
+
+void ReportsBase::CloseCoverageFile(
+ FILE* aFile
+)
+{
+ CloseFile( aFile );
+}
+
+void ReportsBase::CloseSizeFile(
+ FILE* aFile
+)
+{
+ CloseFile( aFile );
+}
+
+
+/*
+ * Write annotated report
+ */
+void ReportsBase::WriteAnnotatedReport(
+ const char* const fileName
+) {
+ FILE* aFile = NULL;
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
+ std::list<Coverage::ObjdumpProcessor::objdumpLine_t>* theInstructions;
+ std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator itr;
+ Coverage::CoverageMapBase* theCoverageMap = NULL;
+ uint32_t bAddress = 0;
+ AnnotatedLineState_t state;
+
+ aFile = OpenAnnotatedFile(fileName);
+ if (!aFile)
+ return;
+
+ // Process uncovered branches for each symbol.
+ for (ditr = SymbolsToAnalyze->set.begin();
+ ditr != SymbolsToAnalyze->set.end();
+ ditr++) {
+
+ // If uncoveredRanges and uncoveredBranches don't exist, then the
+ // symbol was never referenced by any executable. Just skip it.
+ if ((ditr->second.uncoveredRanges == NULL) &&
+ (ditr->second.uncoveredBranches == NULL))
+ continue;
+
+ // If uncoveredRanges and uncoveredBranches are empty, then everything
+ // must have been covered for this symbol. Just skip it.
+ if ((ditr->second.uncoveredRanges->set.empty()) &&
+ (ditr->second.uncoveredBranches->set.empty()))
+ continue;
+
+ theCoverageMap = ditr->second.unifiedCoverageMap;
+ bAddress = ditr->second.baseAddress;
+ theInstructions = &(ditr->second.instructions);
+
+ // Add annotations to each line where necessary
+ for (itr = theInstructions->begin();
+ itr != theInstructions->end();
+ itr++ ) {
+
+ std::string annotation = "";
+ std::string line;
+
+ state = A_SOURCE;
+
+ if ( itr->isInstruction ) {
+ if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
+ annotation = "\t<== NOT EXECUTED";
+ state = A_NEVER_EXECUTED;
+ } else if (theCoverageMap->isBranch( itr->address - bAddress )) {
+ if (theCoverageMap->wasAlwaysTaken( itr->address - bAddress )){
+ annotation = "\t<== ALWAYS TAKEN";
+ state = A_BRANCH_TAKEN;
+ } else if (theCoverageMap->wasNeverTaken( itr->address - bAddress )){
+ annotation = "\t<== NEVER TAKEN";
+ state = A_BRANCH_NOT_TAKEN;
+ }
+ } else {
+ state = A_EXECUTED;
+ }
+ }
+
+
+ line = itr->line + annotation;
+ PutAnnotatedLine( aFile, state, line);
+ }
+ }
+
+ CloseAnnotatedFile( aFile );
+}
+
+/*
+ * Write branch report
+ */
+void ReportsBase::WriteBranchReport(
+ const char* const fileName
+) {
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
+ FILE* report = NULL;
+ Coverage::CoverageRanges::ranges_t::iterator ritr;
+ Coverage::CoverageRanges* theBranches;
+
+ // Open the branch report file
+ report = OpenBranchFile( fileName );
+ if (!report)
+ return;
+
+ // If no branches were found, then branch coverage is not supported
+ if (SymbolsToAnalyze->getNumberBranchesFound() == 0)
+ PutNoBranchInfo(report);
+
+ // If branches were found, ...
+ else {
+
+ // Process uncovered branches for each symbol.
+ for (ditr = SymbolsToAnalyze->set.begin();
+ ditr != SymbolsToAnalyze->set.end();
+ ditr++) {
+
+ theBranches = ditr->second.uncoveredBranches;
+
+ if (theBranches && !theBranches->set.empty()) {
+
+ for (ritr = theBranches->set.begin() ;
+ ritr != theBranches->set.end() ;
+ ritr++ ) {
+ PutBranchEntry( report, ditr, ritr );
+ }
+ }
+ }
+ }
+
+ CloseBranchFile( report );
+}
+
+/*
+ * Write coverage report
+ */
+void ReportsBase::WriteCoverageReport(
+ const char* const fileName
+) {
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
+ FILE* report;
+ Coverage::CoverageRanges::ranges_t::iterator ritr;
+ Coverage::CoverageRanges* theRanges;
+
+ // Open the coverage report file.
+ report = fopen( fileName, "w" );
+ if ( !report ) {
+ fprintf( stderr, "Unable to open %s\n\n", fileName );
+ return;
+ }
+
+ // Process uncovered ranges for each symbol.
+ for (ditr = SymbolsToAnalyze->set.begin();
+ ditr != SymbolsToAnalyze->set.end();
+ ditr++) {
+
+ theRanges = ditr->second.uncoveredRanges;
+
+ // If uncoveredRanges doesn't exist, then the symbol was never
+ // referenced by any executable. There may be a problem with the
+ // desired symbols list or with the executables so put something
+ // in the report.
+ if (theRanges == NULL) {
+ putCoverageNoRange( report, ditr->first );
+ }
+
+ else if (!theRanges->set.empty()) {
+
+ for (ritr = theRanges->set.begin() ;
+ ritr != theRanges->set.end() ;
+ ritr++ ) {
+
+ PutCoverageLine( report, ditr, ritr );
+ }
+ }
+ }
+
+ fclose( report );
+}
+
+/*
+ * Write size report
+ */
+void ReportsBase::WriteSizeReport(
+ const char* const fileName
+)
+{
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
+ FILE* report;
+ Coverage::CoverageRanges::ranges_t::iterator ritr;
+ Coverage::CoverageRanges* theRanges;
+
+ // Open the report file.
+ report = OpenSizeFile( fileName );
+ if ( !report ) {
+ return;
+ }
+
+ // Process uncovered ranges for each symbol.
+ for (ditr = SymbolsToAnalyze->set.begin();
+ ditr != SymbolsToAnalyze->set.end();
+ ditr++) {
+
+ theRanges = ditr->second.uncoveredRanges;
+
+ if (theRanges && !theRanges->set.empty()) {
+
+ for (ritr = theRanges->set.begin() ;
+ ritr != theRanges->set.end() ;
+ ritr++ ) {
+ PutSizeLine( report, ditr, ritr );
+ }
+ }
+ }
+
+ CloseSizeFile( report );
+}
+
+void GenerateReports()
+{
+ typedef std::list<ReportsBase *> reportList_t;
+
+ reportList_t reportList;
+ reportList_t::iterator ritr;
+ std::string reportName;
+ ReportsBase* reports;
+
+ reports = new ReportsText();
+ reportList.push_back(reports);
+
+
+ for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
+ reports = *ritr;
+
+ reportName = "annotated" + reports->ReportExtension();
+ reports->WriteAnnotatedReport( reportName.c_str() );
+
+ reportName = "branch" + reports->ReportExtension();
+ reports->WriteBranchReport(reportName.c_str() );
+
+ reportName = "coverage" + reports->ReportExtension();
+ reports->WriteCoverageReport(reportName.c_str() );
+
+ reportName = "sizes" + reports->ReportExtension();
+ reports->WriteSizeReport(reportName.c_str() );
+
+ }
+
+ for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
+ reports = *ritr;
+ delete reports;
+ }
+
+}
+
+}
diff -u /dev/null gcc-testing/rtems-coverage/ReportsText.h:1.1
--- /dev/null Thu May 6 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsText.h Thu May 6 12:54:13 2010
@@ -0,0 +1,98 @@
+/*
+ * $Id$
+ */
+
+/*! @file Reports.h
+ * @brief Reports Specification
+ *
+ * This file contains the specification of the Reports methods. This
+ * collection of methods is used to generate the various reports of
+ * the analysis results.
+ */
+
+#ifndef __REPORTSTEXT_H__
+#define __REPORTSTEXT_H__
+
+#include <stdint.h>
+#include "ReportsBase.h"
+
+namespace Coverage {
+
+class ReportsText: public ReportsBase {
+
+ public:
+ ReportsText();
+ ~ReportsText();
+
+ /*!
+ * This method produces a report that contains information about each
+ * uncovered branch statement.
+ *
+ * @param[in] fileName identifies the branch report file name
+ */
+ void WriteBranchReport(
+ const char* const fileName
+ );
+
+ /*!
+ * This method produces a report that contains information about each
+ * uncovered range of bytes.
+ *
+ * @param[in] fileName identifies the coverage report file name
+ */
+ void WriteCoverageReport(
+ const char* const fileName
+ );
+
+ /*!
+ * This method produces a summary report that lists each uncovered
+ * range of bytes.
+ *
+ * @param[in] fileName identifies the size report file name
+ */
+ void WriteSizeReport(
+ const char* const fileName
+ );
+
+ protected:
+
+ virtual void PutAnnotatedLine(
+ FILE* aFile,
+ AnnotatedLineState_t state,
+ std::string line
+ );
+
+ virtual bool PutNoBranchInfo(
+ FILE* report
+ );
+
+ virtual bool PutBranchEntry(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
+ Coverage::CoverageRanges::ranges_t::iterator rangePtr
+ );
+
+ virtual void putCoverageNoRange(
+ FILE* report,
+ std::string symbol
+ );
+
+ virtual bool PutCoverageLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
+ Coverage::CoverageRanges::ranges_t::iterator ritr
+ );
+
+ virtual bool PutSizeLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
+ Coverage::CoverageRanges::ranges_t::iterator range
+ );
+
+
+
+};
+
+}
+
+#endif
diff -u /dev/null gcc-testing/rtems-coverage/ReportsText.cc:1.1
--- /dev/null Thu May 6 13:10:04 2010
+++ gcc-testing/rtems-coverage/ReportsText.cc Thu May 6 12:54:13 2010
@@ -0,0 +1,198 @@
+/*
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "ReportsText.h"
+#include "app_common.h"
+#include "CoverageRanges.h"
+#include "DesiredSymbols.h"
+#include "Explanations.h"
+#include "ObjdumpProcessor.h"
+
+
+namespace Coverage {
+
+ReportsText::ReportsText():
+ ReportsBase()
+{
+ reportExtension_m = ".txt";
+}
+
+void ReportsText::PutAnnotatedLine(
+ FILE* aFile,
+ AnnotatedLineState_t state,
+ std::string line
+)
+{
+ fprintf( aFile, "%s\n", line.c_str());
+}
+
+bool ReportsText::PutNoBranchInfo(
+ FILE* report
+)
+{
+ fprintf( report, "No branch information found\n" );
+ return true;
+}
+
+
+bool ReportsText::PutBranchEntry(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
+ Coverage::CoverageRanges::ranges_t::iterator rangePtr
+)
+{
+ const Coverage::Explanation* explanation;
+
+ // Add an entry to the report
+ fprintf(
+ report,
+ "============================================\n"
+ "Symbol : %s (0x%x)\n"
+ "Line : %s (0x%x)\n"
+ "Size in Bytes : %d\n",
+ symbolPtr->first.c_str(),
+ symbolPtr->second.baseAddress,
+ rangePtr->lowSourceLine.c_str(),
+ rangePtr->lowAddress,
+ rangePtr->highAddress - rangePtr->lowAddress + 1
+ );
+
+ if (rangePtr->reason ==
+ Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN)
+ fprintf(
+ report, "Reason : %s\n\n", "ALWAYS TAKEN"
+ );
+ else if (rangePtr->reason ==
+ Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN)
+ fprintf( report, "Reason : %s\n\n", "NEVER TAKEN" );
+
+ // See if an explanation is available
+ explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
+
+ if ( !explanation ) {
+ fprintf(
+ report,
+ "Classification: NONE\n"
+ "\n"
+ "Explanation:\n"
+ "No Explanation\n"
+ );
+ } else {
+ fprintf(
+ report,
+ "Classification: %s\n"
+ "\n"
+ "Explanation:\n",
+ explanation->classification.c_str()
+ );
+
+ for ( unsigned int i=0 ;
+ i < explanation->explanation.size();
+ i++) {
+ fprintf(
+ report,
+ "%s\n",
+ explanation->explanation[i].c_str()
+ );
+ }
+ }
+
+ fprintf(
+ report, "============================================\n"
+ );
+
+ return true;
+}
+
+void ReportsText::putCoverageNoRange(
+ FILE* report,
+ std::string symbol
+)
+{
+ fprintf(
+ report,
+ "============================================\n"
+ "Symbol : %s\n\n"
+ " *** NEVER REFERENCED ***\n\n"
+ "This symbol was never referenced by an analyzed executable.\n"
+ "Therefore there is no size or disassembly for this symbol.\n"
+ "This could be due to symbol misspelling or lack of a test for\n"
+ "this symbol.\n"
+ "============================================\n",
+ symbol.c_str()
+ );
+}
+
+bool ReportsText::PutCoverageLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
+ Coverage::CoverageRanges::ranges_t::iterator ritr
+)
+{
+ const Coverage::Explanation* explanation;
+
+ fprintf(
+ report,
+ "============================================\n"
+ "Symbol : %s (0x%x)\n"
+ "Starting Line : %s (0x%x)\n"
+ "Ending Line : %s (0x%x)\n"
+ "Size in Bytes : %d\n\n",
+ ditr->first.c_str(),
+ ditr->second.baseAddress,
+ ritr->lowSourceLine.c_str(),
+ ritr->lowAddress,
+ ritr->highSourceLine.c_str(),
+ ritr->highAddress,
+ ritr->highAddress - ritr->lowAddress + 1
+ );
+
+ explanation = AllExplanations->lookupExplanation( ritr->lowSourceLine );
+
+ if ( !explanation ) {
+ fprintf(
+ report,
+ "Classification: NONE\n"
+ "\n"
+ "Explanation:\n"
+ "No Explanation\n"
+ );
+ } else {
+ fprintf(
+ report,
+ "Classification: %s\n"
+ "\n"
+ "Explanation:\n",
+ explanation->classification.c_str()
+ );
+
+ for ( unsigned int i=0; i < explanation->explanation.size(); i++) {
+ fprintf( report,"%s\n", explanation->explanation[i].c_str() );
+ }
+ }
+
+ fprintf(report, "============================================\n");
+ return true;
+}
+
+bool ReportsText::PutSizeLine(
+ FILE* report,
+ Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
+ Coverage::CoverageRanges::ranges_t::iterator range
+)
+{
+ fprintf(
+ report,
+ "%d\t%s\t%s\n",
+ range->highAddress - range->lowAddress + 1,
+ symbol->first.c_str(),
+ range->lowSourceLine.c_str()
+ );
+ return true;
+}
+
+}
diff -u gcc-testing/rtems-coverage/covoar.cc:1.12 gcc-testing/rtems-coverage/covoar.cc:1.13
--- gcc-testing/rtems-coverage/covoar.cc:1.12 Thu May 6 10:10:45 2010
+++ gcc-testing/rtems-coverage/covoar.cc Thu May 6 12:54:13 2010
@@ -23,18 +23,16 @@
#include "ExecutableInfo.h"
#include "Explanations.h"
#include "ObjdumpProcessor.h"
-#include "Reports.h"
+#include "ReportsBase.h"
/*
* Variables to control general behavior
*/
-const char* branchReportFile = "branch.txt";
char* coverageFileExtension = NULL;
std::list<std::string> coverageFileNames;
int coverageExtensionLength = 0;
Coverage::CoverageFormats_t coverageFormat;
Coverage::CoverageReaderBase* coverageReader = NULL;
-const char* coverageReportFile = "uncovered.txt";
char* executable = NULL;
char* executableExtension = NULL;
int executableExtensionLength = 0;
@@ -42,7 +40,6 @@
const char* explanations = NULL;
char* progname;
bool singleExecutable = false;
-const char* sizeReportFile = "sizes.txt";
const char* symbolsFile = NULL;
const char* target = NULL;
const char* format = NULL;
@@ -365,26 +362,7 @@
//
// Report the coverage data.
//
-
- // Generate report of ranges not executed.
- if (Verbose)
- fprintf( stderr, "Writing coverage report (%s)\n", coverageReportFile );
- Coverage::WriteCoverageReport( coverageReportFile );
-
- // Generate report of branches taken/not taken.
- if (Verbose)
- fprintf( stderr, "Writing branch report (%s)\n", branchReportFile );
- Coverage::WriteBranchReport( branchReportFile );
-
- // Generate report of range sizes.
- if (Verbose)
- fprintf( stderr, "Writing size report (%s)\n", sizeReportFile );
- Coverage::WriteSizeReport( sizeReportFile );
-
- // Generate annotated assembly file
- if (Verbose)
- fprintf( stderr, "Writing annotated report (%s)\n", "annotated.txt" );
- Coverage::WriteAnnotatedReport( "annotated.txt" );
+ Coverage::GenerateReports();
// Write explanations that were not found.
if ( explanations ) {
--
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/20100506/af76c6fe/attachment-0001.html>
More information about the vc
mailing list