summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2016-03-22 13:09:44 -0500
committerJoel Sherrill <joel@rtems.org>2016-03-22 13:09:44 -0500
commit6b8d5436fee9045e0dfacb10aa3b12bdab461670 (patch)
tree790da436f1d45a0ac0edf0e7053877b06f1b67bd
parent8c82823aff36b5a59d1154d37a3a109f3d06f736 (diff)
Remove covoar from rtems-testing. Moved to rtems-tools months ago.
-rw-r--r--covoar/.gitignore10
-rw-r--r--covoar/05_ascending.gifbin173 -> 0 bytes
-rw-r--r--covoar/05_descending.gifbin175 -> 0 bytes
-rw-r--r--covoar/05_unsorted.gifbin122 -> 0 bytes
-rw-r--r--covoar/ConfigFile.cc196
-rw-r--r--covoar/ConfigFile.h86
-rw-r--r--covoar/CoverageFactory.cc81
-rw-r--r--covoar/CoverageFactory.h64
-rw-r--r--covoar/CoverageMap.cc23
-rw-r--r--covoar/CoverageMap.h40
-rw-r--r--covoar/CoverageMapBase.cc399
-rw-r--r--covoar/CoverageMapBase.h411
-rw-r--r--covoar/CoverageRanges.cc61
-rw-r--r--covoar/CoverageRanges.h129
-rw-r--r--covoar/CoverageReaderBase.cc19
-rw-r--r--covoar/CoverageReaderBase.h48
-rw-r--r--covoar/CoverageReaderQEMU.cc168
-rw-r--r--covoar/CoverageReaderQEMU.h46
-rw-r--r--covoar/CoverageReaderRTEMS.cc108
-rw-r--r--covoar/CoverageReaderRTEMS.h44
-rw-r--r--covoar/CoverageReaderSkyeye.cc126
-rw-r--r--covoar/CoverageReaderSkyeye.h44
-rw-r--r--covoar/CoverageReaderTSIM.cc102
-rw-r--r--covoar/CoverageReaderTSIM.h45
-rw-r--r--covoar/CoverageWriterBase.cc20
-rw-r--r--covoar/CoverageWriterBase.h57
-rw-r--r--covoar/CoverageWriterRTEMS.cc88
-rw-r--r--covoar/CoverageWriterRTEMS.h44
-rw-r--r--covoar/CoverageWriterSkyeye.cc90
-rw-r--r--covoar/CoverageWriterSkyeye.h44
-rw-r--r--covoar/CoverageWriterTSIM.cc78
-rw-r--r--covoar/CoverageWriterTSIM.h44
-rw-r--r--covoar/DesiredSymbols.cc692
-rw-r--r--covoar/DesiredSymbols.h336
-rw-r--r--covoar/Doxyfile1520
-rw-r--r--covoar/ExecutableInfo.cc129
-rw-r--r--covoar/ExecutableInfo.h163
-rw-r--r--covoar/Explanations.cc191
-rw-r--r--covoar/Explanations.h119
-rw-r--r--covoar/GcovData.cc508
-rw-r--r--covoar/GcovData.h199
-rw-r--r--covoar/GcovFunctionData.cc602
-rw-r--r--covoar/GcovFunctionData.h274
-rw-r--r--covoar/Makefile158
-rw-r--r--covoar/ObjdumpProcessor.cc465
-rw-r--r--covoar/ObjdumpProcessor.h165
-rw-r--r--covoar/ReportsBase.cc578
-rw-r--r--covoar/ReportsBase.h398
-rw-r--r--covoar/ReportsHtml.cc1057
-rw-r--r--covoar/ReportsHtml.h215
-rw-r--r--covoar/ReportsText.cc275
-rw-r--r--covoar/ReportsText.h124
-rw-r--r--covoar/SymbolTable.cc123
-rw-r--r--covoar/SymbolTable.h128
-rw-r--r--covoar/TargetBase.cc136
-rw-r--r--covoar/TargetBase.h163
-rw-r--r--covoar/TargetFactory.cc89
-rw-r--r--covoar/TargetFactory.h37
-rw-r--r--covoar/Target_arm.cc87
-rw-r--r--covoar/Target_arm.h77
-rw-r--r--covoar/Target_i386.cc111
-rw-r--r--covoar/Target_i386.h76
-rw-r--r--covoar/Target_lm32.cc52
-rw-r--r--covoar/Target_lm32.h70
-rw-r--r--covoar/Target_m68k.cc126
-rw-r--r--covoar/Target_m68k.h84
-rw-r--r--covoar/Target_powerpc.cc85
-rw-r--r--covoar/Target_powerpc.h80
-rw-r--r--covoar/Target_sparc.cc91
-rw-r--r--covoar/Target_sparc.h79
-rw-r--r--covoar/TraceConverter.cc104
-rw-r--r--covoar/TraceList.cc50
-rw-r--r--covoar/TraceList.h106
-rw-r--r--covoar/TraceReaderBase.cc19
-rw-r--r--covoar/TraceReaderBase.h55
-rw-r--r--covoar/TraceReaderLogQEMU.cc172
-rw-r--r--covoar/TraceReaderLogQEMU.h50
-rw-r--r--covoar/TraceWriterBase.cc20
-rw-r--r--covoar/TraceWriterBase.h49
-rw-r--r--covoar/TraceWriterQEMU.cc144
-rw-r--r--covoar/TraceWriterQEMU.h50
-rw-r--r--covoar/app_common.cc83
-rw-r--r--covoar/app_common.h29
-rw-r--r--covoar/configFile.txt22
-rw-r--r--covoar/configfile_test.cc23
-rw-r--r--covoar/coverage_converter.cc220
-rw-r--r--covoar/covmerge.cc541
-rw-r--r--covoar/covoar.cc507
-rw-r--r--covoar/covoar.css372
-rw-r--r--covoar/covoar_flow.docbin13824 -> 0 bytes
-rw-r--r--covoar/filter.gifbin321 -> 0 bytes
-rwxr-xr-xcovoar/mkExplanation70
-rw-r--r--covoar/qemu-dump-trace.c67
-rw-r--r--covoar/qemu-log.h23
-rw-r--r--covoar/qemu-traces.h119
-rw-r--r--covoar/rtemscov_header.h32
-rw-r--r--covoar/skyeye_header.h21
-rw-r--r--covoar/table.js1002
98 files changed, 0 insertions, 16527 deletions
diff --git a/covoar/.gitignore b/covoar/.gitignore
deleted file mode 100644
index b32dd68..0000000
--- a/covoar/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-configfile-test
-coverage_converter
-covmerge
-covoar
-Explanations.txt.NotFound
-html
-latex
-qemu-dump-trace
-trace-converter
-warnings.log
diff --git a/covoar/05_ascending.gif b/covoar/05_ascending.gif
deleted file mode 100644
index ac9bb74..0000000
--- a/covoar/05_ascending.gif
+++ /dev/null
Binary files differ
diff --git a/covoar/05_descending.gif b/covoar/05_descending.gif
deleted file mode 100644
index d46af03..0000000
--- a/covoar/05_descending.gif
+++ /dev/null
Binary files differ
diff --git a/covoar/05_unsorted.gif b/covoar/05_unsorted.gif
deleted file mode 100644
index 242d940..0000000
--- a/covoar/05_unsorted.gif
+++ /dev/null
Binary files differ
diff --git a/covoar/ConfigFile.cc b/covoar/ConfigFile.cc
deleted file mode 100644
index ccfc00a..0000000
--- a/covoar/ConfigFile.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-
-/*! @file ConfigFile.cc
- * @brief ConfigFile Implementation
- *
- * This file contains the implementation of the FileReader class.
- */
-
-#include "ConfigFile.h"
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-namespace Configuration {
-
- FileReader::FileReader(
- Options_t *options
- )
- {
- options_m = options;
- }
-
- FileReader::~FileReader()
- {
- }
-
- bool FileReader::processFile(
- const char* const file
- )
- {
- #define METHOD "FileReader::processFile - "
- FILE * in;
- char line[256];
- char option[256];
- char value[256];
- int line_no;
- int i;
- int j;
-
- if ( file == NULL ) {
- fprintf( stderr, METHOD "NULL filename\n" );
- return false;
- }
-
- in = fopen( file, "r" );
- if ( !in ) {
- fprintf( stderr, METHOD "unable to open %s\n", file );
- return false;
- }
-
- line_no = 0;
- while (fgets(line, sizeof(line), in) != NULL) {
- int length;
-
- line_no++;
-
- length = (int) strlen( line );
- if ( line[length - 1] != '\n' ) {
- fprintf(
- stderr,
- "%s: line %d is too long",
- file,
- line_no
- );
- continue;
- }
-
- line[length - 1] = '\0';
- length--;
-
- /*
- * Strip off comments at end of line
- *
- * LHS = RHS # comment
- */
- for (i=0 ; i<length ; i++ ) {
- if ( line[i] == '#' ) {
- line[i] = '\0';
- length = i;
- break;
- }
- }
-
- /*
- * Strip off trailing white space
- */
- for (i=length-1 ; i>=0 && isspace(line[i]) ; i-- )
- ;
-
- line[i+1] = '\0';
- length = i+1;
-
- /* Ignore empty lines. We have stripped
- * all comments and blanks therefore, only
- * an empty string needs to be checked.
- */
- if (line[0] == '\0')
- continue;
-
- if (sscanf(line, "%s", option) != 1) {
- fprintf(
- stderr,
- "%s: line %d is invalid: %s\n",
- file,
- line_no,
- line
- );
- continue;
- }
-
- for (i=0; ((line[i] != '=') && (i<length)); i++)
- ;
-
- if (i == length) {
- fprintf(
- stderr,
- "%s: line %d is invalid: %s\n",
- file,
- line_no,
- line
- );
- continue;
- }
-
- i++;
- value[0] = '\0';
- while ( isspace(line[i]) )
- i++;
- for (j=0; line[i] != '\0'; i++, j++ )
- value[j] = line[i];
- value[j] = '\0';
- if (value[0] == '\0') {
- fprintf(
- stderr,
- "%s: line %d is invalid: %s\n",
- file,
- line_no,
- line
- );
- continue;
- }
-
- if ( !setOption(option, value) ) {
- fprintf(
- stderr,
- "%s: line %d: option %s is unknown\n",
- file,
- line_no,
- option
- );
- continue;
- }
-
- }
-
- return false;
- }
-
- bool FileReader::setOption(
- const char* const option,
- const char* const value
- )
- {
- Options_t *o;
-
- for ( o=options_m ; o->option ; o++ ) {
- if ( !strcmp( o->option, option ) ) {
- o->value = strdup( value );
- return true;
- }
- }
- return false;
- }
-
- const char *FileReader::getOption(
- const char* const option
- )
- {
- Options_t *o;
-
- for ( o=options_m ; o->option ; o++ ) {
- if ( !strcmp( o->option, option ) ) {
- return o->value;
- }
- }
- return NULL;
- }
-
- void FileReader::printOptions(void)
- {
- Options_t *o;
-
- for ( o=options_m ; o->option ; o++ ) {
- fprintf( stderr, "(%s)=(%s)\n", o->option, o->value );
- }
- }
-}
diff --git a/covoar/ConfigFile.h b/covoar/ConfigFile.h
deleted file mode 100644
index 88da81b..0000000
--- a/covoar/ConfigFile.h
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-/*! @file ConfigFile.h
- * @brief Configuration File Reader Specification
- *
- * This file contains the specification of the FileReader class.
- */
-
-#ifndef __CONFIGURATION_FILE_H__
-#define __CONFIGURATION_FILE_H__
-
-namespace Configuration {
-
- /*!
- *
- * This structure contains the configuration parameter
- * name and value pair.
- */
- typedef struct {
- const char *option;
- const char *value;
- } Options_t;
-
-
- /*! @class FileReader
- *
- * This is the specification of the FileReader base class.
- * All FileReader implementations inherit from this class.
- */
- class FileReader {
-
- public:
-
- /*!
- * This method constructs a FileReader instance.
- *
- * @param[in] options is the set of options
- */
- FileReader(
- Options_t *options
- );
-
- /*!
- * This method destructs a FileReader instance.
- */
- virtual ~FileReader();
-
- /*!
- * This method processes the configuratino information from the input
- * @a file.
- *
- * @param[in] file is the coverage file to process
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- virtual bool processFile(
- const char* const file
- );
-
- bool setOption(
- const char* const option,
- const char* const value
- );
-
- const char *getOption(
- const char* const option
- );
-
- void printOptions(void);
-
- private:
- /*!
- * This method processes the configuratino information from the input
- * @a file.
- *
- * @param[in] option is the name of the option
- * @param[in] value is the associated value
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- Options_t *options_m;
-
- };
-
-}
-#endif
diff --git a/covoar/CoverageFactory.cc b/covoar/CoverageFactory.cc
deleted file mode 100644
index 8b30371..0000000
--- a/covoar/CoverageFactory.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-/*! @file CoverageFactory.cc
- * @brief CoverageFactory Implementation
- *
- * This file contains the implementation of the functions supporting
- * creating a CoverageReader or CoverageWriter of a specific type
- * based upon user configuration.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "CoverageFactory.h"
-#include "CoverageReaderQEMU.h"
-#include "CoverageReaderRTEMS.h"
-#include "CoverageWriterRTEMS.h"
-#include "CoverageReaderSkyeye.h"
-#include "CoverageWriterSkyeye.h"
-#include "CoverageReaderTSIM.h"
-#include "CoverageWriterTSIM.h"
-
-Coverage::CoverageFormats_t Coverage::CoverageFormatToEnum(
- const char* const format
-)
-{
- if (!strcmp( format, "QEMU" ))
- return COVERAGE_FORMAT_QEMU;
-
- if (!strcmp( format, "RTEMS" ))
- return COVERAGE_FORMAT_RTEMS;
-
- if (!strcmp( format, "Skyeye" ))
- return COVERAGE_FORMAT_SKYEYE;
-
- if (!strcmp( format, "TSIM" ))
- return COVERAGE_FORMAT_TSIM;
-
- fprintf(
- stderr,
- "ERROR: %s is an unknown coverage format "
- "(supported formats - QEMU, RTEMS, Skyeye and TSIM)\n",
- format
- );
- exit( 1 );
-}
-
-Coverage::CoverageReaderBase* Coverage::CreateCoverageReader(
- CoverageFormats_t format
-)
-{
- switch (format) {
- case COVERAGE_FORMAT_QEMU:
- return new Coverage::CoverageReaderQEMU();
- case COVERAGE_FORMAT_RTEMS:
- return new Coverage::CoverageReaderRTEMS();
- case COVERAGE_FORMAT_SKYEYE:
- return new Coverage::CoverageReaderSkyeye();
- case COVERAGE_FORMAT_TSIM:
- return new Coverage::CoverageReaderTSIM();
- default:
- break;
- }
- return NULL;
-}
-
-Coverage::CoverageWriterBase* Coverage::CreateCoverageWriter(
- CoverageFormats_t format
-)
-{
- switch (format) {
- case COVERAGE_FORMAT_RTEMS:
- return new Coverage::CoverageWriterRTEMS();
- case COVERAGE_FORMAT_SKYEYE:
- return new Coverage::CoverageWriterSkyeye();
- case COVERAGE_FORMAT_TSIM:
- return new Coverage::CoverageWriterTSIM();
- default:
- break;
- }
- return NULL;
-}
diff --git a/covoar/CoverageFactory.h b/covoar/CoverageFactory.h
deleted file mode 100644
index 4770d78..0000000
--- a/covoar/CoverageFactory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*! @file CoverageFactory.h
- * @brief CoverageFactory Specification
- *
- * This file contains the specification of the CoverageFactory methods.
- * This collection of methods is used to create CoverageReader and/or
- * CoverageWriter instances for a particular coverage file format.
- */
-
-#ifndef __COVERAGE_FACTORY_H__
-#define __COVERAGE_FACTORY_H__
-
-#include "CoverageReaderBase.h"
-#include "CoverageWriterBase.h"
-
-namespace Coverage {
-
- /*!
- * This type defines the coverage file formats that are supported.
- */
- typedef enum {
- COVERAGE_FORMAT_QEMU,
- COVERAGE_FORMAT_RTEMS,
- COVERAGE_FORMAT_SKYEYE,
- COVERAGE_FORMAT_TSIM
- } CoverageFormats_t;
-
- /*!
- * This method returns the coverage file format that corresponds
- * to the specified string.
- *
- * @param[in] format is a string specifying the coverage file format
- *
- * @return Returns a coverage file format.
- */
- CoverageFormats_t CoverageFormatToEnum(
- const char* const format
- );
-
- /*!
- * This method returns an instance of a Coverage File Reader class
- * that corresponds to the specified coverage file format.
- *
- * @param[in] format specifies the coverage file format
- *
- * @return Returns a Coverage File Reader class instance.
- */
- CoverageReaderBase* CreateCoverageReader(
- CoverageFormats_t format
- );
-
- /*!
- * This method returns an instance of a Coverage File Writer class
- * that corresponds to the specified coverage file format.
- *
- * @param[in] format specifies the coverage file format
- *
- * @return Returns a Coverage File Writer class instance.
- */
- CoverageWriterBase* CreateCoverageWriter(
- CoverageFormats_t format
- );
-}
-
-#endif
diff --git a/covoar/CoverageMap.cc b/covoar/CoverageMap.cc
deleted file mode 100644
index 816be11..0000000
--- a/covoar/CoverageMap.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-/*! @file CoverageMap.cc
- * @brief CoverageMap Implementation
- *
- * This file contains the implementation of the functions supporting
- * a CoverageMap. Currently, it adds no functionality to CoverageMapBase.
- */
-
-#include "CoverageMap.h"
-
-namespace Coverage {
-
- CoverageMap::CoverageMap(
- uint32_t low,
- uint32_t high
- ) : CoverageMapBase(low, high)
- {
- }
-
- CoverageMap::~CoverageMap()
- {
- }
-
-}
diff --git a/covoar/CoverageMap.h b/covoar/CoverageMap.h
deleted file mode 100644
index 0f2f6d4..0000000
--- a/covoar/CoverageMap.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*! @file CoverageMap.h
- * @brief CoverageMap Specification
- *
- * This file contains the specification of the CoverageMap class.
- */
-
-#ifndef __COVERAGE_MAP_H__
-#define __COVERAGE_MAP_H__
-
-#include "CoverageMapBase.h"
-
-namespace Coverage {
-
- /*! @class CoverageMap
- *
- * This class implements a coverage map which supports a single
- * range of addresses from low to high.
- */
- class CoverageMap : public CoverageMapBase {
-
- public:
-
- /*!
- * This method constructs a CoverageMap instance.
- *
- * @param[in] low specifies the lowest address of the coverage map.
- * @param[in] high specifies the highest address of the coverage map.
- */
- CoverageMap(
- uint32_t low,
- uint32_t high
- );
-
- /* Inherit documentation from base class. */
- virtual ~CoverageMap();
-
- };
-
-}
-#endif
diff --git a/covoar/CoverageMapBase.cc b/covoar/CoverageMapBase.cc
deleted file mode 100644
index 407ef5f..0000000
--- a/covoar/CoverageMapBase.cc
+++ /dev/null
@@ -1,399 +0,0 @@
-
-/*! @file CoverageMapBase.cc
- * @brief CoverageMapBase Implementation
- *
- * This file contains the implementation of the functions
- * which provide a base level of functionality of a CoverageMap.
- */
-
-#include <libgen.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "CoverageMapBase.h"
-
-namespace Coverage {
-
- CoverageMapBase::CoverageMapBase(
- uint32_t low,
- uint32_t high
- )
- {
- uint32_t a;
- AddressRange_t range;
-
- range.lowAddress = low;
- range.highAddress = high;
- RangeList.push_back( range );
-
- Size = high - low + 1;
-
- Info = new perAddressInfo_t[ Size ];
-
- for (a=0; a<Size; a++) {
-
- perAddressInfo_t *i = &Info[ a ];
-
- i->isStartOfInstruction = false;
- i->wasExecuted = 0;
- i->isBranch = false;
- i->isNop = false;
- i->wasTaken = 0;
- i->wasNotTaken = 0;
- }
- }
-
- CoverageMapBase::~CoverageMapBase()
- {
- if (Info)
- delete Info;
- }
-
- void CoverageMapBase::Add( uint32_t low, uint32_t high )
- {
- AddressRange_t range;
-
- range.lowAddress = low;
- range.highAddress = high;
- RangeList.push_back( range );
- }
-
- bool CoverageMapBase::determineOffset(
- uint32_t address,
- uint32_t *offset
- )const
- {
- AddressRange::const_iterator itr;
-
- for ( itr = RangeList.begin(); itr != RangeList.end(); itr++ ) {
- if ((address >= itr->lowAddress) && (address <= itr->highAddress)){
- *offset = address - itr->lowAddress;
- return true;
- }
- }
- *offset = 0;
- return false;
- }
-
-
- void CoverageMapBase::dump( void ) const {
-
- uint32_t a;
- perAddressInfo_t* entry;
-
- fprintf( stderr, "Coverage Map Contents:\n" );
-
- /*
- * XXX - Dump is only marking the first Address Range.
- */
-
- for (a = 0; a < Size; a++) {
-
- entry = &Info[ a ];
-
- fprintf(
- stderr,
- "0x%x - isStartOfInstruction = %s, wasExecuted = %s\n",
- a + RangeList.front().lowAddress,
- entry->isStartOfInstruction ? "TRUE" : "FALSE",
- entry->wasExecuted ? "TRUE" : "FALSE"
- );
- fprintf(
- stderr,
- " isBranch = %s, wasTaken = %s, wasNotTaken = %s\n",
- entry->isBranch ? "TRUE" : "FALSE",
- entry->wasTaken ? "TRUE" : "FALSE",
- entry->wasNotTaken ? "TRUE" : "FALSE"
- );
- }
- }
-
- bool CoverageMapBase::getBeginningOfInstruction(
- uint32_t address,
- uint32_t* beginning
- ) const
- {
- bool status = false;
- uint32_t start;
- AddressRange_t range;
-
-
- status = getRange( address, &range );
- if ( status != true )
- return status;
-
- start = address;
-
- while (start >= range.lowAddress ) {
- if (Info[ start - range.lowAddress ].isStartOfInstruction) {
- *beginning = start;
- status = true;
- break;
- }
- else
- start--;
- }
-
- return status;
- }
-
- int32_t CoverageMapBase::getFirstLowAddress() const
- {
- return RangeList.front().lowAddress;
- }
-
- bool CoverageMapBase::getRange( uint32_t address, AddressRange_t *range ) const
- {
- AddressRange::const_iterator itr;
-
- for ( itr = RangeList.begin(); itr != RangeList.end(); itr++ ) {
- if ((address >= itr->lowAddress) && (address <= itr->highAddress)){
- range->lowAddress = itr->lowAddress;
- range->highAddress = itr->highAddress;
- return true;
- }
- }
-
- range->lowAddress = 0;
- range->highAddress = 0;
-
- return false;
-
- }
-
- uint32_t CoverageMapBase::getSize() const
- {
- return Size;
- }
-
- void CoverageMapBase::setIsStartOfInstruction(
- uint32_t address
- )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].isStartOfInstruction = true;
- }
-
- bool CoverageMapBase::isStartOfInstruction( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return false;
-
- return Info[ offset ].isStartOfInstruction;
- }
-
- void CoverageMapBase::setWasExecuted( uint32_t address )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasExecuted += 1;
- }
-
- void CoverageMapBase::sumWasExecuted( uint32_t address, uint32_t addition)
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasExecuted += addition;
- }
-
- bool CoverageMapBase::wasExecuted( uint32_t address ) const
- {
- uint32_t offset;
- bool result;
-
- result = true;
-
- if (determineOffset( address, &offset ) != true)
- result = false;
-
- if (Info[ offset ].wasExecuted <= 0)
- result = false;
-
- return result;
- }
-
- uint32_t CoverageMapBase::getWasExecuted( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return 0;
-
- return Info[ offset ].wasExecuted;
- }
-
- void CoverageMapBase::setIsBranch(
- uint32_t address
- )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].isBranch = true;
- }
-
- bool CoverageMapBase::isNop( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return false;
-
- return Info[ offset ].isNop;
- }
-
- void CoverageMapBase::setIsNop(
- uint32_t address
- )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].isNop = true;
- }
-
- bool CoverageMapBase::isBranch( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return false;
-
- return Info[ offset ].isBranch;
- }
-
- void CoverageMapBase::setWasTaken(
- uint32_t address
- )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasTaken += 1;
- }
-
- void CoverageMapBase::setWasNotTaken(
- uint32_t address
- )
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasNotTaken += 1;
- }
-
- bool CoverageMapBase::wasAlwaysTaken( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return false;
-
- return (Info[ offset ].wasTaken &&
- !Info[ offset ].wasNotTaken);
- }
-
- bool CoverageMapBase::wasNeverTaken( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return false;
-
- return (!Info[ offset ].wasTaken &&
- Info[ offset ].wasNotTaken);
- }
-
- bool CoverageMapBase::wasNotTaken( uint32_t address ) const
- {
- uint32_t offset;
- bool result;
-
- result = true;
-
- if (determineOffset( address, &offset ) != true)
- result = false;
-
- if (Info[ offset ].wasNotTaken <= 0)
- result = false;
-
- return result;
- }
-
- void CoverageMapBase::sumWasNotTaken( uint32_t address, uint32_t addition)
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasNotTaken += addition;
- }
-
- uint32_t CoverageMapBase::getWasNotTaken( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return 0;
-
- return Info[ offset ].wasNotTaken;
- }
-
- bool CoverageMapBase::wasTaken( uint32_t address ) const
- {
- uint32_t offset;
- bool result;
-
- result = true;
-
- if (determineOffset( address, &offset ) != true)
- result = false;
-
- if (Info[ offset ].wasTaken <= 0)
- result = false;
-
- return result;
- }
-
- void CoverageMapBase::sumWasTaken( uint32_t address, uint32_t addition)
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return;
-
- Info[ offset ].wasTaken += addition;
- }
-
- uint32_t CoverageMapBase::getWasTaken( uint32_t address ) const
- {
- uint32_t offset;
-
- if (determineOffset( address, &offset ) != true)
- return 0;
-
- return Info[ offset ].wasTaken;
- }
-}
diff --git a/covoar/CoverageMapBase.h b/covoar/CoverageMapBase.h
deleted file mode 100644
index 70b2b30..0000000
--- a/covoar/CoverageMapBase.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/*! @file CoverageMapBase.h
- * @brief CoverageMapBase Specification
- *
- * This file contains the specification of the CoverageMapBase class.
- */
-
-#ifndef __COVERAGE_MAP_BASE_H__
-#define __COVERAGE_MAP_BASE_H__
-
-#include <stdint.h>
-#include <string>
-#include <list>
-
-namespace Coverage {
-
- /*! @class CoverageMapBase
- *
- * This is the base class for Coverage Map implementations.
- */
- class CoverageMapBase {
-
- public:
-
- /*!
- * This structure identifies the low and high addresses
- * of one range. Note:: There may be more than one address
- * range per symbol.
- */
- typedef struct {
- /*!
- * This is the low address of the address map range.
- */
- uint32_t lowAddress;
-
- /*!
- * This is the high address of the address map range.
- */
- uint32_t highAddress;
-
- } AddressRange_t;
-
- /*
- * This type identifies a list of ranges.
- */
- typedef std::list< AddressRange_t > AddressRange;
- typedef std::list< AddressRange_t >::iterator AddressRangeIterator_t;
-
- /*!
- * This method constructs a CoverageMapBase instance.
- *
- * @param[in] low specifies the lowest address of the coverage map
- * @param[in] high specifies the highest address of the coverage map
- */
- CoverageMapBase(
- uint32_t low,
- uint32_t high
- );
-
- /*!
- * This method destructs a CoverageMapBase instance.
- */
- virtual ~CoverageMapBase();
-
- /*!
- * This method adds a address range to the RangeList.
- *
- * @param[in] Low specifies the lowAddress
- * @param[in] High specifies the highAddress
- *
- */
- void Add( uint32_t low, uint32_t high );
-
- /*!
- * This method returns true and sets the offset if
- * the address falls with the bounds of an address range
- * in the RangeList.
- *
- * @param[in] address specifies the address to find
- * @param[out] offset contains the offset from the low
- * address of the address range.
- *
- * @return Returns TRUE if the address range can be found
- * and FALSE if it was not.
- */
- bool determineOffset( uint32_t address, uint32_t *offset ) const;
-
- /*!
- * This method prints the contents of the coverage map to stdout.
- */
- void dump( void ) const;
-
- /*!
- * This method will return the low address of the first range in
- * the RangeList.
- *
- * @return Returns the low address of the first range in
- * the RangeList.
- */
- int32_t getFirstLowAddress() const;
-
- /*!
- * This method returns true and sets the address range if
- * the address falls with the bounds of an address range
- * in the RangeList.
- *
- * @param[in] address specifies the address to find
- * @param[out] range contains the high and low addresse for
- * the range
- *
- * @return Returns TRUE if the address range can be found
- * and FALSE if it was not.
- */
- bool getRange( uint32_t address, AddressRange_t *range ) const;
-
- /*!
- * This method returns the size of the address range.
- *
- * @return Returns Size of the address range.
- */
- uint32_t getSize() const;
-
-
- /*!
- * This method returns the address of the beginning of the
- * instruction that contains the specified address.
- *
- * @param[in] address specifies the address to search from
- * @param[out] beginning contains the address of the beginning of
- * the instruction.
- *
- * @return Returns TRUE if the beginning of the instruction was
- * found and FALSE if it was not.
- */
- bool getBeginningOfInstruction(
- uint32_t address,
- uint32_t* beginning
- ) const;
-
- /*!
- * This method returns the high address of the coverage map.
- *
- * @return Returns the high address of the coverage map.
- uint32_t getHighAddress( void ) const;
- */
-
- /*!
- * This method returns the low address of the coverage map.
- *
- * @return Returns the low address of the coverage map.
- uint32_t getLowAddress( void ) const;
- */
-
- /*!
- * This method sets the boolean which indicates if this
- * is the starting address for an instruction.
- *
- * @param[in] address specifies the address of the start of an instruction
- */
- void setIsStartOfInstruction(
- uint32_t address
- );
-
- /*!
- * This method returns a boolean which indicates if this
- * is the starting address of an instruction.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the specified address is the start
- * of an instruction and FALSE otherwise.
- */
- bool isStartOfInstruction( uint32_t address ) const;
-
- /*!
- * This method increments the counter which indicates how many times
- * the instruction at the specified address was executed.
- *
- * @param[in] address specifies the address which was executed
- */
- virtual void setWasExecuted( uint32_t address );
-
- /*!
- * This method returns a boolean which indicates if the instruction
- * at the specified address was executed.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the instruction at the specified
- * address was executed and FALSE otherwise.
- */
- bool wasExecuted( uint32_t address ) const;
-
- /*!
- * This method increases the counter which indicates how many times
- * the instruction at the specified address was executed. It is used
- * for merging coverage maps.
- *
- * @param[in] address specifies the address which was executed
- * @param[in] address specifies the execution count that should be
- * added
- */
- virtual void sumWasExecuted( uint32_t address, uint32_t addition );
-
- /*!
- * This method returns an unsigned integer which indicates how often
- * the instruction at the specified address was executed.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns number of executins
- */
- uint32_t getWasExecuted( uint32_t address ) const;
-
- /*!
- * This method sets the boolean which indicates if the specified
- * address is the starting address of a branch instruction.
- *
- * @param[in] address specifies the address of the branch instruction
- */
- void setIsBranch( uint32_t address );
-
- /*!
- * This method returns a boolean which indicates if the specified
- * address is the starting address of a NOP instruction.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if a NOP instruction is at the
- * specified address and FALSE otherwise.
- */
- bool isNop( uint32_t address ) const;
-
- /*!
- * This method sets the boolean which indicates if the specified
- * address is the starting address of a NOP instruction.
- *
- * @param[in] address specifies the address of the NOP instruction
- */
- void setIsNop( uint32_t address );
-
- /*!
- * This method returns a boolean which indicates if the specified
- * address is the starting address of a branch instruction.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if a branch instruction is at the
- * specified address and FALSE otherwise.
- */
- bool isBranch( uint32_t address ) const;
-
- /*!
- * This method increments the counter which indicates how many times
- * the branch at the specified address was taken.
- *
- * @param[in] address specifies the address of the branch instruction
- */
- void setWasTaken( uint32_t address );
-
- /*!
- * This method increases the counter which indicates how many times
- * the branch at the specified address was taken. It is used
- * for merging coverage maps.
- *
- * @param[in] address specifies the address which was executed
- * @param[in] address specifies the execution count that should be
- * added
- */
- virtual void sumWasTaken( uint32_t address, uint32_t addition );
-
- /*!
- * This method returns an unsigned integer which indicates how often
- * the branch at the specified address was taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns number of executins
- */
- uint32_t getWasTaken( uint32_t address ) const;
-
- /*!
- * This method increments the counter which indicates how many times
- * the branch at the specified address was not taken.
- *
- * @param[in] address specifies the address of the branch instruction
- */
- void setWasNotTaken( uint32_t address );
-
- /*!
- * This method increases the counter which indicates how many times
- * the branch at the specified address was not taken. It is used
- * for merging coverage maps.
- *
- * @param[in] address specifies the address which was executed
- * @param[in] address specifies the execution count that should be
- * added
- */
- virtual void sumWasNotTaken( uint32_t address, uint32_t addition );
-
- /*!
- * This method returns an unsigned integer which indicates how often
- * the branch at the specified address was not taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns number of executins
- */
- uint32_t getWasNotTaken( uint32_t address ) const;
-
-
- /*!
- * This method returns a boolean which indicates if the branch
- * instruction at the specified address is ALWAYS taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the branch instruction at the
- * specified address is ALWAYS taken and FALSE otherwise.
- */
- bool wasAlwaysTaken( uint32_t address ) const;
-
- /*!
- * This method returns a boolean which indicates if the branch
- * instruction at the specified address is NEVER taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the branch instruction at the
- * specified address is NEVER taken and FALSE otherwise.
- */
- bool wasNeverTaken( uint32_t address ) const;
-
- /*!
- * This method returns a boolean which indicates if the branch
- * instruction at the specified address was NOT taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the branch instruction at the
- * specified address was NOT taken and FALSE otherwise.
- */
- bool wasNotTaken( uint32_t address ) const;
-
- /*!
- * This method returns a boolean which indicates if the branch
- * instruction at the specified address was taken.
- *
- * @param[in] address specifies the address to check
- *
- * @return Returns TRUE if the branch instruction at the
- * specified address was taken and FALSE otherwise.
- */
- bool wasTaken( uint32_t address ) const;
-
- protected:
-
- /*!
- * This structure defines the information that is gathered and
- * tracked per address.
- */
- typedef struct {
- /*!
- * This member indicates that the address is the start of
- * an instruction.
- */
- bool isStartOfInstruction;
- /*!
- * This member indicates how many times the address was executed.
- */
- uint32_t wasExecuted;
- /*!
- * This member indicates that the address is a branch instruction.
- */
- bool isBranch;
- /*!
- * This member indicates that the address is a NOP instruction.
- */
- bool isNop;
- /*!
- * When isBranch is TRUE, this member indicates that the branch
- * instruction at the address was taken.
- */
- uint32_t wasTaken;
- /*!
- * When isBranch is TRUE, this member indicates that the branch
- * instruction at the address was NOT taken.
- */
- uint32_t wasNotTaken;
- } perAddressInfo_t;
-
- /*!
- *
- * This is a list of address ranges for this symbolic address.
- */
- AddressRange RangeList;
-
- /*!
- *
- * This variable contains the size of the code block.
- */
- uint32_t Size;
-
- /*!
- * This is a dynamically allocated array of data that is
- * kept for each address.
- */
- perAddressInfo_t* Info;
- };
-
-}
-#endif
diff --git a/covoar/CoverageRanges.cc b/covoar/CoverageRanges.cc
deleted file mode 100644
index 1f79dd3..0000000
--- a/covoar/CoverageRanges.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-/*! @file CoverageRanges.cc
- * @brief CoverageRanges Implementation
- *
- * This file contains the implementation of the functions
- * which provide a base level of functionality of a CoverageRanges.
- */
-
-#include "CoverageRanges.h"
-#include <stdio.h>
-
-namespace Coverage {
-
- /*!
- * This member variable tracks a unique index for the ranges_t block.
- */
- uint32_t id_m = 0;
-
- CoverageRanges::CoverageRanges()
- {
- }
-
- CoverageRanges::~CoverageRanges()
- {
- }
-
- void CoverageRanges::add(
- uint32_t lowAddressArg,
- uint32_t highAddressArg,
- uncoveredReason_t why,
- uint32_t numInstructions
- )
- {
- coverageRange_t c;
-
- id_m++;
- c.id = id_m;
- c.lowAddress = lowAddressArg;
- c.highAddress = highAddressArg;
- c.reason = why;
- c.instructionCount = numInstructions;
- set.push_back(c);
- }
-
- uint32_t CoverageRanges::getId( uint32_t lowAddress )
- {
- Coverage::CoverageRanges::ranges_t::iterator ritr;
- uint32_t result = 0;
-
- for (ritr = set.begin() ;
- ritr != set.end() ;
- ritr++ ) {
- if ( ritr->lowAddress == lowAddress ) {
- result = ritr->id;
- break;
- }
- }
-
- return result;
- }
-
-}
diff --git a/covoar/CoverageRanges.h b/covoar/CoverageRanges.h
deleted file mode 100644
index 17640b7..0000000
--- a/covoar/CoverageRanges.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*! @file CoverageRanges.h
- * @brief CoverageRanges Specification
- *
- * This file contains the specification of the CoverageRanges class.
- */
-
-#ifndef __COVERAGE_RANGES_H__
-#define __COVERAGE_RANGES_H__
-
-#include <stdint.h>
-#include <list>
-#include <string>
-
-namespace Coverage {
-
- /*! @class CoverageRanges
- *
- * This class defines a set of address ranges for which coverage
- * did not occur. Each address range can either define a range of
- * bytes that was not executed or a range of bytes for a branch
- * instruction that was not completely covered (i.e. taken and NOT
- * taken).
- */
- class CoverageRanges {
-
- public:
-
- /*!
- * This type defines the reasons to associate with a range.
- */
- typedef enum {
- UNCOVERED_REASON_NOT_EXECUTED,
- UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN,
- UNCOVERED_REASON_BRANCH_NEVER_TAKEN
- } uncoveredReason_t;
-
- /*!
- * This type defines the information kept for each range.
- */
- typedef struct {
- /*!
- * This member contains an identification number for this
- * coverage range.
- */
- uint32_t id;
-
- /*!
- * This member contains the low address of this coverage
- * range.
- */
- uint32_t lowAddress;
-
- /*!
- * This member contains the source line associated with the
- * low address for this coverage range.
- */
- std::string lowSourceLine;
-
- /*!
- * This member contains the high address for this coverage range.
- */
- uint32_t highAddress;
-
- /*!
- * This member contains the high source line for this coverage range.
- */
- std::string highSourceLine;
-
- /*!
- * This member contains an instruction count for this coverage
- * address range.
- */
- uint32_t instructionCount;
-
- /*!
- * This member contains the reason that this area was uncovered.
- */
- uncoveredReason_t reason;
- } coverageRange_t;
-
- /*!
- * This type contains a list of CoverageRange instances.
- */
- typedef std::list<coverageRange_t> ranges_t;
-
- /*!
- * This member contains a list of the CoverageRange instances.
- */
- ranges_t set;
-
- /*!
- * This method constructs a CoverageRanges instance.
- */
- CoverageRanges();
-
- /*!
- * This method destructs a CoverageRanges instance.
- */
- ~CoverageRanges();
-
- /*!
- * This method adds a range entry to the set of ranges.
- *
- * @param[in] lowAddressArg specifies the lowest address of the range
- * @param[in] highAddressArg specifies the highest address of the range
- * @param[in] why specifies the reason that the range was added
- *
- */
- void add(
- uint32_t lowAddressArg,
- uint32_t highAddressArg,
- uncoveredReason_t why,
- uint32_t numInstructions
- );
-
-
- /*!
- * This method returns the index of a range given the low address.
- * Upon failure on finding the adress 0 is returned.
- */
- uint32_t getId( uint32_t lowAddress );
-
- protected:
-
-
- };
-
-}
-#endif
diff --git a/covoar/CoverageReaderBase.cc b/covoar/CoverageReaderBase.cc
deleted file mode 100644
index 3ebcc8d..0000000
--- a/covoar/CoverageReaderBase.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-/*! @file CoverageReaderBase.cc
- * @brief CoverageReaderBase Implementation
- *
- * This file contains the implementation of the CoverageReader base class.
- * All CoverageReader implementations inherit from this.
- */
-
-#include "CoverageReaderBase.h"
-
-namespace Coverage {
-
- CoverageReaderBase::CoverageReaderBase()
- {
- }
-
- CoverageReaderBase::~CoverageReaderBase()
- {
- }
-}
diff --git a/covoar/CoverageReaderBase.h b/covoar/CoverageReaderBase.h
deleted file mode 100644
index bf59f88..0000000
--- a/covoar/CoverageReaderBase.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*! @file CoverageReaderBase.h
- * @brief CoverageReaderBase Specification
- *
- * This file contains the specification of the CoverageReaderBase class.
- */
-
-#ifndef __COVERAGE_READER_BASE_H__
-#define __COVERAGE_READER_BASE_H__
-
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- /*! @class CoverageReaderBase
- *
- * This is the specification of the CoverageReader base class.
- * All CoverageReader implementations inherit from this class.
- */
- class CoverageReaderBase {
-
- public:
-
- /*!
- * This method constructs a CoverageReaderBase instance.
- */
- CoverageReaderBase();
-
- /*!
- * This method destructs a CoverageReaderBase instance.
- */
- virtual ~CoverageReaderBase();
-
- /*!
- * This method processes the coverage information from the input
- * @a file and adds it to the specified @a executableInformation.
- *
- * @param[in] file is the coverage file to process
- * @param[in] executableInformation is the information for an
- * associated executable
- */
- virtual void processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- ) = 0;
- };
-
-}
-#endif
diff --git a/covoar/CoverageReaderQEMU.cc b/covoar/CoverageReaderQEMU.cc
deleted file mode 100644
index c8df89a..0000000
--- a/covoar/CoverageReaderQEMU.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/*! @file CoverageReaderQEMU.cc
- * @brief CoverageReaderQEMU Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the QEMU coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#include "app_common.h"
-#include "CoverageReaderQEMU.h"
-#include "CoverageMap.h"
-#include "ExecutableInfo.h"
-
-#include "qemu-traces.h"
-
-/* hack so this can compile on old Linux versions and FreeBSD */
-#if (__GNUC__ <= 2) || defined(__FreeBSD__)
-#define OPEN fopen
-#else
-#define OPEN fopen64
-#endif
-
-namespace Coverage {
-
- CoverageReaderQEMU::CoverageReaderQEMU()
- {
- BranchInfoAvailable = true;
- }
-
- CoverageReaderQEMU::~CoverageReaderQEMU()
- {
- }
-
- void CoverageReaderQEMU::processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- )
- {
- struct trace_header header;
- uintptr_t i;
- int status;
- FILE* traceFile;
- uint8_t taken;
- uint8_t notTaken;
- uint8_t branchInfo;
-
- taken = TargetInfo->qemuTakenBit();
- notTaken = TargetInfo->qemuNotTakenBit();
- branchInfo = taken | notTaken;
-
- //
- // Open the coverage file and read the header.
- //
- traceFile = OPEN( file, "r" );
- if (!traceFile) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderQEMU::processFile - Unable to open %s\n",
- file
- );
- exit( -1 );
- }
-
- status = fread( &header, sizeof(trace_header), 1, traceFile );
- if (status != 1) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderQEMU::processFile - "
- "Unable to read header from %s\n",
- file
- );
- exit( -1 );
- }
-
- #if 0
- fprintf(
- stderr,
- "magic = %s\n"
- "version = %d\n"
- "kind = %d\n"
- "sizeof_target_pc = %d\n"
- "big_endian = %d\n"
- "machine = %02x:%02x\n",
- header.magic,
- header.version,
- header.kind,
- header.sizeof_target_pc,
- header.big_endian,
- header.machine[0], header.machine[1]
- );
- #endif
-
- //
- // Read ENTRIES number of trace entries.
- //
-#define ENTRIES 1024
- while (1) {
- CoverageMapBase *aCoverageMap = NULL;
- struct trace_entry entries[ENTRIES];
- struct trace_entry *entry;
- int num_entries;
-
-
- // Read and process each line of the coverage file.
- num_entries = fread(
- entries,
- sizeof(struct trace_entry),
- ENTRIES,
- traceFile
- );
- if (num_entries == 0)
- break;
-
- // Get the coverage map for each entry. Note that the map is
- // the same for each entry in the coverage map
- for (int count=0; count<num_entries; count++) {
-
- entry = &entries[count];
-
- // Mark block as fully executed.
- // Obtain the coverage map containing the specified address.
- aCoverageMap = executableInformation->getCoverageMap( entry->pc );
-
- // Ensure that coverage map exists.
- if (!aCoverageMap)
- continue;
-
- // Set was executed for each TRACE_OP_BLOCK
- if (entry->op & TRACE_OP_BLOCK) {
- for (i=0; i<entry->size; i++) {
- aCoverageMap->setWasExecuted( entry->pc + i );
- }
- }
-
- // Determine if additional branch information is available.
- if ( (entry->op & branchInfo) != 0 ) {
- uint32_t offset_e, offset_a;
- uint32_t a = entry->pc + entry->size - 1;
- if ((aCoverageMap->determineOffset( a, &offset_a ) != true) ||
- (aCoverageMap->determineOffset( entry->pc, &offset_e ) != true))
- {
- fprintf(
- stderr,
- "*** Trace block is inconsistent with coverage map\n"
- "*** Trace block (0x%08x - 0x%08x) for %d bytes\n"
- "*** Coverage map XXX \n",
- entry->pc,
- a,
- entry->size
- );
- } else {
- while (!aCoverageMap->isStartOfInstruction(a))
- a--;
- if (entry->op & taken) {
- aCoverageMap->setWasTaken( a );
- } else if (entry->op & notTaken) {
- aCoverageMap->setWasNotTaken( a );
- }
- }
- }
- }
- }
- fclose( traceFile );
- }
-}
diff --git a/covoar/CoverageReaderQEMU.h b/covoar/CoverageReaderQEMU.h
deleted file mode 100644
index ec87ff0..0000000
--- a/covoar/CoverageReaderQEMU.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*! @file CoverageReaderQEMU.h
- * @brief CoverageReaderQEMU Specification
- *
- * This file contains the specification of the CoverageReaderQEMU class.
- */
-
-#ifndef __COVERAGE_READER_QEMU_H__
-#define __COVERAGE_READER_QEMU_H__
-
-#include "CoverageReaderBase.h"
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- /*! @class CoverageReaderQEMU
- *
- * This class implements the functionality which reads a coverage map
- * file produced by QEMU. Since the SPARC has 32-bit instructions,
- * QEMU produces a file with an integer for each 32-bit word. The
- * integer will have the least significant bit set if the address
- * was executed. QEMU also supports reporting branch information.
- * Several bits are set to indicate whether a branch was taken and
- * NOT taken.
-@verbatim
-TBD
-@endverbatim
- */
- class CoverageReaderQEMU : public CoverageReaderBase {
-
- public:
-
- /* Inherit documentation from base class. */
- CoverageReaderQEMU();
-
- /* Inherit documentation from base class. */
- virtual ~CoverageReaderQEMU();
-
- /* Inherit documentation from base class. */
- void processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageReaderRTEMS.cc b/covoar/CoverageReaderRTEMS.cc
deleted file mode 100644
index 8439c41..0000000
--- a/covoar/CoverageReaderRTEMS.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*! @file CoverageReaderRTEMS.cc
- * @brief CoverageReaderRTEMS Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the RTEMS coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#include "CoverageReaderRTEMS.h"
-#include "CoverageMap.h"
-#include "ExecutableInfo.h"
-#include "rtemscov_header.h"
-
-namespace Coverage {
-
- CoverageReaderRTEMS::CoverageReaderRTEMS()
- {
- }
-
- CoverageReaderRTEMS::~CoverageReaderRTEMS()
- {
- }
-
- void CoverageReaderRTEMS::processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- )
- {
- CoverageMapBase* aCoverageMap = NULL;
- uintptr_t baseAddress;
- uint8_t cover;
- FILE* coverageFile;
- rtems_coverage_map_header_t header;
- uintptr_t i;
- uintptr_t length;
- int status;
-
- //
- // Open the coverage file and read the header.
- //
- coverageFile = fopen( file, "r" );
- if (!coverageFile) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderRTEMS::processFile - Unable to open %s\n",
- file
- );
- exit( -1 );
- }
-
- status = fread( &header, sizeof(header), 1, coverageFile );
- if (status != 1) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderRTEMS::processFile - "
- "Unable to read header from %s\n",
- file
- );
- exit( -1 );
- }
-
- baseAddress = header.start;
- length = header.end - header.start;
-
- #if 0
- fprintf(
- stderr,
- "%s: 0x%08x 0x%08x 0x%08lx/%ld\n",
- file,
- header.start,
- header.end,
- (unsigned long) length,
- (unsigned long) length
- );
- #endif
-
- //
- // Read and process each line of the coverage file.
- //
- for (i=0; i<length; i++) {
- status = fread( &cover, sizeof(uint8_t), 1, coverageFile );
- if (status != 1) {
- fprintf(
- stderr,
- "CoverageReaderRTEMS::ProcessFile - breaking after 0x%08x in %s\n",
- (unsigned int) i,
- file
- );
- break;
- }
-
- //
- // Obtain the coverage map containing the address and
- // mark the address as executed.
- //
- if (cover) {
- aCoverageMap = executableInformation->getCoverageMap( baseAddress + i );
- if (aCoverageMap)
- aCoverageMap->setWasExecuted( baseAddress + i );
- }
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageReaderRTEMS.h b/covoar/CoverageReaderRTEMS.h
deleted file mode 100644
index 0b30285..0000000
--- a/covoar/CoverageReaderRTEMS.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! @file CoverageReaderRTEMS.h
- * @brief CoverageReaderRTEMS Specification
- *
- * This file contains the specification of the CoverageReaderRTEMS class.
- */
-
-#ifndef __COVERAGE_READER_RTEMS_H__
-#define __COVERAGE_READER_RTEMS_H__
-
-#include "CoverageReaderBase.h"
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- /*! @class CoverageReaderRTEMS
- *
- * This class implements the functionality which reads a coverage map
- * file produced by RTEMS. Since the SPARC has 32-bit instructions,
- * RTEMS produces a file with an integer for each 32-bit word. The
- * integer will have the least significant bit set if the address
- * was executed.
-@verbatim
-TBD
-@endverbatim
- */
- class CoverageReaderRTEMS : public CoverageReaderBase {
-
- public:
-
- /* Inherit documentation from base class. */
- CoverageReaderRTEMS();
-
- /* Inherit documentation from base class. */
- virtual ~CoverageReaderRTEMS();
-
- /* Inherit documentation from base class. */
- void processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageReaderSkyeye.cc b/covoar/CoverageReaderSkyeye.cc
deleted file mode 100644
index 293aef3..0000000
--- a/covoar/CoverageReaderSkyeye.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/*! @file CoverageReaderSkyeye.cc
- * @brief CoverageReaderSkyeye Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the Skyeye coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#include "CoverageReaderSkyeye.h"
-#include "CoverageMap.h"
-#include "ExecutableInfo.h"
-#include "skyeye_header.h"
-
-namespace Coverage {
-
- CoverageReaderSkyeye::CoverageReaderSkyeye()
- {
- }
-
- CoverageReaderSkyeye::~CoverageReaderSkyeye()
- {
- }
-
- void CoverageReaderSkyeye::processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- )
- {
- CoverageMapBase* aCoverageMap = NULL;
- uintptr_t baseAddress;
- uint8_t cover;
- FILE* coverageFile;
- prof_header_t header;
- uintptr_t i;
- uintptr_t length;
- int status;
-
- //
- // Open the coverage file and read the header.
- //
- coverageFile = fopen( file, "r" );
- if (!coverageFile) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderSkyeye::processFile - Unable to open %s\n",
- file
- );
- exit( -1 );
- }
-
- status = fread( &header, sizeof(header), 1, coverageFile );
- if (status != 1) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderSkyeye::processFile - "
- "Unable to read header from %s\n",
- file
- );
- exit( -1 );
- }
-
- baseAddress = header.prof_start;
- length = header.prof_end - header.prof_start;
-
- #if 0
- fprintf(
- stderr,
- "%s: 0x%08x 0x%08x 0x%08lx/%ld\n",
- file,
- header.prof_start,
- header.prof_end,
- (unsigned long) length,
- (unsigned long) length
- );
- #endif
-
- //
- // Read and process each line of the coverage file.
- //
- for (i=0; i<length; i+=8) {
- status = fread( &cover, sizeof(uint8_t), 1, coverageFile );
- if (status != 1) {
- fprintf(
- stderr,
- "CoverageReaderSkyeye::ProcessFile - breaking after 0x%08x in %s\n",
- (unsigned int) i,
- file
- );
- break;
- }
-
- //
- // Obtain the coverage map containing the address and
- // mark the address as executed.
- //
- // NOTE: This method ONLY works for Skyeye in 32-bit mode.
- //
- if (cover & 0x01) {
- aCoverageMap = executableInformation->getCoverageMap( baseAddress + i );
- if (aCoverageMap) {
- aCoverageMap->setWasExecuted( baseAddress + i );
- aCoverageMap->setWasExecuted( baseAddress + i + 1 );
- aCoverageMap->setWasExecuted( baseAddress + i + 2 );
- aCoverageMap->setWasExecuted( baseAddress + i + 3 );
- }
- }
-
- if (cover & 0x10) {
- aCoverageMap = executableInformation->getCoverageMap(
- baseAddress + i + 4
- );
- if (aCoverageMap) {
- aCoverageMap->setWasExecuted( baseAddress + i + 4 );
- aCoverageMap->setWasExecuted( baseAddress + i + 5 );
- aCoverageMap->setWasExecuted( baseAddress + i + 6 );
- aCoverageMap->setWasExecuted( baseAddress + i + 7 );
- }
- }
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageReaderSkyeye.h b/covoar/CoverageReaderSkyeye.h
deleted file mode 100644
index 156d170..0000000
--- a/covoar/CoverageReaderSkyeye.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! @file CoverageReaderSkyeye.h
- * @brief CoverageReaderSkyeye Specification
- *
- * This file contains the specification of the CoverageReaderSkyeye class.
- */
-
-#ifndef __COVERAGE_READER_Skyeye_H__
-#define __COVERAGE_READER_Skyeye_H__
-
-#include "CoverageReaderBase.h"
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- /*! @class CoverageReaderSkyeye
- *
- * This class implements the functionality which reads a coverage map
- * file produced by Skyeye. Since the SPARC has 32-bit instructions,
- * Skyeye produces a file with an integer for each 32-bit word. The
- * integer will have the least significant bit set if the address
- * was executed.
-@verbatim
-TBD
-@endverbatim
- */
- class CoverageReaderSkyeye : public CoverageReaderBase {
-
- public:
-
- /* Inherit documentation from base class. */
- CoverageReaderSkyeye();
-
- /* Inherit documentation from base class. */
- virtual ~CoverageReaderSkyeye();
-
- /* Inherit documentation from base class. */
- void processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageReaderTSIM.cc b/covoar/CoverageReaderTSIM.cc
deleted file mode 100644
index b1a2acb..0000000
--- a/covoar/CoverageReaderTSIM.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-/*! @file CoverageReaderTSIM.cc
- * @brief CoverageReaderTSIM Implementation
- *
- * This file contains the implementation of the CoverageReader class
- * for the coverage files written by the SPARC simulator TSIM.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#include "app_common.h"
-#include "CoverageReaderTSIM.h"
-#include "CoverageMap.h"
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- CoverageReaderTSIM::CoverageReaderTSIM()
- {
-
- }
-
- CoverageReaderTSIM::~CoverageReaderTSIM()
- {
- }
-
- void CoverageReaderTSIM::processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- )
- {
- CoverageMapBase* aCoverageMap = NULL;
- int baseAddress;
- int cover;
- FILE* coverageFile;
- int i;
- int status;
-
- //
- // Open the coverage file.
- //
- coverageFile = fopen( file, "r" );
- if (!coverageFile) {
- fprintf(
- stderr,
- "ERROR: CoverageReaderTSIM::processFile - Unable to open %s\n",
- file
- );
- exit( -1 );
- }
-
- //
- // Read and process each line of the coverage file.
- //
- while ( 1 ) {
- status = fscanf( coverageFile, "%x : ", &baseAddress );
- if (status == EOF || status == 0) {
- break;
- }
-
- for (i=0; i < 0x80; i+=4) {
- unsigned int a;
- status = fscanf( coverageFile, "%x", &cover );
- if (status == EOF || status == 0) {
- fprintf(
- stderr,
- "CoverageReaderTSIM: WARNING! Short line in %s at address 0x%08x\n",
- file,
- baseAddress
- );
- break;
- }
-
- //
- // Obtain the coverage map containing the address and
- // mark the address as executed.
- //
- a = baseAddress + i;
- aCoverageMap = executableInformation->getCoverageMap( a );
- if ( !aCoverageMap )
- continue;
- if ( cover & 0x01 ) {
- aCoverageMap->setWasExecuted( a );
- aCoverageMap->setWasExecuted( a + 1 );
- aCoverageMap->setWasExecuted( a + 2 );
- aCoverageMap->setWasExecuted( a + 3 );
- if ( cover & 0x08 ) {
- aCoverageMap->setWasTaken( a );
- BranchInfoAvailable = true;
- }
- if ( cover & 0x10 ) {
- aCoverageMap->setWasNotTaken( a );
- BranchInfoAvailable = true;
- }
- }
- }
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageReaderTSIM.h b/covoar/CoverageReaderTSIM.h
deleted file mode 100644
index 4acb889..0000000
--- a/covoar/CoverageReaderTSIM.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*! @file CoverageReaderTSIM.h
- * @brief CoverageReaderTSIM Specification
- *
- * This file contains the specification of the CoverageReaderTSIM class.
- */
-
-#ifndef __COVERAGE_READER_TSIM_H__
-#define __COVERAGE_READER_TSIM_H__
-
-#include "CoverageReaderBase.h"
-#include "ExecutableInfo.h"
-
-namespace Coverage {
-
- /*! @class CoverageReaderTSIM
- *
- * This class implements the functionality which reads a coverage map
- * file produced by TSIM. Since the SPARC has 32-bit instructions,
- * TSIM produces a file with an integer for each 32-bit word. The
- * integer will have the least significant bit if the address
- * was executed.
-@verbatim
-40000000 : 1 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 1
-40000080 : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
-@endverbatim
- */
- class CoverageReaderTSIM : public CoverageReaderBase {
-
- public:
-
- /* Inherit documentation from base class. */
- CoverageReaderTSIM();
-
- /* Inherit documentation from base class. */
- virtual ~CoverageReaderTSIM();
-
- /* Inherit documentation from base class. */
- void processFile(
- const char* const file,
- ExecutableInfo* const executableInformation
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageWriterBase.cc b/covoar/CoverageWriterBase.cc
deleted file mode 100644
index 90c3873..0000000
--- a/covoar/CoverageWriterBase.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*! @file CoverageWriterBase.cc
- * @brief CoverageWriterBase Implementation
- *
- * This file contains the implementation of the CoverageWriter base class.
- * All CoverageWriter implementations inherit from this.
- */
-
-#include "CoverageWriterBase.h"
-
-namespace Coverage {
-
- CoverageWriterBase::CoverageWriterBase()
- {
- }
-
- CoverageWriterBase::~CoverageWriterBase()
- {
- }
-
-}
diff --git a/covoar/CoverageWriterBase.h b/covoar/CoverageWriterBase.h
deleted file mode 100644
index 1d7d6eb..0000000
--- a/covoar/CoverageWriterBase.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*! @file CoverageWriterBase.h
- * @brief CoverageWriterBase Specification
- *
- * This file contains the specification of the CoverageWriterBase class.
- */
-
-#ifndef __COVERAGE_WRITER_BASE_H__
-#define __COVERAGE_WRITER_BASE_H__
-
-#include <stdint.h>
-
-#include "CoverageMapBase.h"
-
-namespace Coverage {
-
- /*! @class CoverageWriterBase
- *
- * This is the specification of the CoverageWriter base class.
- * All CoverageWriter implementations inherit from this class.
- */
- class CoverageWriterBase {
-
- public:
-
- /*!
- * This method constructs a CoverageWriterBase instance.
- */
- CoverageWriterBase();
-
- /*!
- * This method destructs a CoverageWriterBase instance.
- */
- virtual ~CoverageWriterBase();
-
- /*!
- * This method writes the @a coverage map for the specified
- * address range and writes it to @file.
- *
- * @param[in] file specifies the name of the file to write
- * @param[in] coverage specifies the coverage map to output
- * @param[in] lowAddress specifies the lowest address in the
- * coverage map to process
- * @param[in] highAddress specifies the highest address in the
- * coverage map to process
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- virtual void writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- ) = 0;
- };
-
-}
-#endif
diff --git a/covoar/CoverageWriterRTEMS.cc b/covoar/CoverageWriterRTEMS.cc
deleted file mode 100644
index 7a5150f..0000000
--- a/covoar/CoverageWriterRTEMS.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*! @file CoverageWriterRTEMS.cc
- * @brief CoverageWriterRTEMS Implementation
- *
- * This file contains the implementation of the functions supporting
- * the unified overage file format.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "CoverageWriterRTEMS.h"
-#include "rtemscov_header.h"
-
-namespace Coverage {
-
- CoverageWriterRTEMS::CoverageWriterRTEMS()
- {
- }
-
- CoverageWriterRTEMS::~CoverageWriterRTEMS()
- {
- }
-
- void CoverageWriterRTEMS::writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- )
- {
- FILE* coverageFile;
- uint32_t a;
- int status;
- uint8_t cover;
- rtems_coverage_map_header_t header;
-
- /*
- * read the file and update the coverage map passed in
- */
- coverageFile = fopen( file, "w" );
- if ( !coverageFile ) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterRTEMS::writeFile - unable to open %s\n",
- file
- );
- exit(-1);
- }
-
- /* clear out the header and fill it in */
- memset( &header, 0, sizeof(header) );
- header.ver = 0x1;
- header.header_length = sizeof(header);
- header.start = lowAddress;
- header.end = highAddress;
- strcpy( header.desc, "RTEMS Coverage Data" );
-
- status = fwrite(&header, 1, sizeof(header), coverageFile);
- if (status != sizeof(header)) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterRTEMS::writeFile - unable to write header "
- "to %s\n",
- file
- );
- exit(-1);
- }
-
- for ( a=lowAddress ; a < highAddress ; a++ ) {
- cover = ((coverage->wasExecuted( a )) ? 0x01 : 0);
- status = fwrite(&cover, 1, sizeof(cover), coverageFile);
- if (status != sizeof(cover)) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterRTEMS::writeFile - write to %s "
- "at address 0x%08x failed\n",
- file,
- a
- );
- exit( -1 );
- }
- // fprintf( stderr, "0x%x %d\n", a, cover );
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageWriterRTEMS.h b/covoar/CoverageWriterRTEMS.h
deleted file mode 100644
index c934f61..0000000
--- a/covoar/CoverageWriterRTEMS.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! @file CoverageWriterRTEMS.h
- * @brief CoverageWriterRTEMS Specification
- *
- * This file contains the specification of the CoverageWriterRTEMS class.
- */
-
-#ifndef __COVERAGE_WRITER_RTEMS_H__
-#define __COVERAGE_WRITER_RTEMS_H__
-
-#include "CoverageMapBase.h"
-#include "CoverageWriterBase.h"
-
-namespace Coverage {
-
- /*! @class CoverageWriterRTEMS
- *
- * This class writes a coverage map in RTEMS format. The format is
- * documented in CoverageReaderRTEMS.
- */
- class CoverageWriterRTEMS : public CoverageWriterBase {
-
- public:
-
- /*!
- * This method constructs a CoverageWriterRTEMS instance.
- */
- CoverageWriterRTEMS();
-
- /*!
- * This method destructs a CoverageWriterRTEMS instance.
- */
- virtual ~CoverageWriterRTEMS();
-
- /* Inherit documentation from base class. */
- void writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageWriterSkyeye.cc b/covoar/CoverageWriterSkyeye.cc
deleted file mode 100644
index e0aa943..0000000
--- a/covoar/CoverageWriterSkyeye.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-/*! @file CoverageWriterSkyeye.cc
- * @brief CoverageWriterSkyeye Implementation
- *
- * This file contains the implementation of the CoverageWriter class
- * for the coverage files written by the multi-architecture simulator
- * Skyeye (http://www.skyeye.org).
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "CoverageWriterSkyeye.h"
-#include "skyeye_header.h"
-
-namespace Coverage {
-
- CoverageWriterSkyeye::CoverageWriterSkyeye()
- {
- }
-
- CoverageWriterSkyeye::~CoverageWriterSkyeye()
- {
- }
-
- void CoverageWriterSkyeye::writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- )
- {
- uint32_t a;
- uint8_t cover;
- FILE* coverageFile;
- prof_header_t header;
- int status;
-
- /*
- * read the file and update the coverage map passed in
- */
- coverageFile = fopen( file, "w" );
- if ( !coverageFile ) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterSkyeye::writeFile - unable to open %s\n",
- file
- );
- exit(-1);
- }
-
- /* clear out the header and fill it in */
- memset( &header, 0, sizeof(header) );
- header.ver = 0x1;
- header.header_length = sizeof(header);
- header.prof_start = lowAddress;
- header.prof_end = highAddress;
- strcpy( header.desc, "Skyeye Coverage Data" );
-
- status = fwrite(&header, 1, sizeof(header), coverageFile);
- if (status != sizeof(header)) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterSkyeye::writeFile - unable to write header "
- "to %s\n",
- file
- );
- exit(-1);
- }
-
- for ( a=lowAddress ; a < highAddress ; a+= 8 ) {
- cover = ((coverage->wasExecuted( a )) ? 0x01 : 0);
- cover |= ((coverage->wasExecuted( a + 4 )) ? 0x10 : 0);
- status = fwrite(&cover, 1, sizeof(cover), coverageFile);
- if (status != sizeof(cover)) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterSkyeye::writeFile - write to %s "
- "at address 0x%08x failed\n",
- file,
- a
- );
- exit( -1 );
- }
- // fprintf( stderr, "0x%x %d\n", a, cover );
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageWriterSkyeye.h b/covoar/CoverageWriterSkyeye.h
deleted file mode 100644
index 5d8aeb9..0000000
--- a/covoar/CoverageWriterSkyeye.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! @file CoverageWriterSkyeye.h
- * @brief CoverageWriterSkyeye Specification
- *
- * This file contains the specification of the CoverageWriterSkyeye class.
- */
-
-#ifndef __COVERAGE_WRITER_Skyeye_H__
-#define __COVERAGE_WRITER_Skyeye_H__
-
-#include "CoverageMapBase.h"
-#include "CoverageWriterBase.h"
-
-namespace Coverage {
-
- /*! @class CoverageWriterSkyeye
- *
- * This class writes a coverage map in Skyeye format. The format is
- * documented in CoverageReaderSkyeye.
- */
- class CoverageWriterSkyeye : public CoverageWriterBase {
-
- public:
-
- /*!
- * This method constructs a CoverageWriterSkyeye instance.
- */
- CoverageWriterSkyeye();
-
- /*!
- * This method destructs a CoverageWriterSkyeye instance.
- */
- virtual ~CoverageWriterSkyeye();
-
- /* Inherit documentation from base class. */
- void writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- );
- };
-
-}
-#endif
diff --git a/covoar/CoverageWriterTSIM.cc b/covoar/CoverageWriterTSIM.cc
deleted file mode 100644
index ec7c5b4..0000000
--- a/covoar/CoverageWriterTSIM.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/*! @file CoverageWriterTSIM.cc
- * @brief CoverageWriterTSIM Implementation
- *
- * This file contains the implementation of the CoverageWriter class
- * for the coverage files written by the SPARC simulator TSIM.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "CoverageWriterTSIM.h"
-
-namespace Coverage {
-
- CoverageWriterTSIM::CoverageWriterTSIM()
- {
- }
-
- CoverageWriterTSIM::~CoverageWriterTSIM()
- {
- }
-
-
- void CoverageWriterTSIM::writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- )
- {
- uint32_t a;
- int cover;
- FILE* coverageFile;
- int i;
- int status;
-
- /*
- * read the file and update the coverage map passed in
- */
- coverageFile = fopen( file, "w" );
- if ( !coverageFile ) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterTSIM::writeFile - unable to open %s\n",
- file
- );
- exit(-1);
- }
-
- for ( a=lowAddress ; a < highAddress ; a+= 0x80 ) {
- status = fprintf( coverageFile, "%x : ", a );
- if ( status == EOF || status == 0 ) {
- break;
- }
- // fprintf( stderr, "%08x : ", baseAddress );
- for ( i=0 ; i < 0x80 ; i+=4 ) {
- cover = ((coverage->wasExecuted( a + i )) ? 1 : 0);
- status = fprintf( coverageFile, "%d ", cover );
- if ( status == EOF || status == 0 ) {
- fprintf(
- stderr,
- "ERROR: CoverageWriterTSIM:writeFile - write to %s "
- "at address 0x%08x failed\n",
- file,
- a
- );
- exit( -1 );
- }
- // fprintf( stderr, "%d ", cover );
- }
- fprintf( coverageFile, "\n" );
- // fprintf( stderr, "\n" );
-
- }
-
- fclose( coverageFile );
- }
-}
diff --git a/covoar/CoverageWriterTSIM.h b/covoar/CoverageWriterTSIM.h
deleted file mode 100644
index 927fd64..0000000
--- a/covoar/CoverageWriterTSIM.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*! @file CoverageWriterTSIM.h
- * @brief CoverageWriterTSIM Specification
- *
- * This file contains the specification of the CoverageWriterTSIM class.
- */
-
-#ifndef __COVERAGE_WRITER_TSIM_H__
-#define __COVERAGE_WRITER_TSIM_H__
-
-#include "CoverageMapBase.h"
-#include "CoverageWriterBase.h"
-
-namespace Coverage {
-
- /*! @class CoverageWriterTSIM
- *
- * This class writes a coverage map in TSIM format. The format is
- * documented in CoverageReaderTSIM.
- */
- class CoverageWriterTSIM : public CoverageWriterBase {
-
- public:
-
- /*!
- * This method constructs a CoverageWriterTSIM instance.
- */
- CoverageWriterTSIM();
-
- /*!
- * This method destructs a CoverageWriterTSIM instance.
- */
- virtual ~CoverageWriterTSIM();
-
- /* Inherit documentation from base class. */
- void writeFile(
- const char* const file,
- CoverageMapBase* coverage,
- uint32_t lowAddress,
- uint32_t highAddress
- );
- };
-
-}
-#endif
diff --git a/covoar/DesiredSymbols.cc b/covoar/DesiredSymbols.cc
deleted file mode 100644
index 6b780dd..0000000
--- a/covoar/DesiredSymbols.cc
+++ /dev/null
@@ -1,692 +0,0 @@
-/*! @file DesiredSymbols.cc
- * @brief DesiredSymbols Implementation
- *
- * This file contains the implementation of the functions
- * which provide the functionality of the DesiredSymbols.
- */
-
-#include <libgen.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "DesiredSymbols.h"
-#include "app_common.h"
-#include "CoverageMap.h"
-#include "ObjdumpProcessor.h"
-
-namespace Coverage {
-
- DesiredSymbols::DesiredSymbols()
- {
- }
-
- DesiredSymbols::~DesiredSymbols()
- {
- }
-
- void DesiredSymbols::load(
- const char* const symbolsFile
- )
- {
- int cStatus;
- bool done = false;
- FILE* sFile;
- SymbolInformation* symInfo;
- int line = 1;
- std::string symbol;
-
- // Ensure that symbols file name is given.
- if ( !symbolsFile ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::load - no symbols file specified\n"
- );
- exit(-1);
- }
-
- // Open symbols file.
- sFile = fopen( symbolsFile, "r" );
- if ( !sFile ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::load - unable to open symbols file %s\n",
- symbolsFile
- );
- exit(-1);
- }
-
- // Process symbols file.
- while ( !done ) {
-
- symInfo = new SymbolInformation;
-
- // Skip blank lines between symbols
- do {
- inputBuffer[0] = '\0';
- inputBuffer2[0] = '\0';
- cStatus = fscanf( sFile, "%s %s", inputBuffer, inputBuffer2 );
- if ( cStatus == EOF ) {
- done = true;
- }
- else {
- //inputBuffer[ strlen(inputBuffer) - 1] = '\0';
- line++;
- }
- } while ( !done && (inputBuffer[0] == '\0') );
-
- // Have we already seen this one?
- if ( !done ) {
- if (set.find( inputBuffer ) != set.end()) {
- fprintf(
- stderr,
- "File: %s, Line %d: Duplicate symbol: %s\n",
- symbolsFile,
- line,
- inputBuffer
- );
-
- delete symInfo;
- }
-
- // Add this to the set of symbols.
- else
- set[ inputBuffer ] = *symInfo;
- }
- }
- }
-
- void DesiredSymbols::preprocess( void )
- {
- ObjdumpProcessor::objdumpLines_t::iterator fitr;
- ObjdumpProcessor::objdumpLines_t::iterator n, p;
- DesiredSymbols::symbolSet_t::iterator sitr;
- CoverageMapBase* theCoverageMap;
-
- // Look at each symbol.
- for (sitr = SymbolsToAnalyze->set.begin();
- sitr != SymbolsToAnalyze->set.end();
- sitr++) {
-
- // If the unified coverage map does not exist, the symbol was
- // never referenced by any executable. Just skip it.
- theCoverageMap = sitr->second.unifiedCoverageMap;
- if (!theCoverageMap)
- continue;
-
- // Mark any branch and NOP instructions.
- for (fitr = sitr->second.instructions.begin();
- fitr != sitr->second.instructions.end();
- fitr++) {
- if (fitr->isBranch) {
- theCoverageMap->setIsBranch(
- fitr->address - sitr->second.baseAddress
- );
- }
- if (fitr->isNop) {
- theCoverageMap->setIsNop(
- fitr->address - sitr->second.baseAddress
- );
- }
- }
-
- }
- }
-
- void DesiredSymbols::calculateStatistics( void )
- {
- uint32_t a;
- uint32_t endAddress;
- DesiredSymbols::symbolSet_t::iterator sitr;
- CoverageMapBase* theCoverageMap;
-
- // Look at each symbol.
- for (sitr = SymbolsToAnalyze->set.begin();
- sitr != SymbolsToAnalyze->set.end();
- sitr++) {
-
- // If the unified coverage map does not exist, the symbol was
- // never referenced by any executable. Just skip it.
- theCoverageMap = sitr->second.unifiedCoverageMap;
- if (!theCoverageMap)
- continue;
-
- // Increment the total sizeInBytes byt the bytes in the symbol
- stats.sizeInBytes += sitr->second.stats.sizeInBytes;
-
- // Now scan through the coverage map of this symbol.
- endAddress = sitr->second.stats.sizeInBytes - 1;
- a = 0;
- while (a <= endAddress) {
-
- // If we are at the start of instruction increment
- // instruction type counters as needed.
- if ( theCoverageMap->isStartOfInstruction( a ) ) {
-
- stats.sizeInInstructions++;
- sitr->second.stats.sizeInInstructions++;
-
- if (!theCoverageMap->wasExecuted( a ) ) {
- stats.uncoveredInstructions++;
- sitr->second.stats.uncoveredInstructions++;
-
- if ( theCoverageMap->isBranch( a )) {
- stats.branchesNotExecuted++;
- sitr->second.stats.branchesNotExecuted++;
- }
- } else if (theCoverageMap->isBranch( a )) {
- stats.branchesExecuted++;
- sitr->second.stats.branchesExecuted++;
- }
-
- }
-
- if (!theCoverageMap->wasExecuted( a )) {
- stats.uncoveredBytes++;
- sitr->second.stats.uncoveredBytes++;
- }
- a++;
-
- }
- }
- }
-
-
- void DesiredSymbols::computeUncovered( void )
- {
- uint32_t a, la, ha;
- uint32_t endAddress;
- uint32_t count;
- DesiredSymbols::symbolSet_t::iterator sitr;
- CoverageRanges* theBranches;
- CoverageMapBase* theCoverageMap;
- CoverageRanges* theRanges;
-
- // Look at each symbol.
- for (sitr = SymbolsToAnalyze->set.begin();
- sitr != SymbolsToAnalyze->set.end();
- sitr++) {
-
- // If the unified coverage map does not exist, the symbol was
- // never referenced by any executable. Just skip it.
- theCoverageMap = sitr->second.unifiedCoverageMap;
- if (!theCoverageMap)
- continue;
-
- // Create containers for the symbol's uncovered ranges and branches.
- theRanges = new CoverageRanges();
- sitr->second.uncoveredRanges = theRanges;
- theBranches = new CoverageRanges();
- sitr->second.uncoveredBranches = theBranches;
-
- // Mark NOPs as executed
- endAddress = sitr->second.stats.sizeInBytes - 1;
- a = 0;
- while (a < endAddress) {
- if (!theCoverageMap->wasExecuted( a )) {
- a++;
- continue;
- }
-
- for (ha=a+1;
- ha<=endAddress && !theCoverageMap->isStartOfInstruction( ha );
- ha++)
- ;
- if ( ha >= endAddress )
- break;
-
- if (theCoverageMap->isNop( ha ))
- do {
- theCoverageMap->setWasExecuted( ha );
- ha++;
- if ( ha >= endAddress )
- break;
- } while ( !theCoverageMap->isStartOfInstruction( ha ) );
- a = ha;
- }
-
- // Now scan through the coverage map of this symbol.
- endAddress = sitr->second.stats.sizeInBytes - 1;
- a = 0;
- while (a <= endAddress) {
-
- // If an address was NOT executed, find consecutive unexecuted
- // addresses and add them to the uncovered ranges.
- if (!theCoverageMap->wasExecuted( a )) {
-
- la = a;
- count = 1;
- for (ha=a+1;
- ha<=endAddress && !theCoverageMap->wasExecuted( ha );
- ha++)
- {
- if ( theCoverageMap->isStartOfInstruction( ha ) )
- count++;
- }
- ha--;
-
- stats.uncoveredRanges++;
- sitr->second.stats.uncoveredRanges++;
- theRanges->add(
- sitr->second.baseAddress + la,
- sitr->second.baseAddress + ha,
- CoverageRanges::UNCOVERED_REASON_NOT_EXECUTED,
- count
- );
- a = ha + 1;
- }
-
- // If an address is a branch instruction, add any uncovered branches
- // to the uncoverd branches.
- else if (theCoverageMap->isBranch( a )) {
- la = a;
- for (ha=a+1;
- ha<=endAddress && !theCoverageMap->isStartOfInstruction( ha );
- ha++)
- ;
- ha--;
-
- if (theCoverageMap->wasAlwaysTaken( la )) {
- stats.branchesAlwaysTaken++;
- sitr->second.stats.branchesAlwaysTaken++;
- theBranches->add(
- sitr->second.baseAddress + la,
- sitr->second.baseAddress + ha,
- CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN,
- 1
- );
- if (Verbose)
- fprintf(
- stderr,
- "Branch always taken found in %s (0x%x - 0x%x)\n",
- (sitr->first).c_str(),
- sitr->second.baseAddress + la,
- sitr->second.baseAddress + ha
- );
- }
-
- else if (theCoverageMap->wasNeverTaken( la )) {
- stats.branchesNeverTaken++;
- sitr->second.stats.branchesNeverTaken++;
- theBranches->add(
- sitr->second.baseAddress + la,
- sitr->second.baseAddress + ha,
- CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN,
- 1
- );
- if (Verbose)
- fprintf(
- stderr,
- "Branch never taken found in %s (0x%x - 0x%x)\n",
- (sitr->first).c_str(),
- sitr->second.baseAddress + la,
- sitr->second.baseAddress + ha
- );
- }
- a = ha + 1;
- }
- else
- a++;
- }
- }
- }
-
-
- void DesiredSymbols::createCoverageMap(
- const std::string& symbolName,
- uint32_t size
- )
- {
- CoverageMapBase* aCoverageMap;
- uint32_t highAddress;
- symbolSet_t::iterator itr;
-
- // Ensure that the symbol is a desired symbol.
- itr = set.find( symbolName );
-
- if (itr == set.end()) {
-
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::createCoverageMap - Unable to create "
- "unified coverage map for %s because it is NOT a desired symbol\n",
- symbolName.c_str()
- );
- exit( -1 );
- }
-
- // If we have already created a coverage map, ...
- if (itr->second.unifiedCoverageMap) {
-
- // ensure that the specified size matches the existing size.
- if (itr->second.stats.sizeInBytes != size) {
-
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::createCoverageMap - Attempt to create "
- "unified coverage maps for %s with different sizes (%d != %d)\n",
- symbolName.c_str(),
- itr->second.stats.sizeInBytes,
- size
- );
- if ( itr->second.stats.sizeInBytes < size )
- itr->second.stats.sizeInBytes = size;
- else
- size = itr->second.stats.sizeInBytes;
- // exit( -1 );
- }
- }
-
- // If we don't already have a coverage map, create one.
- else {
-
- highAddress = size - 1;
-
- aCoverageMap = new CoverageMap( 0, highAddress );
- if (!aCoverageMap) {
-
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::createCoverageMap - Unable to allocate "
- "coverage map for %s\n",
- symbolName.c_str()
- );
- exit( -1 );
- }
-
- if ( Verbose )
- fprintf(
- stderr,
- "Created unified coverage map for %s (0x%x - 0x%x)\n",
- symbolName.c_str(), 0, highAddress
- );
- itr->second.unifiedCoverageMap = aCoverageMap;
- itr->second.stats.sizeInBytes = size;
- }
- }
-
- void DesiredSymbols::determineSourceLines(
- CoverageRanges* const theRanges,
- ExecutableInfo* const theExecutable
-
- )
- {
- char* base;
- char* cStatus;
- char command[512];
- std::string fileName;
- CoverageRanges::ranges_t::iterator ritr;
- char rpath[PATH_MAX];
- FILE* tmpfile;
-
- // Open a temporary file for the uncovered ranges.
- tmpfile = fopen( "ranges1.tmp", "w" );
- if ( !tmpfile ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::determineSourceLines - "
- "unable to open %s\n",
- "ranges1.tmp"
- );
- exit(-1);
- }
-
- // Write the range addresses to the temporary file.
- for (ritr = theRanges->set.begin();
- ritr != theRanges->set.end();
- ritr++ ) {
- fprintf(
- tmpfile,
- "0x%08x\n0x%08x\n",
- ritr->lowAddress - theExecutable->getLoadAddress(),
- ritr->highAddress - theExecutable->getLoadAddress()
- );
- }
-
- fclose( tmpfile );
-
- // Invoke addr2line to generate the source lines for each address.
- if (theExecutable->hasDynamicLibrary())
- fileName = theExecutable->getLibraryName();
- else
- fileName = theExecutable->getFileName();
-
- sprintf(
- command,
- "%s -Ce %s <%s | dos2unix >%s",
- TargetInfo->getAddr2line(),
- fileName.c_str(),
- "ranges1.tmp",
- "ranges2.tmp"
- );
-
- if (system( command )) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::determineSourceLines - "
- "command (%s) failed\n",
- command
- );
- exit( -1 );
- }
-
- // Open the addr2line output file.
- tmpfile = fopen( "ranges2.tmp", "r" );
- if ( !tmpfile ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::determineSourceLines - "
- "unable to open %s\n",
- "ranges2.tmp"
- );
- exit(-1);
- }
-
- // Process the addr2line output.
- for (ritr = theRanges->set.begin();
- ritr != theRanges->set.end();
- ritr++ ) {
-
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, tmpfile );
- if ( cStatus == NULL ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::determineSourceLines - "
- "Out of sync in addr2line output\n"
- );
- exit( -1 );
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
-
- // Use only the base filename without directory path.
- realpath( inputBuffer, rpath );
- base = basename( rpath );
-
- ritr->lowSourceLine = std::string( base );
-
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, tmpfile );
- if ( cStatus == NULL ) {
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::determineSourceLines - "
- "Out of sync in addr2line output\n"
- );
- exit( -1 );
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
-
- // Use only the base filename without directory path.
- realpath( inputBuffer, rpath );
- base = basename( rpath );
-
- ritr->highSourceLine = std::string( base );
- }
-
- fclose( tmpfile );
- unlink( "ranges1.tmp" );
- unlink( "ranges2.tmp" );
- }
-
- SymbolInformation* DesiredSymbols::find(
- const std::string& symbolName
- )
- {
- if (set.find( symbolName ) == set.end())
- return NULL;
- else
- return &set[ symbolName ];
- }
-
- void DesiredSymbols::findSourceForUncovered( void )
- {
- DesiredSymbols::symbolSet_t::iterator ditr;
- CoverageRanges* theBranches;
- CoverageRanges* theRanges;
-
- // Process uncovered ranges and/or branches for each symbol.
- for (ditr = SymbolsToAnalyze->set.begin();
- ditr != SymbolsToAnalyze->set.end();
- ditr++) {
-
- // First the unexecuted ranges, ...
- theRanges = ditr->second.uncoveredRanges;
- if (theRanges == NULL)
- continue;
-
- if (!theRanges->set.empty()) {
- if (Verbose)
- fprintf(
- stderr,
- "Looking up source lines for uncovered ranges in %s\n",
- (ditr->first).c_str()
- );
- determineSourceLines(
- theRanges,
- ditr->second.sourceFile
- );
- }
-
- // then the uncovered branches.
- theBranches = ditr->second.uncoveredBranches;
- if (theBranches == NULL)
- continue;
-
- if (!theBranches->set.empty()) {
- if (Verbose)
- fprintf(
- stderr,
- "Looking up source lines for uncovered branches in %s\n",
- (ditr->first).c_str()
- );
- determineSourceLines(
- theBranches,
- ditr->second.sourceFile
- );
- }
- }
- }
-
- uint32_t DesiredSymbols::getNumberBranchesAlwaysTaken( void ) const {
- return stats.branchesAlwaysTaken;
- };
-
- uint32_t DesiredSymbols::getNumberBranchesFound( void ) const {
- return (stats.branchesNotExecuted + stats.branchesExecuted);
- };
-
- uint32_t DesiredSymbols::getNumberBranchesNeverTaken( void ) const {
- return stats.branchesNeverTaken;
- };
-
- uint32_t DesiredSymbols::getNumberUncoveredRanges( void ) const {
- return stats.uncoveredRanges;
- };
-
- bool DesiredSymbols::isDesired (
- const std::string& symbolName
- ) const
- {
- if (set.find( symbolName ) == set.end()) {
- #if 0
- fprintf( stderr,
- "Warning: Unable to find symbol %s\n",
- symbolName.c_str()
- );
- #endif
- return false;
- }
- return true;
- }
-
- void DesiredSymbols::mergeCoverageMap(
- const std::string& symbolName,
- const CoverageMapBase* const sourceCoverageMap
- )
- {
- uint32_t dAddress;
- CoverageMapBase* destinationCoverageMap;
- uint32_t dMapSize;
- symbolSet_t::iterator itr;
- uint32_t sAddress;
- uint32_t sBaseAddress;
- uint32_t sMapSize;
- uint32_t executionCount;
-
- // Ensure that the symbol is a desired symbol.
- itr = set.find( symbolName );
-
- if (itr == set.end()) {
-
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::mergeCoverageMap - Unable to merge "
- "coverage map for %s because it is NOT a desired symbol\n",
- symbolName.c_str()
- );
- exit( -1 );
- }
-
- // Ensure that the source and destination coverage maps
- // are the same size.
- dMapSize = itr->second.stats.sizeInBytes;
- sBaseAddress = sourceCoverageMap->getFirstLowAddress();
- sMapSize = sourceCoverageMap->getSize();
- if (dMapSize != sMapSize) {
-
- fprintf(
- stderr,
- "ERROR: DesiredSymbols::mergeCoverageMap - Unable to merge "
- "coverage map for %s because the sizes are different\n",
- symbolName.c_str()
- );
- return;
- // exit( -1 );
- }
-
- // Merge the data for each address.
- destinationCoverageMap = itr->second.unifiedCoverageMap;
-
- for (dAddress = 0; dAddress < dMapSize; dAddress++) {
-
- sAddress = dAddress + sBaseAddress;
-
- // Merge start of instruction indication.
- if (sourceCoverageMap->isStartOfInstruction( sAddress ))
- destinationCoverageMap->setIsStartOfInstruction( dAddress );
-
- // Merge the execution data.
- executionCount = sourceCoverageMap->getWasExecuted( sAddress );
- destinationCoverageMap->sumWasExecuted( dAddress, executionCount );
-
- // Merge the branch data.
- executionCount = sourceCoverageMap->getWasTaken( sAddress );
- destinationCoverageMap->sumWasTaken( dAddress, executionCount );
-
- executionCount = sourceCoverageMap->getWasNotTaken( sAddress );
- destinationCoverageMap->sumWasNotTaken( dAddress, executionCount );
- }
- }
-
-}
diff --git a/covoar/DesiredSymbols.h b/covoar/DesiredSymbols.h
deleted file mode 100644
index 448f263..0000000
--- a/covoar/DesiredSymbols.h
+++ /dev/null
@@ -1,336 +0,0 @@
-/*! @file DesiredSymbols.h
- * @brief DesiredSymbols Specification
- *
- * This file contains the specification of the DesiredSymbols class.
- */
-
-#ifndef __DESIRED_SYMBOLS_H__
-#define __DESIRED_SYMBOLS_H__
-
-#include <list>
-#include <map>
-#include <stdint.h>
-#include <string>
-
-#include "CoverageMapBase.h"
-#include "CoverageRanges.h"
-#include "ExecutableInfo.h"
-#include "ObjdumpProcessor.h"
-
-namespace Coverage {
-
-
- /*!
- *
- * This class defines the statistics that are tracked.
- */
- class Statistics {
- public:
-
- /*!
- * This member variable contains the total number of branches always
- * taken.
- */
- int branchesAlwaysTaken;
-
- /*!
- * This member variable contains the total number of branches where
- * one or more paths were executed.
- */
- int branchesExecuted;
-
- /*!
- * This member variable contains the total number of branches never
- * taken.
- */
- int branchesNeverTaken;
-
- /*!
- * This member variable contains the total number of branches not
- * executed AT ALL.
- */
- int branchesNotExecuted;
-
- /*!
- * This member contains the size in Bytes.
- */
- uint32_t sizeInBytes;
-
- /*!
- * This member contains the size in Bytes.
- */
- uint32_t sizeInInstructions;
-
- /*!
- * This member variable contains the total number of uncovered bytes.
- */
- int uncoveredBytes;
-
- /*!
- * This member variable contains the total number of uncovered assembly
- * instructions.
- */
- int uncoveredInstructions;
-
- /*!
- * This member variable contains the total number of uncovered ranges.
- */
- int uncoveredRanges;
-
- /*!
- * This method returns the percentage of uncovered instructions.
- *
- * @return Returns the percent uncovered instructions
- */
- uint32_t getPercentUncoveredInstructions( void ) const;
-
- /*!
- * This method returns the percentage of uncovered bytes.
- *
- * @return Returns the percent uncovered bytes
- */
- uint32_t getPercentUncoveredBytes( void ) const;
-
- /*!
- * This method constructs a Statistics instance.
- */
- Statistics():
- branchesAlwaysTaken(0),
- branchesExecuted(0),
- branchesNeverTaken(0),
- branchesNotExecuted(0),
- sizeInBytes(0),
- sizeInInstructions(0),
- uncoveredBytes(0),
- uncoveredInstructions(0),
- uncoveredRanges(0)
- {
- }
-
- };
-
- /*! @class SymbolInformation
- *
- * This class defines the information kept for each symbol that is
- * to be analyzed.
- */
- class SymbolInformation {
-
- public:
-
- /*!
- * This member contains the base address of the symbol.
- */
- uint32_t baseAddress;
-
-
- /*!
- * This member contains the disassembly associated with a symbol.
- */
- std::list<ObjdumpProcessor::objdumpLine_t> instructions;
-
- /*!
- * This member contains the executable that was used to
- * generate the disassembled instructions.
- */
- ExecutableInfo* sourceFile;
-
- /*!
- * This member contains the statistics kept on each symbol.
- */
- Statistics stats;
-
- /*!
- * This member contains information about the branch instructions of
- * a symbol that were not fully covered (i.e. taken/not taken).
- */
- CoverageRanges* uncoveredBranches;
-
- /*!
- * This member contains information about the instructions of a
- * symbol that were not executed.
- */
- CoverageRanges* uncoveredRanges;
-
- /*!
- * This member contains the unified or merged coverage map
- * for the symbol.
- */
- CoverageMapBase* unifiedCoverageMap;
-
- /*!
- * This method constructs a SymbolInformation instance.
- */
- SymbolInformation() :
- baseAddress( 0 ),
- uncoveredBranches( NULL ),
- uncoveredRanges( NULL ),
- unifiedCoverageMap( NULL )
- {
- }
-
- ~SymbolInformation() {}
- };
-
- /*! @class DesiredSymbols
- *
- * This class defines the set of desired symbols to analyze.
- */
- class DesiredSymbols {
-
- public:
-
- /*!
- * This map associates each symbol with its symbol information.
- */
- typedef std::map<std::string, SymbolInformation> symbolSet_t;
-
- /*!
- * This variable contains a map of symbol sets for each
- * symbol in the system keyed on the symbol name.
- */
- symbolSet_t set;
-
- /*!
- * This method constructs a DesiredSymbols instance.
- */
- DesiredSymbols();
-
- /*!
- * This method destructs a DesiredSymbols instance.
- */
- ~DesiredSymbols();
-
- /*!
- * This method loops through the coverage map and
- * calculates the statistics that have not already
- * been filled in.
- */
- void calculateStatistics( void );
-
- /*!
- * This method analyzes each symbols coverage map to determine any
- * uncovered ranges or branches.
- */
- void computeUncovered( void );
-
- /*!
- * This method creates a coverage map for the specified symbol
- * using the specified size.
- *
- * @param[in] symbolName specifies the symbol for which to create
- * a coverage map
- * @param[in] size specifies the size of the coverage map to create
- */
- void createCoverageMap(
- const std::string& symbolName,
- uint32_t size
- );
-
- /*!
- * This method looks up the symbol information for the specified symbol.
- *
- * @param[in] symbolName specifies the symbol for which to search
- *
- * @return Returns a pointer to the symbol's information
- */
- SymbolInformation* find(
- const std::string& symbolName
- );
-
- /*!
- * This method determines the source lines that correspond to any
- * uncovered ranges or branches.
- */
- void findSourceForUncovered( void );
-
- /*!
- * This method returns the total number of branches always taken
- * for all analyzed symbols.
- *
- * @return Returns the total number of branches always taken
- */
- uint32_t getNumberBranchesAlwaysTaken( void ) const;
-
- /*!
- * This method returns the total number of branches found for
- * all analyzed symbols.
- *
- * @return Returns the total number of branches found
- */
- uint32_t getNumberBranchesFound( void ) const;
-
- /*!
- * This method returns the total number of branches never taken
- * for all analyzed symbols.
- *
- * @return Returns the total number of branches never taken
- */
- uint32_t getNumberBranchesNeverTaken( void ) const;
-
- /*!
- * This method returns the total number of uncovered ranges
- * for all analyzed symbols.
- *
- * @return Returns the total number of uncovered ranges
- */
- uint32_t getNumberUncoveredRanges( void ) const;
-
- /*!
- * This method returns an indication of whether or not the specified
- * symbol is a symbol to analyze.
- *
- * @return Returns TRUE if the specified symbol is a symbol to analyze
- * and FALSE otherwise.
- */
- bool isDesired (
- const std::string& symbolName
- ) const;
-
- /*!
- * This method creates the set of symbols to analyze from the symbols
- * listed in the specified file.
- */
- void load(
- const char* const symbolsFile
- );
-
- /*!
- * This method merges the coverage information from the source
- * coverage map into the unified coverage map for the specified symbol.
- *
- * @param[in] symbolName specifies the symbol associated with the
- * destination coverage map
- * @param[in] sourceCoverageMap specifies the source coverage map
- */
- void mergeCoverageMap(
- const std::string& symbolName,
- const CoverageMapBase* const sourceCoverageMap
- );
-
- /*!
- * This method preprocesses each symbol's coverage map to mark nop
- * and branch information.
- */
- void preprocess( void );
-
- /*!
- * This member contains the statistics kept on each symbol.
- */
- Statistics stats;
-
- private:
-
- /*!
- * This method uses the specified executable file to determine the
- * source lines for the elements in the specified ranges.
- */
- void determineSourceLines(
- CoverageRanges* const theRanges,
- ExecutableInfo* const theExecutable
- );
-
- };
-}
-
-#endif
diff --git a/covoar/Doxyfile b/covoar/Doxyfile
deleted file mode 100644
index c2417d5..0000000
--- a/covoar/Doxyfile
+++ /dev/null
@@ -1,1520 +0,0 @@
-# Doxyfile 1.6.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "RTEMS Coverage Map Processor"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE = warnings.log
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT =
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS = *.h
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE = qemu-traces.h \
- skyeye_header.h
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
-# documentation will contain the timesstamp.
-
-HTML_TIMESTAMP = NO
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE =
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
-# there is already a search function so this one should typically
-# be disabled.
-
-SEARCHENGINE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/covoar/ExecutableInfo.cc b/covoar/ExecutableInfo.cc
deleted file mode 100644
index 0a7eac3..0000000
--- a/covoar/ExecutableInfo.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*! @file ExecutableInfo.cc
- * @brief ExecutableInfo Implementation
- *
- * This file contains the implementation of the functionality
- * of the ExecutableInfo class.
- */
-
-#include <stdio.h>
-
-#include "ExecutableInfo.h"
-#include "app_common.h"
-#include "CoverageMap.h"
-#include "DesiredSymbols.h"
-#include "SymbolTable.h"
-
-namespace Coverage {
-
- ExecutableInfo::ExecutableInfo(
- const char* const theExecutableName,
- const char* const theLibraryName
- )
- {
- executableName = theExecutableName;
- loadAddress = 0;
- libraryName = "";
- if (theLibraryName)
- libraryName = theLibraryName;
- theSymbolTable = new SymbolTable();
- }
-
- ExecutableInfo::~ExecutableInfo()
- {
- if (theSymbolTable)
- delete theSymbolTable;
- }
-
- void ExecutableInfo::dumpCoverageMaps( void ) {
- ExecutableInfo::coverageMaps_t::iterator itr;
-
- for (itr = coverageMaps.begin(); itr != coverageMaps.end(); itr++) {
- fprintf( stderr, "Coverage Map for %s\n", ((*itr).first).c_str() );;
- ((*itr).second)->dump();
- }
- }
-
- void ExecutableInfo::dumpExecutableInfo( void ){
- fprintf( stdout, "\n== Executable info ==\n");
- fprintf( stdout, "executableName = %s\n", executableName.c_str());
- fprintf( stdout, "libraryName = %s\n", libraryName.c_str());
- fprintf( stdout, "loadAddress = %u\n", loadAddress);
- theSymbolTable->dumpSymbolTable();
- }
-
- CoverageMapBase* ExecutableInfo::getCoverageMap ( uint32_t address )
- {
- CoverageMapBase* aCoverageMap = NULL;
- coverageMaps_t::iterator it;
- std::string itsSymbol;
-
- // Obtain the coverage map containing the specified address.
- itsSymbol = theSymbolTable->getSymbol( address );
- if (itsSymbol != "") {
- it = coverageMaps.find( itsSymbol );
- aCoverageMap = (*it).second;
- }
-
- return aCoverageMap;
- }
-
- std::string ExecutableInfo::getFileName ( void ) const
- {
- return executableName;
- }
-
- std::string ExecutableInfo::getLibraryName( void ) const
- {
- return libraryName;
- }
-
- uint32_t ExecutableInfo::getLoadAddress( void ) const
- {
- return loadAddress;
- }
-
-
- SymbolTable* ExecutableInfo::getSymbolTable ( void ) const
- {
- return theSymbolTable;
- }
-
- CoverageMapBase* ExecutableInfo::createCoverageMap (
- const std::string& symbolName,
- uint32_t lowAddress,
- uint32_t highAddress
- )
- {
- CoverageMapBase *theMap;
- ExecutableInfo::coverageMaps_t::iterator itr;
-
- itr = coverageMaps.find( symbolName );
- if ( itr == coverageMaps.end() ) {
- theMap = new CoverageMap( lowAddress, highAddress );
- coverageMaps[ symbolName ] = theMap;
- } else {
- theMap = itr->second;
- theMap->Add( lowAddress, highAddress );
- }
- return theMap;
- }
-
- bool ExecutableInfo::hasDynamicLibrary( void )
- {
- return (libraryName != "");
- }
-
- void ExecutableInfo::mergeCoverage( void ) {
- ExecutableInfo::coverageMaps_t::iterator itr;
-
- for (itr = coverageMaps.begin(); itr != coverageMaps.end(); itr++) {
- SymbolsToAnalyze->mergeCoverageMap( (*itr).first, (*itr).second );
- }
- }
-
- void ExecutableInfo::setLoadAddress( uint32_t address )
- {
- loadAddress = address;
- }
-
-}
diff --git a/covoar/ExecutableInfo.h b/covoar/ExecutableInfo.h
deleted file mode 100644
index ca4184a..0000000
--- a/covoar/ExecutableInfo.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*! @file ExecutableInfo.h
- * @brief ExecutableInfo Specification
- *
- * This file contains the specification of the ExecutableInfo class.
- */
-
-#ifndef __EXECUTABLEINFO_H__
-#define __EXECUTABLEINFO_H__
-
-#include <map>
-#include <stdint.h>
-#include <string>
-
-#include "CoverageMapBase.h"
-#include "SymbolTable.h"
-
-namespace Coverage {
-
- /*! @class ExecutableInfo
- *
- * This class holds a collection of information for an executable
- * that is to be analyzed.
- */
- class ExecutableInfo {
-
- public:
-
- /*!
- * This method constructs an ExecutableInfo instance.
- *
- * @param[in] theExecutableName specifies the name of the executable
- * @param[in] theLibraryName specifies the name of the executable
- */
- ExecutableInfo(
- const char* const theExecutableName,
- const char* const theLibraryName = NULL
- );
-
- /*!
- * This method destructs an ExecutableInfo instance.
- */
- virtual ~ExecutableInfo();
-
- /*!
- * This method prints the contents of all coverage maps for
- * this executable.
- */
- void dumpCoverageMaps( void );
-
- /*!
- * This method prints the contents of Executable info containers
- */
- void dumpExecutableInfo( void );
-
- /*!
- * This method returns a pointer to the executable's coverage map
- * that contains the specified address.
- *
- * @param[in] address specifies the desired address
- *
- * @return Returns a pointer to the coverage map
- */
- CoverageMapBase* getCoverageMap( uint32_t address );
-
- /*!
- * This method returns the file name of the executable.
- *
- * @return Returns the executable's file name
- */
- std::string getFileName( void ) const;
-
- /*!
- * This method returns the library name associated with the executable.
- *
- * @return Returns the executable's library name
- */
- std::string getLibraryName( void ) const;
-
- /*!
- * This method returns the load address of the dynamic library
- *
- * @return Returns the load address of the dynamic library
- */
- uint32_t getLoadAddress( void ) const;
-
- /*!
- * This method returns a pointer to the executable's symbol table.
- *
- * @return Returns a pointer to the symbol table.
- */
- SymbolTable* getSymbolTable( void ) const;
-
- /*!
- * This method creates a coverage map for the specified symbol.
- *
- * @param[in] symbolName specifies the name of the symbol
- * @param[in] lowAddress specifies the low address of the coverage map
- * @param[in] highAddress specifies the high address of the coverage map
- *
- * @return Returns a pointer to the coverage map
- */
- CoverageMapBase* createCoverageMap (
- const std::string& symbolName,
- uint32_t lowAddress,
- uint32_t highAddress
- );
-
- /*!
- * This method indicates whether a dynamic library has been
- * associated with the executable.
- *
- * @return Returns TRUE if
- */
- bool hasDynamicLibrary( void );
-
- /*!
- * This method merges the coverage maps for this executable into
- * the unified coverage map.
- */
- void mergeCoverage( void );
-
- /*!
- * This method sets the load address of the dynamic library
- *
- * @param[in] address specifies the load address of the dynamic
- * library
- */
- void setLoadAddress( uint32_t address );
-
- private:
-
- /*!
- * This map associates a symbol with its coverage map.
- */
- typedef std::map<std::string, CoverageMapBase *> coverageMaps_t;
- coverageMaps_t coverageMaps;
-
- /*!
- * This member variable contains the name of the executable.
- */
- std::string executableName;
-
- /*!
- * This member variable contains the name of a dynamic library
- * associated with the executable.
- */
- std::string libraryName;
-
- /*!
- * This member variable contains the load address of a dynamic library
- * if one has been specified for the executable.
- */
- uint32_t loadAddress;
-
- /*!
- * This member variable contains a pointer to the symbol table
- * of the executable or library.
- */
- SymbolTable* theSymbolTable;
-
- };
-}
-#endif
diff --git a/covoar/Explanations.cc b/covoar/Explanations.cc
deleted file mode 100644
index c316a0b..0000000
--- a/covoar/Explanations.cc
+++ /dev/null
@@ -1,191 +0,0 @@
-/*! @file Explanations.cc
- * @brief Explanations Implementation
- *
- * This file contains the implementation of the functions
- * which provide a base level of functionality of a Explanations.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "Explanations.h"
-#include "app_common.h"
-
-namespace Coverage {
-
- Explanations::Explanations()
- {
- }
-
- Explanations::~Explanations()
- {
- }
-
- void Explanations::load(
- const char* const explanations
- )
- {
- #define MAX_LINE_LENGTH 512
- FILE *explain;
- char *cStatus;
- Explanation *e;
- int line = 1;
-
- if (!explanations)
- return;
-
- explain = fopen( explanations, "r" );
- if (!explain) {
- fprintf(
- stderr,
- "ERROR: Explanations::load - unable to open explanations file %s\n",
- explanations
- );
- exit(-1);
- }
-
- while ( 1 ) {
- e = new Explanation;
- // Read the starting line of this explanation and
- // skip blank lines between
- do {
- inputBuffer[0] = '\0';
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, explain );
- if (cStatus == NULL) {
- goto done;
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
- line++;
- } while ( inputBuffer[0] == '\0' );
-
- // Have we already seen this one?
- if (set.find( inputBuffer ) != set.end()) {
- fprintf(
- stderr,
- "ERROR: Explanations::load - line %d "
- "contains a duplicate explanation (%s)\n",
- line,
- inputBuffer
- );
- exit( -1 );
- }
-
- // Add the starting line and file
- e->startingPoint = std::string(inputBuffer);
- e->found = false;
-
- // Get the classification
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, explain );
- if (cStatus == NULL) {
- fprintf(
- stderr,
- "ERROR: Explanations::load - line %d "
- "out of sync at the classification\n",
- line
- );
- exit( -1 );
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
- e->classification = inputBuffer;
- line++;
-
- // Get the explanation
- while (1) {
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, explain );
- // fprintf( stderr, "%d - %s\n", line, inputBuffer );
- if (cStatus == NULL) {
- fprintf(
- stderr,
- "ERROR: Explanations::load - line %d "
- "out of sync at the explanation\n",
- line
- );
- exit( -1 );
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
- line++;
-
- const char delimiter[4] = "+++";
- if (!strncmp( inputBuffer, delimiter, 3 )) {
- break;
- }
- // XXX only taking last line. Needs to be a vector
- e->explanation.push_back( inputBuffer );
- }
-
- // Add this to the set of Explanations
- set[ e->startingPoint ] = *e;
- }
-done:
- ;
-
- #undef MAX_LINE_LENGTH
- }
-
- const Explanation *Explanations::lookupExplanation(
- std::string& start
- )
- {
- if (set.find( start ) == set.end()) {
- #if 0
- fprintf( stderr,
- "Warning: Unable to find explanation for %s\n",
- start.c_str()
- );
- #endif
- return NULL;
- }
- set[ start ].found = true;
- return &set[ start ];
- }
-
- void Explanations::writeNotFound(
- const char* const fileName
- )
- {
- FILE* notFoundFile;
- bool notFoundOccurred = false;
-
- if (!fileName)
- return;
-
- notFoundFile = fopen( fileName, "w" );
- if (!fileName) {
- fprintf(
- stderr,
- "ERROR: Explanations::writeNotFound - unable to open file %s\n",
- fileName
- );
- exit( -1 );
- }
-
- for (std::map<std::string, Explanation>::iterator itr = set.begin();
- itr != set.end();
- itr++) {
- Explanation e = (*itr).second;
- std::string key = (*itr).first;
-
- if (!e.found) {
- notFoundOccurred = true;
- fprintf(
- notFoundFile,
- "%s\n",
- e.startingPoint.c_str()
- );
- }
- }
- fclose( notFoundFile );
-
- if (!notFoundOccurred) {
- if (!unlink( fileName )) {
- fprintf( stderr,
- "Warning: Unable to unlink %s\n\n",
- fileName
- );
- }
- }
- }
-
-}
diff --git a/covoar/Explanations.h b/covoar/Explanations.h
deleted file mode 100644
index 9b32358..0000000
--- a/covoar/Explanations.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*! @file Explanations.h
- * @brief Explanations Specification
- *
- * This file contains the specification of the Explanations class.
- */
-
-#ifndef __EXPLANATIONS_H__
-#define __EXPLANATIONS_H__
-
-#include <map>
-#include <stdint.h>
-#include <string>
-#include <vector>
-
-namespace Coverage {
-
- /*! @class Explanation
- *
- * This class defines the information that comprises an explanation
- * of an uncovered range or branch.
- */
- class Explanation {
-
- public:
-
- /*!
- * This member variable contains the starting line number of
- * the uncovered range or branch.
- */
- std::string startingPoint;
-
- /*!
- * This member variable contains the classification of
- * the explanation.
- */
- std::string classification;
-
- /*!
- * This member variable contains the multi-line explanation text.
- */
- std::vector<std::string> explanation;
-
- /*!
- * This member variable indicates whether this explanation was
- * used during analysis.
- */
- bool found;
-
- /*!
- * This method constructs an Explanation instance.
- */
- Explanation() {found = false;}
-
- /*!
- * This method destructs an Explanation instance.
- */
- ~Explanation() {}
- };
-
- /*! @class Explanations
- *
- * This class defines a set of Explanation instances.
- */
- class Explanations {
-
- public:
-
- /*!
- * This member variable contains a list of Explanation instances.
- */
- std::map<std::string, Explanation> set;
-
- /*!
- * This method constructs an Explanations instance.
- */
- Explanations();
-
- /*!
- * This method destructs an Explanations instance.
- */
- ~Explanations();
-
- /*!
- * This methods loads the explanation information from the
- * specified file.
- *
- * @param[in] explanations specifies the file name containing
- * the explanation information
- */
- void load(
- const char* const explanations
- );
-
- /*!
- * This method returns the explanation associated with the
- * specified starting line number.
- *
- * @param[in] start specifies the starting line number for
- * which to search
- */
- const Explanation *lookupExplanation(
- std::string& start
- );
-
- /*!
- * This method writes a file that contains a list of any
- * explanations that were not looked up.
- *
- * @param[in] fileName specifies the name of the file to write
- */
- void writeNotFound(
- const char* const fileName
- );
-
- };
-
-}
-
-#endif
diff --git a/covoar/GcovData.cc b/covoar/GcovData.cc
deleted file mode 100644
index 6d10337..0000000
--- a/covoar/GcovData.cc
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * TODO: use strings instead of cstrings for reliability and saving memory
- * TODO: use global buffers
- *
- */
-
-/*! @file GcovData.cc
- * @brief GcovData Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading *.gcno and writing *.gcda files for gcov support
- */
-
-#include <libgen.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-//#include <sys/stat.h>
-
-//#include "app_common.h"
-#include "GcovData.h"
-//#include "ExecutableInfo.h"
-//#include "CoverageMap.h"
-//#include "qemu-traces.h"
-
-
-namespace Gcov {
-
- GcovData::GcovData()
- {
- numberOfFunctions = 0;
- }
-
- GcovData::~GcovData()
- {
- }
-
- bool GcovData::readGcnoFile( const char* const fileName )
- {
- int status;
- FILE* gcovFile;
- char* tempString;
- char* tempString2;
- char* tempString3;
-
- if ( strlen(fileName) >= FILE_NAME_LENGTH ){
- fprintf(
- stderr,
- "ERROR: File name is too long to be correctly stored: %u\n",
- (unsigned int) strlen(fileName)
- );
- return false;
- }
- strcpy( gcnoFileName, fileName );
- strcpy( gcdaFileName, fileName );
- strcpy( textFileName, fileName );
- strcpy( cFileName, fileName );
- tempString = strstr( gcdaFileName,".gcno" );
- tempString2 = strstr( textFileName,".gcno" );
- tempString3 = strstr( cFileName,".gcno" );
-
- if ( (tempString == NULL) && (tempString2 == NULL) ){
- fprintf(stderr, "ERROR: incorrect name of *.gcno file\n");
- }
- else
- {
- strcpy( tempString, ".gcda"); // construct gcda file name
- strcpy( tempString2, ".txt"); // construct report file name
- strcpy( tempString3, ".c"); // construct source file name
- }
-
- // Debug message
- // fprintf( stderr, "Readning file: %s\n", gcnoFileName);
-
- // Open the notes file.
- gcovFile = fopen( gcnoFileName, "r" );
- if ( !gcovFile ) {
- fprintf( stderr, "Unable to open %s\n", gcnoFileName );
- return false;
- }
-
- // Read and validate the gcnoPreamble (magic, version, timestamp) from the file
- status = readFilePreamble( &gcnoPreamble, gcovFile, GCNO_MAGIC );
- if ( status <= 0 ){
- fprintf( stderr, "Unable to read %s\n", gcnoFileName );
- fclose( gcovFile );
- return false;
- }
-
- //Read all remaining frames from file
- while( readFrame(gcovFile) ){}
-
- fclose( gcovFile );
- return true;
- }
-
-
- bool GcovData::writeGcdaFile ()
- {
- gcov_preamble preamble;
- gcov_frame_header header;
- FILE* gcdaFile;
- functions_iterator_t currentFunction;
- arcs_iterator_t currentArc;
- uint32_t buffer;
- uint32_t countersFound;
- uint32_t countersFoundSum;
- uint64_t countersSum;
- uint64_t countersMax;
- uint64_t llBuffer[4096]; // TODO: Use common buffer
- gcov_statistics objectStats;
- gcov_statistics programStats;
- size_t status;
-
- // Debug message
- // fprintf( stderr, "Writing file: %s\n", gcdaFileName);
-
- // Lets clear counters sumators
- countersSum = 0;
- countersMax = 0;
- countersFoundSum = 0;
-
- // Open the data file.
- gcdaFile = fopen( gcdaFileName, "w" );
- if ( !gcdaFile ) {
- fprintf( stderr, "Unable to create %s\n", gcdaFileName );
- return false;
- }
-
- //Form preamble
- preamble.magic = GCDA_MAGIC;
- preamble.version = gcnoPreamble.version;
- preamble.timestamp = gcnoPreamble.timestamp;
-
- //Write preamble
- status = fwrite (&preamble , sizeof( preamble ), 1 , gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing gcda preamble to a file %s\n", gcdaFileName );
-
- //Write function info and counter counts
- for (
- currentFunction = functions.begin();
- currentFunction != functions.end();
- currentFunction++
- )
- {
- //Write function announcement frame header (length always equals 2)
- header.tag = GCOV_TAG_FUNCTION;
- header.length = 2;
- status = fwrite (&header, sizeof(header), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing function announcement to a file %s\n", gcdaFileName );
-
- //Write function id
- buffer = (*currentFunction)->getId();
- status = fwrite (&buffer, sizeof( buffer ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing function id to a file %s\n", gcdaFileName );
-
- //Write function checksum
- buffer = (*currentFunction)->getChecksum();
- status = fwrite (&buffer, sizeof( buffer ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing function checksum to a file %s\n", gcdaFileName );
-
- // Determine how many counters there are
- // and store their counts in buffer
- countersFound = 0;
- (*currentFunction)->getCounters( llBuffer, countersFound, countersSum, countersMax );
- countersFoundSum += countersFound;
-
- //Write info about counters
- header.tag = GCOV_TAG_COUNTER;
- header.length = countersFound * 2;
- status = fwrite (&header, sizeof( header ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing counter header to a file %s\n", gcdaFileName );
-
- status = fwrite (llBuffer, sizeof( uint64_t ), countersFound , gcdaFile );
- if ( status != countersFound )
- fprintf( stderr, "Error while writing counter data to a file %s\n", gcdaFileName );
- }
-
- // Prepare frame with object file statistics
- header.tag = GCOV_TAG_OBJECT_SUMMARY;
- header.length = 9;
- objectStats.checksum = 0; // TODO: have no idea hov to calculates it :)
- objectStats.counters = countersFoundSum;
- objectStats.runs = 1; // We are lying for now, we have no means of figuring this out
- objectStats.sum = countersSum; // Sum of all counters
- objectStats.max = countersMax; // max value for counter on last run, we have no clue
- objectStats.sumMax = countersMax; // we have no clue
-
- // Write data
- status = fwrite (&header, sizeof( header ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing stats header to a file %s\n", gcdaFileName );
- status = fwrite (&objectStats, sizeof( objectStats ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing object stats to a file %s\n", gcdaFileName );
-
-
- // Prepare frame with program statistics
- header.tag = GCOV_TAG_PROGRAM_SUMMARY;
- header.length = 9;
- programStats.checksum = 0; // TODO: have no idea hov to calculate it :)
- programStats.counters = countersFoundSum;
- programStats.runs = 1; // We are lying for now, we have no clue
- programStats.sum = countersSum; // Sum of all counters
- programStats.max = countersMax; // max value for counter on last run, we have no clue
- programStats.sumMax = countersMax; // we have no clue
-
- // Write data
- status = fwrite (&header, sizeof( header ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing stats header to a file %s\n", gcdaFileName );
- status = fwrite (&programStats, sizeof( programStats ), 1, gcdaFile );
- if ( status != 1 )
- fprintf( stderr, "Error while writing program stats to a file %s\n", gcdaFileName );
-
- fclose( gcdaFile );
-
- return true;
- }
-
- bool GcovData::readFrame(
- FILE* gcovFile
- )
- {
- gcov_frame_header header;
- char buffer[512];
- uint32_t intBuffer[4096];
- uint32_t tempBlockId;
- blocks_iterator_t tempBlockIterator;
- int status;
- GcovFunctionData* newFunction;
-
- status = readFrameHeader( &header, gcovFile);
-
- if ( status <= 0 ){
- // Not printing error message because this
- // happenns at the end of each file
- return false;
- }
-
- switch (header.tag){
-
- case GCOV_TAG_FUNCTION:
-
- numberOfFunctions++;
- newFunction = new GcovFunctionData;
- if ( !readFunctionFrame(header, gcovFile, newFunction) ){
- fprintf( stderr, "Error while reading FUNCTION from gcov file...\n" );
- return false;
- }
- functions.push_back(newFunction);
- break;
-
- case GCOV_TAG_BLOCKS:
-
- status = fread( &intBuffer, 4, header.length, gcovFile );
- if ( status != (int) header.length){
- fprintf(
- stderr, "Error while reading BLOCKS from gcov file...\n"
- "Header lenght is %u instead of %u\n",
- header.length,
- status
- );
- return false;
- }
-
- for( uint32_t i = 0; i < header.length; i++ )
- functions.back()->addBlock(i, intBuffer[i], "");
-
- break;
-
- case GCOV_TAG_ARCS:
-
- status = fread( &intBuffer, 4, header.length, gcovFile );
- if (status != (int) header.length){
- return false;
- }
-
- for ( int i = 1; i < (int) header.length; i += 2 )
- functions.back()->addArc(intBuffer[0], intBuffer[i], intBuffer[i+1]);
-
- break;
-
- case GCOV_TAG_LINES:
-
- status = fread( &intBuffer, 4, 2, gcovFile );
- if (status != 2 || intBuffer[1] != 0){
- fprintf(
- stderr,
- "Error while reading block id for LINES from gcov file..."
- );
- return false;
- }
- tempBlockId = intBuffer[0];
- header.length -= 2;
-
- // Find the right block
- tempBlockIterator =functions.back()->findBlockById(tempBlockId);
-
- header.length -= readString(buffer, gcovFile);
- functions.back()->setBlockFileName( tempBlockIterator, buffer );
-
- status = fread( &intBuffer, 4, header.length, gcovFile );
- if (status != (int) header.length){
- fprintf( stderr, "Error while reading LINES from gcov file..." );
- return false;
- }
-
- else
- for (int i = 0; i < (int) (header.length - 2); i++)
- functions.back()->addBlockLine( tempBlockIterator, intBuffer[i] );
-
- break;
-
- default:
-
- fprintf( stderr, "\n\nERROR - encountered unknown *.gcno tag : 0x%x\n", header.tag );
- break;
- }
-
- return true;
- }
-
- int GcovData::readString(
- char* buffer, //TODO: use global buffer here
- FILE* gcovFile
- )
- {
- int status;
- int length;
-
- status = fread( &length, sizeof(int), 1, gcovFile );
- if (status != 1){
- fprintf( stderr, "ERROR: Unable to read string length from gcov file\n" );
- return -1;
- }
-
- status = fread( buffer, length * 4 , 1, gcovFile );
- if (status != 1){
- fprintf( stderr, "ERROR: Unable to read string from gcov file\n" );
- return -1;
- }
-
- buffer[length * 4] = '\0';
-
- return length +1;
- }
-
- int GcovData::readFrameHeader(
- gcov_frame_header* header,
- FILE* gcovFile
- )
- {
- int status;
- int length;
-
- length = sizeof(gcov_frame_header);
- status = fread( header, length, 1, gcovFile );
- if (status != 1){
- //fprintf( stderr, "ERROR: Unable to read frame header from gcov file\n" );
- return -1;
- }
-
- return length / 4;
- }
-
- int GcovData::readFilePreamble(
- gcov_preamble* preamble,
- FILE* gcovFile,
- uint32_t desiredMagic
- )
- {
- int status;
- int length;
-
- length = sizeof( gcov_preamble );
- status = fread( preamble, sizeof( gcov_preamble), 1, gcovFile );
- if (status <= 0) {
- fprintf( stderr, "Error while reading file preamble\n" );
- return -1;
- }
-
- if ( preamble->magic != GCNO_MAGIC ) {
- fprintf( stderr, "File is not a valid *.gcno output (magic: 0x%4x)\n", preamble->magic );
- return -1;
- }
-
- return length / 4;
- }
-
- bool GcovData::readFunctionFrame(
- gcov_frame_header header,
- FILE* gcovFile,
- GcovFunctionData* function
- )
- {
- char buffer[512]; //TODO: use common buffers
- uint32_t intBuffer[4096];
- int status;
-
- status = fread( &intBuffer, 8, 1, gcovFile );
- if (status != 1){
- fprintf( stderr, "ERROR: Unable to read Function ID & checksum\n" );
- return false;
- }
- header.length -= 2;
- function->setId( intBuffer[0] );
- function->setChecksum( intBuffer[1] );
-
- header.length -= readString( buffer, gcovFile );
- function->setFunctionName( buffer );
- header.length -= readString( buffer, gcovFile );
- function->setFileName( buffer );
- status = fread( &intBuffer, 4, header.length, gcovFile );
- if (status <= 0){
- fprintf( stderr, "ERROR: Unable to read Function starting line number\n" );
- return false;
- }
- function->setFirstLineNumber( intBuffer[0] );
-
- return true;
- }
-
- bool GcovData::writeReportFile()
- {
- functions_iterator_t currentFunction;
- uint32_t i = 1; //iterator
- FILE* textFile;
-
- // Debug message
- // fprintf( stderr, "Writing file: %s\n", textFileName);
-
- // Open the data file.
- textFile = fopen( textFileName, "w" );
- if ( !textFile ) {
- fprintf( stderr, "Unable to create %s\n", textFileName );
- return false;
- }
-
- printGcnoFileInfo( textFile );
-
- for (
- currentFunction = functions.begin();
- currentFunction != functions.end();
- currentFunction++
- )
- {
- (*currentFunction)->printFunctionInfo( textFile, i );
- (*currentFunction)->printCoverageInfo( textFile, i );
- i++;
- }
-
- fclose ( textFile );
- return true;
- }
-
- void GcovData::printGcnoFileInfo( FILE * textFile )
- {
- fprintf(
- textFile,
- "\nFILE:\t\t\t%s\n"
- "magic:\t\t\t%x\n"
- "version:\t\t%x\n"
- "timestamp:\t\t%x\n"
- "functions found: \t%u\n\n",
- gcnoFileName,
- gcnoPreamble.magic,
- gcnoPreamble.version,
- gcnoPreamble.timestamp,
- numberOfFunctions
- );
- }
-
- void GcovData::writeGcovFile( )
- {
- char path[512];
- char command[512];
-
- //fprintf (stderr, "Attempting to run gcov for: %s\n", cFileName );
- strcpy( path, cFileName );
- dirname( path );
- sprintf( command, "( cd %s && gcov %s &>> gcov.log)", path, basename( cFileName ) );
- //fprintf (stderr, "> %s\n", command );
- system( command );
- }
-
- bool GcovData::processCounters( )
- {
- functions_iterator_t currentFunction;
- bool status = true;
- for (
- currentFunction = functions.begin();
- currentFunction != functions.end();
- currentFunction++
- )
- {
- if ( !(*currentFunction)->processFunctionCounters( ) )
- status = false;
- }
-
- return status;
- }
-}
diff --git a/covoar/GcovData.h b/covoar/GcovData.h
deleted file mode 100644
index 83b8772..0000000
--- a/covoar/GcovData.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*! @file GcovData.h
- * @brief GcovData Specification
- *
- * This file contains the specification of the GcovGcnoWriter class.
- */
-
-#ifndef __GCOV_DATA_H__
-#define __GCOV_DATA_H__
-
-#include <stdint.h>
-#include <list>
-#include <iostream>
-#include "GcovFunctionData.h"
-
-namespace Gcov {
-
-#define GCDA_MAGIC ((uint32_t) 0x67636461 ) /* "gcda" */
-#define GCNO_MAGIC ((uint32_t) 0x67636e6f ) /* "gcno" */
-
-/* we are using gcc 4.6 release format, coded as "406R" */
-#define GCNO_VERSION ((uint32_t) 0x34303652 )
-
-/* GCOV tags */
-#define GCOV_TAG_FUNCTION ((uint32_t)0x01000000)
-#define GCOV_TAG_BLOCKS ((uint32_t)0x01410000)
-#define GCOV_TAG_ARCS ((uint32_t)0x01430000)
-#define GCOV_TAG_LINES ((uint32_t)0x01450000)
-#define GCOV_TAG_COUNTER ((uint32_t)0x01a10000)
-#define GCOV_TAG_OBJECT_SUMMARY ((uint32_t)0xa1000000)
-#define GCOV_TAG_PROGRAM_SUMMARY ((uint32_t)0xa3000000)
-
-
-typedef std::list<Gcov::GcovFunctionData*> functions_t;
-typedef std::list<Gcov::GcovFunctionData*>::iterator functions_iterator_t;
-
-struct gcov_preamble
-{
- uint32_t magic;
- uint32_t version;
- uint32_t timestamp;
-};
-
-struct gcov_frame_header
-{
- uint32_t tag;
- uint32_t length;
-};
-
-struct gcov_statistics
-{
- uint32_t checksum; // checksum
- uint32_t counters; // number of counters
- uint32_t runs; // number of runs
- uint64_t sum; // sum of all couter values
- uint64_t max; // max value on a single run
- uint64_t sumMax; // sum of individual runs max values
-};
-
- /*! @class GcovData
- *
- * This is the specification of the GcovData class.
- */
- class GcovData {
-
- public:
-
- /*!
- * This method constructs a GcnoReader instance.
- */
- GcovData();
-
- /*!
- * This method destructs a GcnoReader instance.
- */
- virtual ~GcovData();
-
- /*!
- * This method reads the *.gcno file
- *
- * @param[in] fileName name of the file to read
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool readGcnoFile( const char* const fileName );
-
- /*!
- * This method writes the *.gcda file. It also produces and stores
- * gcda and txt file names for future outputs.
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool writeGcdaFile ();
-
- /*!
- * This method writes all contained information to stdout file
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool writeReportFile();
-
- /*!
- * This method runs gcov to generate report. This method should
- * be used only when gcno and gcda files are already generated.
- */
- void writeGcovFile( );
-
- /*!
- * This method calculates values of counters for all functions
- */
- bool processCounters( void );
-
- private:
-
- uint32_t numberOfFunctions;
- gcov_preamble gcnoPreamble;
- char gcnoFileName[FILE_NAME_LENGTH];
- char gcdaFileName[FILE_NAME_LENGTH];
- char textFileName[FILE_NAME_LENGTH];
- char cFileName[FILE_NAME_LENGTH];
- functions_t functions;
-
-
- /*!
- * This method reads a frame from *.gcno file
- *
- * @param[in] file points to a file to read
- *
- * @return true if read was succesfull, false otherwise
- */
- bool readFrame(
- FILE* gcovFile
- );
-
- /*!
- * This method reads a string from gcov file
- *
- * @param[in] buffer stores the string
- * @param[in] file specifies the name of the file to read
- *
- * @return Returns length of words read (word = 32bit) or -1 if error ocurred
- */
- int readString(
- char* buffer,
- FILE* gcovFile
- );
-
- /*!
- * This method reads a frame header from gcov file
- *
- * @param[in] header stores the header
- * @param[in] file specifies the name of the file to read
- *
- * @return Returns length of words read (word = 32bit)
- * or -1 if error ocurred
- */
- int readFrameHeader(
- gcov_frame_header* header,
- FILE* gcovFile
- );
-
- /*!
- * This method reads a frame header from gcov file
- *
- * @param[in] preamble stores the preamble
- * @param[in] gcovFile specifies the name of the file to read
- * @param[in] desiredMagic stores the expected magic of a file
- *
- * @return Returns length of words read (word = 32bit)
- * or -1 if error ocurred
- */
- int readFilePreamble(
- gcov_preamble* preamble,
- FILE* gcovFile,
- const uint32_t desiredMagic
- );
-
- /*!
- * This method reads a function frame from gcov file
- *
- * @param[in] header passes frame header
- * @param[in] gcovFile specifies the name of the file to read
- * @param[in] function stores the expected magic of a file
- *
- * @return Returns true if operation was succesfull
- */
- bool readFunctionFrame(
- gcov_frame_header header,
- FILE* gcovFile,
- GcovFunctionData* function
- );
-
- /*!
- * This method prints info about previously read *.gcno file
- * to a specified report file
- */
- void printGcnoFileInfo( FILE * textFile );
- };
-}
-#endif
diff --git a/covoar/GcovFunctionData.cc b/covoar/GcovFunctionData.cc
deleted file mode 100644
index f746b12..0000000
--- a/covoar/GcovFunctionData.cc
+++ /dev/null
@@ -1,602 +0,0 @@
-/*! @file GcovFunctionData.cc
- * @brief GcovFunctionData Implementation
- *
- * This file contains the implementation of the class storing information
- * about single function.
- */
-
-#include <stdio.h>
-#include <string.h>
-//#include <stdlib.h>
-//#include <sys/stat.h>
-
-#include "app_common.h"
-#include "GcovFunctionData.h"
-#include "ObjdumpProcessor.h"
-#include "CoverageMapBase.h"
-
-
-namespace Gcov {
-
- GcovFunctionData::GcovFunctionData()
- {
- numberOfArcs = 0;
- numberOfBlocks = 0;
- coverageMap = NULL;
- }
-
- GcovFunctionData::~GcovFunctionData()
- {
- }
-
- void GcovFunctionData::setChecksum( const uint32_t chk )
- {
- checksum = chk;
- }
-
- void GcovFunctionData::setId( const uint32_t idNumber )
- {
- id = idNumber;
- }
-
-
- void GcovFunctionData::setFirstLineNumber( const uint32_t lineNo )
- {
- firstLineNumber = lineNo;
- }
-
- bool GcovFunctionData::setFunctionName( const char* fcnName )
- {
- std::string symbolName;
-
- symbolName = fcnName;
-
- if ( strlen(fcnName) >= FUNCTION_NAME_LENGTH ) {
- fprintf(
- stderr,
- "ERROR: Function name is too long to be correctly stored: %u\n",
- (unsigned int) strlen(fcnName)
- );
- return false;
- }
-
- strcpy (functionName, fcnName);
-
- // Tie function to its coverage map
- symbolInfo = SymbolsToAnalyze->find( symbolName );
- if ( symbolInfo != NULL )
- coverageMap = symbolInfo->unifiedCoverageMap;
-
-#if 0
- if ( coverageMap == NULL) {
- fprintf(
- stderr,
- "ERROR: Could not find coverage map for: %s\n",
- symbolName.c_str()
- );
- } else {
- fprintf(
- stderr,
- "SUCCESS: Hound coverage map for: %s\n",
- symbolName.c_str()
- );
- }
-#endif
-
- return true;
- }
-
- bool GcovFunctionData::setFileName( const char* fileName ) {
- if ( strlen(fileName) >= FILE_NAME_LENGTH ){
- fprintf(
- stderr,
- "ERROR: File name is too long to be correctly stored: %u\n",
- (unsigned int) strlen(fileName)
- );
- return false;
- }
- strcpy (sourceFileName, fileName);
- return true;
- }
-
- arcs_t GcovFunctionData::getArcs() const
- {
- return arcs;
- }
-
- uint32_t GcovFunctionData::getChecksum() const
- {
- return checksum;
- }
-
- uint32_t GcovFunctionData::getId() const
- {
- return id;
- }
-
- void GcovFunctionData::getCounters(
- uint64_t* counterValues,
- uint32_t &countersFound,
- uint64_t &countersSum,
- uint64_t &countersMax
- )
- {
- arcs_iterator_t currentArc;
- int i;
-
- countersFound = 0;
- countersSum = 0;
- countersMax = 0;
-
- // Locate relevant counters and copy their values
- i = 0;
- for(
- currentArc = arcs.begin();
- currentArc != arcs.end();
- currentArc++
- )
- {
- if ( currentArc->flags == 0 || currentArc->flags == 2 ||
- currentArc->flags == 4 ) {
- countersFound++;
- countersSum += currentArc->counter;
- counterValues[i] = currentArc->counter;
- if ( countersMax <= currentArc->counter)
- countersMax = currentArc->counter;
- i++;
- }
- }
- }
-
- blocks_t GcovFunctionData::getBlocks() const
- {
- return blocks;
- }
-
- void GcovFunctionData::addArc(
- uint32_t source,
- uint32_t destination,
- uint32_t flags
- )
- {
- gcov_arc_info arc;
-
- numberOfArcs++;
- arc.sourceBlock = source;
- arc.destinationBlock = destination;
- arc.flags = flags;
- arc.counter = 0;
- arcs.push_back(arc);
- }
-
- void GcovFunctionData::addBlock(
- const uint32_t id,
- const uint32_t flags,
- const char * sourceFileName
- )
- {
- gcov_block_info block;
- numberOfBlocks++;
- block.id = id;
- block.flags = flags;
- block.numberOfLines = 0;
- block.counter = 0;
- strcpy (block.sourceFileName, sourceFileName);
- blocks.push_back(block);
- }
-
- void GcovFunctionData::printFunctionInfo(
- FILE * textFile,
- uint32_t function_number
- )
- {
- blocks_iterator_t currentBlock;
- arcs_iterator_t currentArc;
-
- fprintf(
- textFile,
- "\n\n=========================="
- "FUNCTION %3d "
- "==========================\n\n",
- function_number
- );
- fprintf(
- textFile,
- "Name: %s\n"
- "File: %s\n"
- "Line: %u\n"
- "Id: %u\n"
- "Checksum: 0x%x\n\n",
- functionName,
- sourceFileName,
- firstLineNumber,
- id,
- checksum
- );
-
- // Print arcs info
- for ( currentArc = arcs.begin(); currentArc != arcs.end(); currentArc++ ) {
- printArcInfo( textFile, currentArc );
- }
- fprintf( textFile, "\n");
-
- // Print blocks info
- for ( currentBlock = blocks.begin();
- currentBlock != blocks.end();
- currentBlock++
- ) {
- printBlockInfo( textFile, currentBlock );
- }
- }
-
- void GcovFunctionData::printCoverageInfo(
- FILE *textFile,
- uint32_t function_number
- )
- {
- uint32_t baseAddress = 0;
- uint32_t baseSize;
- uint32_t currentAddress;
- std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator instruction;
-
- if ( coverageMap != NULL ) {
-
- for (instruction = symbolInfo->instructions.begin();
- instruction != symbolInfo->instructions.end();
- instruction++) {
- if( instruction->isInstruction ) {
- baseAddress = instruction->address;
- break;
- }
- }
- baseSize = coverageMap->getSize();
-
- fprintf(
- textFile,
- "\nInstructions (Base address: 0x%08x, Size: %4u): \n\n",
- baseAddress,
- baseSize
- );
- for ( instruction = symbolInfo->instructions.begin();
- instruction != symbolInfo->instructions.end();
- instruction++
- )
- {
- if ( instruction->isInstruction ) {
- currentAddress = instruction->address - baseAddress;
- fprintf( textFile, "0x%-70s ", instruction->line.c_str() );
- fprintf( textFile, "| 0x%08x ", currentAddress );
- fprintf( textFile, "*");
- fprintf( textFile,
- "| exec: %4u ",
- coverageMap->getWasExecuted( currentAddress )
- );
- fprintf( textFile, "| taken/not: %4u/%4u ",
- coverageMap->getWasTaken( currentAddress ),
- coverageMap->getWasNotTaken( currentAddress )
- );
-
- if ( instruction->isBranch )
- fprintf( textFile, "| Branch " );
- else
- fprintf( textFile, " " );
-
- if ( instruction->isNop )
- fprintf( textFile, "| NOP(%3u) \n", instruction->nopSize );
- else
- fprintf( textFile, " \n" );
- }
- }
- }
- }
-
- void GcovFunctionData::setBlockFileName(
- const blocks_iterator_t block,
- const char *fileName
- )
- {
- strcpy(block->sourceFileName, fileName);
- }
-
- void GcovFunctionData::addBlockLine(
- const blocks_iterator_t block,
- const uint32_t line
- )
- {
- block->lines.push_back(line);
- (block->numberOfLines)++;
- }
-
- blocks_iterator_t GcovFunctionData::findBlockById(
- const uint32_t id
- )
- {
- blocks_iterator_t blockIterator;
-
- if ( !blocks.empty() ) {
- blockIterator = blocks.begin();
- while ( blockIterator != blocks.end( ) ){
- if ( blockIterator->id == id)
- break;
- blockIterator++;
- }
- } else {
- fprintf(
- stderr,
- "ERROR: GcovFunctionData::findBlockById() failed, no blocks present\n"
- );
- }
- return blockIterator;
- }
-
- void GcovFunctionData::printArcInfo(
- FILE * textFile, arcs_iterator_t arc
- )
- {
- fprintf(
- textFile,
- " > ARC %3u -> %3u ",
- arc->sourceBlock,
- arc->destinationBlock
- );
-
- fprintf( textFile, "\tFLAGS: ");
- switch ( arc->flags ){
- case 0:
- fprintf( textFile, "( ___________ ____ _______ )");
- break;
- case 1:
- fprintf( textFile, "( ___________ ____ ON_TREE )");
- break;
- case 2:
- fprintf( textFile, "( ___________ FAKE _______ )");
- break;
- case 3:
- fprintf( textFile, "( ___________ FAKE ON_TREE )");
- break;
- case 4:
- fprintf( textFile, "( FALLTHROUGH ____ _______ )");
- break;
- case 5:
- fprintf( textFile, "( FALLTHROUGH ____ ON_TREE )");
- break;
- default:
- fprintf( textFile, "( =======FLAGS_ERROR====== )");
- fprintf( stderr,
- " ERROR: Unknown arc flag: 0x%x\n",
- arcs.back().flags
- );
- break;
- }
- fprintf( textFile, "\tTaken: %5llu\n", (unsigned long long) arc->counter );
- }
-
- void GcovFunctionData::printBlockInfo(
- FILE * textFile,
- blocks_iterator_t block
- )
- {
- std::list<uint32_t>::iterator line;
-
- fprintf(
- textFile,
- " > BLOCK %3u from %s\n"
- " -counter: %5llu\n"
- " -flags: 0x%x\n"
- " -lines: ",
- block->id,
- block->sourceFileName,
- (unsigned long long) block->counter,
- block->flags
- );
- if ( !block->lines.empty( ) )
- for ( line = block->lines.begin() ; line != block->lines.end(); line++ )
- fprintf ( textFile, "%u, ", *line);
- fprintf ( textFile, "\n");
- }
-
- bool GcovFunctionData::processFunctionCounters( void ) {
-
- uint32_t baseAddress = 0;
- uint32_t currentAddress = 0;
- std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator instruction;
- blocks_iterator_t blockIterator;
- blocks_iterator_t blockIterator2;
- arcs_iterator_t arcIterator;
- arcs_iterator_t arcIterator2;
- std::list<uint64_t> taken; // List of taken counts for branches
- std::list<uint64_t> notTaken; // List of not taken counts for branches
-
- //fprintf( stderr, "DEBUG: Processing counters for file: %s\n", sourceFileName );
- if ( blocks.empty() || arcs.empty() || coverageMap == NULL || symbolInfo->instructions.empty())
- {
- //fprintf( stderr,
- // "DEBUG: sanity check returned false for function: %s from file: %s\n",
- // functionName,
- // sourceFileName
- //);
- return false;
- }
-
- // Reset iterators and variables
- blockIterator = blocks.begin();
- arcIterator = arcs.begin();
- arcIterator2 = arcIterator;
- arcIterator2++;
- instruction = symbolInfo->instructions.begin();
- baseAddress = coverageMap->getFirstLowAddress(); //symbolInfo->baseAddress;
- currentAddress = baseAddress;
-
- // Find taken/not taken values for branches
- if ( !processBranches( &taken , &notTaken ) )
- {
- //fprintf( stderr,
- // "ERROR: Failed to process branches for function: %s from file: %s\n",
- // functionName,
- // sourceFileName
- //);
- return false;
- };
-
- // Process the branching arcs
- while ( blockIterator != blocks.end() ) {
- //fprintf( stderr, "DEBUG: Processing branches\n" );
- while ( arcIterator->sourceBlock != blockIterator->id ) {
- if ( arcIterator == arcs.end() ) {
- //fprintf( stderr, "ERROR: Unexpectedly runned out of arcs to analyze\n" );
- return false;
- }
- arcIterator++;
- arcIterator2++;
- }
-
- // If no more branches break;
- if ( arcIterator2 == arcs.end() )
- break;
-
- // If this is a branch without FAKE arcs process it
- if (
- (arcIterator->sourceBlock == arcIterator2->sourceBlock ) &&
- !( arcIterator->flags & FAKE_ARC_FLAG ) &&
- !( arcIterator2->flags & FAKE_ARC_FLAG )
- ) {
- if ( taken.empty() || notTaken.empty() ) {
- fprintf(
- stderr,
- "ERROR: Branchess missing for function: %s from file: %s\n",
- functionName,
- sourceFileName
- );
- return false;
- }
- //fprintf( stderr, "DEBUG: Found true branching arc %3u -> %3u\n", arcIterator->sourceBlock, arcIterator->destinationBlock );
- if ( arcIterator->flags & FALLTHROUGH_ARC_FLAG ) {
- arcIterator->counter = notTaken.front();
- notTaken.pop_front();
- arcIterator2->counter = taken.front();
- taken.pop_front();
- } else {
- arcIterator2->counter = notTaken.front();
- notTaken.pop_front();
- arcIterator->counter = taken.front();
- taken.pop_front();
- }
-
- blockIterator2 = blocks.begin();
- //TODO: ADD FAILSAFE
- while ( arcIterator->destinationBlock != blockIterator2->id)
- blockIterator2++;
- blockIterator2->counter += arcIterator->counter;
-
- blockIterator2 = blocks.begin();
- //TODO: ADD FAILSAFE
- while ( arcIterator2->destinationBlock != blockIterator2->id)
- blockIterator2++;
- blockIterator2->counter += arcIterator2->counter;
- }
- blockIterator++;
- }
-
- // Reset iterators and variables
- blockIterator = blocks.begin();
- arcIterator = arcs.begin();
- arcIterator2 = arcIterator;
- arcIterator2++;
-
- // Set the first block
- blockIterator->counter = coverageMap->getWasExecuted( currentAddress );
-
- // Analyze remaining arcs and blocks
- while ( blockIterator != blocks.end() ) {
- while ( arcIterator->sourceBlock != blockIterator->id ) {
- if ( arcIterator == arcs.end() ) {
- fprintf( stderr, "ERROR: Unexpectedly runned out of arcs to analyze\n" );
- return false;
- }
- arcIterator++;
- arcIterator2++;
- }
-
- // If this is the last arc, propagate counter and exit
- if ( arcIterator2 == arcs.end() ) {
- //fprintf( stderr,
- // "DEBUG: Found last arc %3u -> %3u\n",
- // arcIterator->sourceBlock,
- // arcIterator->destinationBlock
- //);
- arcIterator->counter = blockIterator->counter;
- blockIterator2 = blocks.begin();
- while ( arcIterator->destinationBlock != blockIterator2->id) //TODO: ADD FAILSAFE
- blockIterator2++;
- blockIterator2->counter += arcIterator->counter;
- return true;
- }
-
- // If this is not a branch, propagate counter and continue
- if ( arcIterator->sourceBlock != arcIterator2->sourceBlock ) {
- //fprintf( stderr, "DEBUG: Found simple arc %3u -> %3u\n", arcIterator->sourceBlock, arcIterator->destinationBlock );
- arcIterator->counter = blockIterator->counter;
- blockIterator2 = blocks.begin();;
- while ( arcIterator->destinationBlock != blockIterator2->id) //TODO: ADD FAILSAFE
- blockIterator2++;
- blockIterator2->counter += arcIterator->counter;
- }
-
- // If this is a branch with FAKE arc
- else if ( (arcIterator->sourceBlock == arcIterator2->sourceBlock ) && ( arcIterator2->flags & FAKE_ARC_FLAG ))
- {
- //fprintf( stderr, "DEBUG: Found fake branching arc %3u -> %3u\n", arcIterator->sourceBlock, arcIterator->destinationBlock );
- arcIterator->counter = blockIterator->counter;
- blockIterator2 = blocks.begin();
- while ( arcIterator->destinationBlock != blockIterator2->id) //TODO: ADD FAILSAFE
- blockIterator2++;
- blockIterator2->counter += arcIterator->counter;
- }
-
- // If this is a legitimate branch
- blockIterator++;
- }
-
- return true;
- }
-
- bool GcovFunctionData::processBranches(
- std::list<uint64_t> * taken ,
- std::list<uint64_t> * notTaken
- )
- {
- uint32_t baseAddress = 0;
- uint32_t currentAddress;
- std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator instruction;
-
- if ( coverageMap == NULL )
- return false;
-
- //baseAddress = coverageMap->getFirstLowAddress(); //symbolInfo->baseAddress;
- for (instruction = symbolInfo->instructions.begin(); instruction != symbolInfo->instructions.end(); instruction++)
- if( instruction->isInstruction ) {
- baseAddress = instruction->address;
- break;
- }
-
- //fprintf( stderr, "DEBUG: Processing instructions in search of branches\n" );
- for (instruction = symbolInfo->instructions.begin(); instruction != symbolInfo->instructions.end(); instruction++)
- {
- if ( instruction->isInstruction) {
- currentAddress = instruction-> address - baseAddress;
- if ( instruction->isBranch ) {
- taken->push_back ( (uint64_t) coverageMap->getWasTaken( currentAddress ) );
- notTaken->push_back ( (uint64_t) coverageMap->getWasNotTaken( currentAddress ) );
- //fprintf( stderr,
- // "Added branch to list taken/not: %4u/%4u\n",
- // coverageMap->getWasTaken( currentAddress ),
- // coverageMap->getWasNotTaken( currentAddress )
- //);
- }
- }
- }
- return true;
- }
-}
-
-
diff --git a/covoar/GcovFunctionData.h b/covoar/GcovFunctionData.h
deleted file mode 100644
index 1bc1be9..0000000
--- a/covoar/GcovFunctionData.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*! @file GcovFunctionData.h
- * @brief GcovFunctionData Specification
- *
- * This file contains the specification of the GcovGcnoWriter class.
- */
-
-#ifndef __GCOV_FUNCTION_DATA_H__
-#define __GCOV_FUNCTION_DATA_H__
-
-#include <stdint.h>
-#include <list>
-#include "CoverageMapBase.h"
-#include "DesiredSymbols.h"
-
-namespace Gcov {
-
-#define FUNCTION_NAME_LENGTH 64
-#define FILE_NAME_LENGTH 256
-
-#define ON_TREE_ARC_FLAG 0x1
-#define FAKE_ARC_FLAG 0x2
-#define FALLTHROUGH_ARC_FLAG 0x4
-
-struct gcov_arc_info
-{
- uint32_t sourceBlock;
- uint32_t destinationBlock;
- uint32_t flags;
- uint64_t counter;
-};
-
-struct gcov_block_info
-{
- uint32_t id;
- uint32_t flags;
- uint32_t numberOfLines;
- uint64_t counter;
- char sourceFileName[FILE_NAME_LENGTH];
- std::list<uint32_t> lines;
-};
-
-typedef std::list<gcov_arc_info> arcs_t;
-typedef std::list<gcov_arc_info>::iterator arcs_iterator_t;
-typedef std::list<gcov_block_info> blocks_t;
-typedef std::list<gcov_block_info>::iterator blocks_iterator_t;
-
- /*! @class GcovFunctionData
- *
- * This is the specification of the GcovFunctionData class.
- */
- class GcovFunctionData {
-
- public:
-
- /*!
- * This method constructs a GcovFunctionData instance.
- */
- GcovFunctionData();
-
- /*!
- * This method destructs a GcovFunctionData instance.
- */
- virtual ~GcovFunctionData();
-
- /*!
- * This method stores checksum related to function
- *
- * @param[in] chk stores the checksum value
- */
- void setChecksum(
- const uint32_t chk
- );
-
- /*!
- * This method stores id of function
- *
- * @param[in] idNumber stores the id value
- */
- void setId(
- const uint32_t idNumber
- );
-
- /*!
- * This method stores checksum related to function
- *
- * @param[in] lineNo passes number of the line begining the function
- */
- void setFirstLineNumber(
- const uint32_t lineNo
- );
-
- /*!
- * This method stores name of the function and ties it to its
- * unified coverage map.
- *
- * @param[in] functionName passes name of the the function
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool setFunctionName(
- const char* fcnName
- );
-
- /*!
- * This method stores name of the source file where function is located
- *
- * @param[in] fileName passes name of the the file
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool setFileName(
- const char* fileName
- );
-
- /*!
- * This method stores name of the source file where block is located
- *
- * @param[in] block identifies block
- * @param[in] fileName passes name of the the file
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- void setBlockFileName(
- const blocks_iterator_t block,
- const char* fileName
- );
-
- /*!
- * This method returns arcs list
- */
- arcs_t getArcs() const;
-
- /*!
- * This method returns blocks list
- */
- blocks_t getBlocks() const;
-
- /*!
- * This method returns checksum
- */
- uint32_t getChecksum() const;
-
- /*!
- * This method returns id
- */
- uint32_t getId() const;
-
- /*!
- * This method returns counters
- *
- * @param[out] counterValues array of counter values
- * @param[out] countersFound used to return counters number
- * @param[out] countersSum used to return sum counters values
- * @param[out] countersMax used to return max counter value
- */
- void getCounters( uint64_t* counterValues, uint32_t &countersFound, uint64_t &countersSum, uint64_t &countersMax );
-
- /*!
- * This method adds new arc to arc list
- *
- * @param[in] source passes source block number
- * @param[in] destination passes destination block number
- */
- void addArc(
- uint32_t source,
- uint32_t destination,
- uint32_t flags
- );
-
- /*!
- * This method adds new arc to arc list
- *
- * @param[in] block identifies block
- * @param[in] line passes the line number
- */
- void addBlockLine(
- const blocks_iterator_t block,
- const uint32_t line
- );
-
- /*!
- * This method finds block by its ID
- *
- * @param[in] id passes block id number
- *
- * @return Returns iterator to a matching block or NULL for error.
- */
- blocks_iterator_t findBlockById(
- const uint32_t id
- );
-
- /*!
- * This method adds new block to block list
- *
- * @param[in] id passes block id number
- * @param[in] flags passes per block flags
- * @param[in] sourceFileName passes containing file name
- */
- void addBlock(
- const uint32_t id,
- const uint32_t flags,
- const char * sourceFileName
- );
-
- /*!
- * This method prints info about function
- */
- void printFunctionInfo( FILE * textFile, uint32_t function_number );
-
- /*!
- * This method prints info about coverage of this function
- */
- void printCoverageInfo( FILE * textFile, uint32_t function_number );
-
- /*!
- * This method prints info about chosen arc in arcs list
- *
- * @param[in] textFile specifies output file
- * @param[in] arc passes iterator identifying arc
- */
- void printArcInfo(
- FILE * textFile,
- arcs_iterator_t arc
- );
-
- /*!
- * This method prints info about chosen block in blocks list
- *
- * @param[in] block passes iterator identifying block
- */
- void printBlockInfo(
- FILE * textFile,
- blocks_iterator_t block
- );
-
- /*!
- * This method calculates values of arc counters
- */
- bool processFunctionCounters( void );
-
- private:
-
- uint32_t id;
- uint32_t checksum;
- uint32_t firstLineNumber;
- uint32_t numberOfBlocks;
- uint32_t numberOfArcs;
- arcs_t arcs;
- blocks_t blocks;
- char functionName[FUNCTION_NAME_LENGTH];
- char sourceFileName[FILE_NAME_LENGTH];
-
- /*!
- * This member contains the unified or merged coverage map
- * and symbol info for the symbol.
- */
- Coverage::CoverageMapBase* coverageMap;
- Coverage::SymbolInformation* symbolInfo;
-
- /*!
- * This method creates list of taken/not taken values
- * for branches
- *
- * @param[in] taken used to return taken counts list
- * @param[in] notTaken used to return not taken counts list
- */
- bool processBranches(
- std::list<uint64_t> * taken ,
- std::list<uint64_t> * notTaken
- );
- };
-
-}
-#endif
diff --git a/covoar/Makefile b/covoar/Makefile
deleted file mode 100644
index bb8b6f7..0000000
--- a/covoar/Makefile
+++ /dev/null
@@ -1,158 +0,0 @@
-INSTALL_DIR=../bin
-CXXFLAGS=-g -Wall -O3
-PROGRAMS=covoar qemu-dump-trace trace-converter configfile-test
-
-COMMON_OBJS= app_common.o \
- ConfigFile.o \
- CoverageFactory.o \
- CoverageMap.o \
- CoverageMapBase.o \
- CoverageRanges.o \
- CoverageReaderBase.o \
- CoverageReaderQEMU.o \
- CoverageReaderRTEMS.o \
- CoverageReaderSkyeye.o \
- CoverageReaderTSIM.o \
- CoverageWriterBase.o \
- CoverageWriterRTEMS.o \
- CoverageWriterSkyeye.o \
- CoverageWriterTSIM.o \
- DesiredSymbols.o \
- ExecutableInfo.o \
- Explanations.o \
- GcovData.o \
- GcovFunctionData.o \
- ObjdumpProcessor.o \
- ReportsBase.o \
- ReportsText.o \
- ReportsHtml.o \
- SymbolTable.o \
- Target_arm.o \
- TargetBase.o \
- TargetFactory.o \
- Target_i386.o \
- Target_lm32.o \
- Target_m68k.o \
- Target_powerpc.o \
- Target_sparc.o \
-
-TRACECONVERTER_OBJS = \
- $(COMMON_OBJS) \
- TraceConverter.o \
- TraceList.o \
- TraceReaderBase.o \
- TraceReaderLogQEMU.o \
- TraceWriterBase.o \
- TraceWriterQEMU.o
-
-COVOAR_OBJS = \
- $(COMMON_OBJS) \
- covoar.o
-
-CONFIGFILE_TEST_OBJS = \
- $(COMMON_OBJS) \
- configfile_test.cc
-
-INSTALLED= \
- ../bin/qemu-dump-trace \
- ../bin/trace-converter \
- ../bin/covoar \
- ../bin/mkExplanation
-
-all: $(PROGRAMS) ${INSTALL_DIR} $(INSTALLED)
-
-${INSTALL_DIR}:
- test -d ${INSTALL_DIR} || mkdir ${INSTALL_DIR}
-
-# INSTALLED PROGRAMS
-../bin/qemu-dump-trace: qemu-dump-trace ${INSTALL_DIR}
- cp qemu-dump-trace ../bin
-
-../bin/trace-converter: trace-converter ${INSTALL_DIR}
- cp trace-converter ../bin
-
-../bin/covoar: covoar ${INSTALL_DIR}
- cp covoar ../bin
-
-../bin/mkExplanation: mkExplanation ${INSTALL_DIR}
- cp mkExplanation ../bin
-
-# EXECUTABLES
-qemu-dump-trace: qemu-dump-trace.c ${INSTALL_DIR}
- $(CXX) -o $(@) qemu-dump-trace.c
-
-covoar: $(COVOAR_OBJS)
- $(CXX) $(CXXFLAGS) -o $(@) $(COVOAR_OBJS)
-
-trace-converter: $(TRACECONVERTER_OBJS)
- $(CXX) $(CXXFLAGS) -o $(@) $(TRACECONVERTER_OBJS)
-
-configfile-test: $(CONFIGFILE_TEST_OBJS)
- $(CXX) $(CXXFLAGS) -o $(@) $(CONFIGFILE_TEST_OBJS)
-
-# DEPENDENCIES ON SINGLE OBJECTS
-app_common.o: app_common.h app_common.cc
-
-covoar.o: covoar.cc CoverageFactory.h CoverageMap.h DesiredSymbols.h \
- ExecutableInfo.h Explanations.h ObjdumpProcessor.h ReportsBase.h
-
-CoverageFactory.o: CoverageFactory.cc CoverageFactory.h \
- CoverageReaderBase.h CoverageReaderQEMU.h CoverageReaderRTEMS.h \
- CoverageReaderSkyeye.h CoverageReaderTSIM.h \
- CoverageWriterBase.h CoverageWriterRTEMS.h \
- CoverageWriterSkyeye.h CoverageWriterTSIM.h
-CoverageMap.o: CoverageMap.cc CoverageMap.h
-CoverageMapBase.o: CoverageMapBase.cc CoverageMapBase.h
-CoverageRanges.o: CoverageRanges.cc CoverageRanges.h
-CoverageReaderBase.o: CoverageReaderBase.cc CoverageReaderBase.h
-CoverageReaderQEMU.o: CoverageReaderQEMU.cc CoverageReaderQEMU.h \
- ExecutableInfo.h qemu-traces.h
-CoverageReaderRTEMS.o: CoverageReaderRTEMS.cc CoverageReaderRTEMS.h \
- ExecutableInfo.h rtemscov_header.h
-CoverageReaderSkyeye.o: CoverageReaderSkyeye.cc CoverageReaderSkyeye.h \
- ExecutableInfo.h skyeye_header.h
-CoverageReaderTSIM.o: CoverageReaderTSIM.cc CoverageReaderTSIM.h \
- ExecutableInfo.h
-CoverageWriterBase.o: CoverageWriterBase.cc CoverageWriterBase.h
-CoverageWriterRTEMS.o: CoverageWriterRTEMS.cc CoverageWriterRTEMS.h \
- rtemscov_header.h
-CoverageWriterSkyeye.o: CoverageWriterSkyeye.cc CoverageWriterSkyeye.h \
- skyeye_header.h
-CoverageWriterTSIM.o: CoverageWriterTSIM.cc CoverageWriterTSIM.h
-DesiredSymbols.o: DesiredSymbols.cc DesiredSymbols.h CoverageMap.h
-ExecutableInfo.o: ExecutableInfo.cc ExecutableInfo.h CoverageMap.h \
- DesiredSymbols.h SymbolTable.h
-Explanations.o: Explanations.cc Explanations.h
-GcovData.o: GcovData.h GcovData.cc
-GcovFunctionData.o: GcovFunctionData.h GcovFunctionData.cc
-ObjdumpProcessor.o: ObjdumpProcessor.cc ObjdumpProcessor.h ExecutableInfo.h \
- TargetBase.h TargetFactory.h
-ReportsBase.o: ReportsBase.cc ReportsBase.h CoverageRanges.h DesiredSymbols.h \
- Explanations.h ObjdumpProcessor.h
-ReportsHtml.o: ReportsHtml.h ReportsText.cc
-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
-TargetFactory.o: TargetFactory.cc TargetFactory.h TargetBase.h Target_arm.h \
- Target_i386.h Target_lm32.h Target_m68k.h Target_powerpc.h Target_sparc.h
-Target_i386.o: Target_i386.cc Target_i386.h TargetBase.h
-Target_lm32.o: Target_lm32.cc Target_lm32.h TargetBase.h
-Target_m68k.o: Target_m68k.cc Target_m68k.h TargetBase.h
-Target_powerpc.o: Target_powerpc.cc Target_powerpc.h TargetBase.h
-Target_sparc.o: Target_sparc.cc Target_sparc.h TargetBase.h
-
-TraceConverter.o: TraceConverter.cc TraceReaderBase.h TraceList.h
-TraceList.o: TraceList.cc TraceList.h
-TraceReaderBase.o: TraceReaderBase.cc TraceReaderBase.h TraceList.h
-TraceReaderLogQEMU.o: TraceReaderLogQEMU.cc TraceReaderLogQEMU.h TraceReaderBase.h TraceList.h
-TraceWriterBase.o: TraceWriterBase.cc TraceWriterBase.h
-TraceWriterQEMU.o: TraceWriterQEMU.cc TraceWriterQEMU.h TraceWriterBase.h TraceReaderLogQEMU.h TraceList.h
-
-clean:
- rm -rf $(PROGRAMS) *.o doxy html latex *.exe *~ warnings.log
-
-doxygen:
- doxygen Doxyfile
-
-install: ${INSTALLED}
diff --git a/covoar/ObjdumpProcessor.cc b/covoar/ObjdumpProcessor.cc
deleted file mode 100644
index 486c720..0000000
--- a/covoar/ObjdumpProcessor.cc
+++ /dev/null
@@ -1,465 +0,0 @@
-/*! @file ObjdumpProcessor.cc
- * @brief ObjdumpProcessor Implementation
- *
- * This file contains the implementation of the functions supporting
- * the reading of an objdump output file and adding nops to a
- * coverage map.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <algorithm>
-#include <string>
-
-#include "app_common.h"
-#include "ObjdumpProcessor.h"
-#include "CoverageMap.h"
-#include "ExecutableInfo.h"
-#include "SymbolTable.h"
-#include "TargetFactory.h"
-
-namespace Coverage {
-
- void finalizeSymbol(
- ExecutableInfo* const executableInfo,
- std::string& symbolName,
- uint32_t lowAddress,
- uint32_t highAddress,
- ObjdumpProcessor::objdumpLines_t instructions
- ) {
-
- CoverageMapBase* aCoverageMap = NULL;
- uint32_t endAddress = highAddress;
- ObjdumpProcessor::objdumpLines_t::iterator itr, fnop, lnop;
- ObjdumpProcessor::objdumpLines_t::reverse_iterator ritr;
- SymbolInformation* symbolInfo = NULL;
- SymbolTable* theSymbolTable;
-
- //
- // Remove trailing nop instructions.
- //
-
- // First find the last instruction.
- for (ritr = instructions.rbegin();
- ritr != instructions.rend();
- ritr++) {
- if (ritr->isInstruction)
- break;
- }
-
- // If an instruction was found and it is a nop, ...
- if ((ritr != instructions.rend()) && (ritr->isNop)) {
-
- // save it as the last nop. Note that we must account for
- // the difference between a forward and a reverse iterator.
- lnop = ritr.base();
- lnop--;
- endAddress -= lnop->nopSize;
-
- // Now look for the first nop in the sequence of trailing nops.
- fnop = lnop;
- ritr++;
- for (; ritr != instructions.rend(); ritr++) {
- if (ritr->isNop) {
- fnop = ritr.base();
- fnop--;
- endAddress -= fnop->nopSize;
- }
- else
- break;
- }
-
- // Erase trailing nops. The erase operation wants the first
- // parameter to point to the first item to erase and the second
- // parameter to point to the item beyond the last item to erase.
- if ( fnop == lnop )
- instructions.erase( fnop );
- else
- instructions.erase( fnop, ++lnop );
- }
-
- // If there are NOT already saved instructions, save them.
- symbolInfo = SymbolsToAnalyze->find( symbolName );
- if (symbolInfo->instructions.empty()) {
- symbolInfo->sourceFile = executableInfo;
- symbolInfo->baseAddress = lowAddress;
- symbolInfo->instructions = instructions;
- }
-
- // Add the symbol to this executable's symbol table.
- theSymbolTable = executableInfo->getSymbolTable();
- theSymbolTable->addSymbol(
- symbolName, lowAddress, endAddress - lowAddress + 1
- );
-
- // Create a coverage map for the symbol.
- aCoverageMap = executableInfo->createCoverageMap(
- symbolName, lowAddress, endAddress
- );
-
- if (aCoverageMap) {
-
- // Mark the start of each instruction in the coverage map.
- for (itr = instructions.begin();
- itr != instructions.end();
- itr++ ) {
-
- aCoverageMap->setIsStartOfInstruction( itr->address );
- }
-
- // Create a unified coverage map for the symbol.
- SymbolsToAnalyze->createCoverageMap(
- symbolName, endAddress - lowAddress + 1
- );
- }
- }
-
- ObjdumpProcessor::ObjdumpProcessor()
- {
- }
-
- ObjdumpProcessor::~ObjdumpProcessor()
- {
- }
-
- uint32_t ObjdumpProcessor::determineLoadAddress(
- ExecutableInfo* theExecutable
- )
- {
- #define METHOD "ERROR: ObjdumpProcessor::determineLoadAddress - "
- FILE* loadAddressFile = NULL;
- char* cStatus;
- uint32_t offset;
-
- // This method should only be call for a dynamic library.
- if (!theExecutable->hasDynamicLibrary())
- return 0;
-
- std::string dlinfoName = theExecutable->getFileName();
- uint32_t address;
- char inLibName[128];
- std::string Library = theExecutable->getLibraryName();
-
- dlinfoName += ".dlinfo";
- // Read load address.
- loadAddressFile = fopen( dlinfoName.c_str(), "r" );
- if (!loadAddressFile) {
- fprintf( stderr, METHOD "unable to open %s\n", dlinfoName.c_str() );
- exit( -1 );
- }
-
- // Process the dlinfo file.
- while ( 1 ) {
-
- // Get a line.
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, loadAddressFile );
- if (cStatus == NULL) {
- fprintf(
- stderr,
- METHOD "library %s not found in %s\n",
- Library.c_str(),
- dlinfoName.c_str()
- );
- fclose( loadAddressFile );
- exit( -1 );
- }
- sscanf( inputBuffer, "%s %x", inLibName, &offset );
- std::string tmp = inLibName;
- if ( tmp.find( Library ) != tmp.npos ) {
- // fprintf( stderr, "%s - 0x%08x\n", inLibName, offset );
- address = offset;
- break;
- }
- }
-
- fclose( loadAddressFile );
- return address;
-
- #undef METHOD
- }
-
- bool ObjdumpProcessor::IsBranch(
- const char *instruction
- )
- {
- if ( !TargetInfo ) {
- fprintf(
- stderr,
- "ERROR: ObjdumpProcessor::IsBranch - unknown architecture\n"
- );
- assert(0);
- return false;
- }
-
- return TargetInfo->isBranch( instruction );
- }
-
- bool ObjdumpProcessor::isBranchLine(
- const char* const line
- )
- {
- if ( !TargetInfo ) {
- fprintf(
- stderr,
- "ERROR: ObjdumpProcessor::isBranchLine - unknown architecture\n"
- );
- assert(0);
- return false;
- }
-
- return TargetInfo->isBranchLine( line );
- }
-
- bool ObjdumpProcessor::isNop(
- const char* const line,
- int& size
- )
- {
- if ( !TargetInfo ){
- fprintf(
- stderr,
- "ERROR: ObjdumpProcessor::isNop - unknown architecture\n"
- );
- assert(0);
- return false;
- }
-
- return TargetInfo->isNopLine( line, size );
- }
-
- FILE* ObjdumpProcessor::getFile( std::string fileName )
- {
- char dumpFile[128];
- FILE* objdumpFile;
- char buffer[ 512 ];
- int status;
-
- sprintf( dumpFile, "%s.dmp", fileName.c_str() );
-
- // Generate the objdump.
- if (FileIsNewer( fileName.c_str(), dumpFile )) {
- sprintf(
- buffer,
- "%s -Cda --section=.text --source %s | sed -e \'s/ *$//\' >%s",
- TargetInfo->getObjdump(),
- fileName.c_str(),
- dumpFile
- );
-
- status = system( buffer );
- if (status) {
- fprintf(
- stderr,
- "ERROR: ObjdumpProcessor::getFile - command (%s) failed with %d\n",
- buffer,
- status
- );
- exit( -1 );
- }
- }
-
- // Open the objdump file.
- objdumpFile = fopen( dumpFile, "r" );
- if (!objdumpFile) {
- fprintf(
- stderr,
- "ERROR: ObjdumpProcessor::getFile - unable to open %s\n",
- dumpFile
- );
- exit(-1);
- }
-
- return objdumpFile;
- }
-
- uint32_t ObjdumpProcessor::getAddressAfter( uint32_t address )
- {
- objdumpFile_t::iterator itr;
-
- itr = find ( objdumpList.begin(), objdumpList.end(), address );
- if (itr == objdumpList.end()) {
- return 0;
- }
-
- itr++;
- if (itr == objdumpList.end()) {
- return 0;
- }
-
- return (*itr);
-
- }
-
- void ObjdumpProcessor::loadAddressTable (
- ExecutableInfo* const executableInformation
- )
- {
- char* cStatus;
- int items;
- FILE* objdumpFile;
- uint32_t offset;
- char terminator;
-
- // Obtain the objdump file.
- if (!executableInformation->hasDynamicLibrary())
- objdumpFile = getFile( executableInformation->getFileName() );
- else
- objdumpFile = getFile( executableInformation->getLibraryName() );
-
- // Process all lines from the objdump file.
- while ( 1 ) {
-
- // Get the line.
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, objdumpFile );
- if (cStatus == NULL) {
- break;
- }
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
-
- // See if it is the dump of an instruction.
- items = sscanf(
- inputBuffer,
- "%x%c",
- &offset, &terminator
- );
-
- // If it looks like an instruction ...
- if ((items == 2) && (terminator == ':')){
- objdumpList.push_back(
- executableInformation->getLoadAddress() + offset
- );
- }
- }
- }
-
- void ObjdumpProcessor::load(
- ExecutableInfo* const executableInformation
- )
- {
- char* cStatus;
- std::string currentSymbol = "";
- uint32_t endAddress;
- uint32_t instructionOffset;
- int items;
- objdumpLine_t lineInfo;
- FILE* objdumpFile;
- uint32_t offset;
- bool processSymbol = false;
- uint32_t startAddress = 0;
- char symbol[ MAX_LINE_LENGTH ];
- char terminator1;
- char terminator2;
- objdumpLines_t theInstructions;
-
- // Obtain the objdump file.
- if (!executableInformation->hasDynamicLibrary())
- objdumpFile = getFile( executableInformation->getFileName() );
- else
- objdumpFile = getFile( executableInformation->getLibraryName() );
-
- // Process all lines from the objdump file.
- while ( 1 ) {
-
- // Get the line.
- cStatus = fgets( inputBuffer, MAX_LINE_LENGTH, objdumpFile );
- if (cStatus == NULL) {
-
- // If we are currently processing a symbol, finalize it.
- if (processSymbol) {
- finalizeSymbol(
- executableInformation,
- currentSymbol,
- startAddress,
- executableInformation->getLoadAddress() + offset,
- theInstructions
- );
- fprintf(
- stderr,
- "WARNING: ObjdumpProcessor::load - analysis of symbol %s \n"
- " may be incorrect. It was the last symbol in %s\n"
- " and the length of its last instruction is assumed "
- " to be one.\n",
- currentSymbol.c_str(),
- executableInformation->getFileName().c_str()
- );
- }
- break;
- }
-
- inputBuffer[ strlen(inputBuffer) - 1] = '\0';
-
- lineInfo.line = inputBuffer;
- lineInfo.address = 0xffffffff;
- lineInfo.isInstruction = false;
- lineInfo.isNop = false;
- lineInfo.nopSize = 0;
- lineInfo.isBranch = false;
-
- // Look for the start of a symbol's objdump and extract
- // offset and symbol (i.e. offset <symbolname>:).
- items = sscanf(
- inputBuffer,
- "%x <%[^>]>%c",
- &offset, symbol, &terminator1
- );
-
- // If all items found, we are at the beginning of a symbol's objdump.
- if ((items == 3) && (terminator1 == ':')) {
-
- endAddress = executableInformation->getLoadAddress() + offset - 1;
-
- // If we are currently processing a symbol, finalize it.
- if (processSymbol) {
- finalizeSymbol(
- executableInformation,
- currentSymbol,
- startAddress,
- endAddress,
- theInstructions
- );
- }
-
- // Start processing of a new symbol.
- startAddress = 0;
- currentSymbol = "";
- processSymbol = false;
- theInstructions.clear();
-
- // See if the new symbol is one that we care about.
- if (SymbolsToAnalyze->isDesired( symbol )) {
- startAddress = executableInformation->getLoadAddress() + offset;
- currentSymbol = symbol;
- processSymbol = true;
- theInstructions.push_back( lineInfo );
- }
- }
-
- else if (processSymbol) {
-
- // See if it is the dump of an instruction.
- items = sscanf(
- inputBuffer,
- "%x%c\t%*[^\t]%c",
- &instructionOffset, &terminator1, &terminator2
- );
-
- // If it looks like an instruction ...
- if ((items == 3) && (terminator1 == ':') && (terminator2 == '\t')) {
-
- // update the line's information, save it and ...
- lineInfo.address =
- executableInformation->getLoadAddress() + instructionOffset;
- lineInfo.isInstruction = true;
- lineInfo.isNop = isNop( inputBuffer, lineInfo.nopSize );
- lineInfo.isBranch = isBranchLine( inputBuffer );
- }
-
- // Always save the line.
- theInstructions.push_back( lineInfo );
- }
- }
- }
-}
diff --git a/covoar/ObjdumpProcessor.h b/covoar/ObjdumpProcessor.h
deleted file mode 100644
index 283ac73..0000000
--- a/covoar/ObjdumpProcessor.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*! @file ObjdumpProcessor.h
- * @brief ObjdumpProcessor Specification
- *
- * This file contains the specification of the ObjdumpProcessor class.
- */
-
-#ifndef __OBJDUMP_PROCESSOR_H__
-#define __OBJDUMP_PROCESSOR_H__
-
-#include <list>
-#include <string>
-
-#include "ExecutableInfo.h"
-#include "TargetBase.h"
-
-namespace Coverage {
-
- /*! @class ObjdumpProcessor
- *
- * This class implements the functionality which reads the output of
- * an objdump. Various information is extracted from the objdump line
- * to support analysis and report writing. Analysis of the objdump line
- * also allows for identification of "nops". For the purpose of coverage
- * analysis, nops in the executable may be ignored. Compilers often
- * produce nops to align functions on particular alignment boundaries
- * and the nop between functions can not possibly be executed.
- */
- class ObjdumpProcessor {
-
- public:
-
- /*!
- * This type defines the elements of an objdump line.
- */
- typedef struct {
- /*!
- * This member variable contains the actual line from the object dump.
- */
- std::string line;
-
- /*!
- * This member variable contains the address from the object dump line.
- */
- uint32_t address;
-
- /*!
- * This member variable contains an indication of whether the line
- * is an instruction.
- */
- bool isInstruction;
-
- /*!
- * This member variable contains an indication of whether the line
- * is a nop instruction.
- */
- bool isNop;
-
- /*!
- * This member variable contains the size of the nop instruction.
- */
- int nopSize;
-
- /*!
- * This member variable contains an indication of whether the line
- * is a branch instruction.
- */
- bool isBranch;
-
- } objdumpLine_t;
-
- /*!
- * This object defines a list of object dump lines
- * for a file.
- */
- typedef std::list<objdumpLine_t> objdumpLines_t;
-
-
- /*!
- * This object defines a list of instruction addresses
- * that will be extracted from the objdump file.
- */
- typedef std::list<uint32_t> objdumpFile_t;
-
- /*!
- * This method constructs an ObjdumpProcessor instance.
- */
- ObjdumpProcessor();
-
- /*!
- * This method destructs an ObjdumpProcessor instance.
- */
- virtual ~ObjdumpProcessor();
-
- uint32_t determineLoadAddress(
- ExecutableInfo* theExecutable
- );
-
- /*!
- * This method returns a file pointer to the objdump file
- * for the given file name.
- */
- FILE* getFile( std::string fileName );
-
- /*!
- * This method fills the objdumpList list with all the
- * instruction addresses in the object dump file.
- */
- void loadAddressTable (
- ExecutableInfo* const executableInformation
- );
-
- /*!
- * This method generates and processes an object dump for
- * the specified executable.
- */
- void load(
- ExecutableInfo* const executableInformation
- );
-
- /*!
- * This method returns the next address in othe objdumpList.
- */
- uint32_t getAddressAfter( uint32_t address );
-
- /*!
- * This method returns true if the instrucation is
- * an instruction that results in a code branch, otherwise
- * it returns false.
- */
- bool IsBranch( const char *instruction );
-
- /*!
- * This method returns true if the instruction from
- * the given line in the objdmp file is a branch instruction,
- * otherwise it returns false.
- */
- bool isBranchLine(
- const char* const line
- );
-
- private:
-
- /*!
- * This variable consists of a list of all instruction addresses
- * extracted from the obj dump file.
- */
- objdumpFile_t objdumpList;
-
- /*!
- * This method determines whether the specified line is a
- * nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNop(
- const char* const line,
- int& size
- );
-
- };
-}
-#endif
diff --git a/covoar/ReportsBase.cc b/covoar/ReportsBase.cc
deleted file mode 100644
index d401bdd..0000000
--- a/covoar/ReportsBase.cc
+++ /dev/null
@@ -1,578 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include "ReportsBase.h"
-#include "app_common.h"
-#include "CoverageRanges.h"
-#include "DesiredSymbols.h"
-#include "Explanations.h"
-#include "ObjdumpProcessor.h"
-
-#include "ReportsText.h"
-#include "ReportsHtml.h"
-
-namespace Coverage {
-
-ReportsBase::ReportsBase( time_t timestamp ):
- reportExtension_m(""),
- timestamp_m( timestamp )
-{
-}
-
-ReportsBase::~ReportsBase()
-{
-}
-
-FILE* ReportsBase::OpenFile(
- const char* const fileName
-)
-{
- int sc;
- FILE *aFile;
- std::string file;
-
- // Create the output directory if it does not already exist
- sc = mkdir( outputDirectory,0755 );
- if ( (sc == -1) && (errno != EEXIST) ) {
- fprintf(stderr, "Unable to create output directory %s\n", outputDirectory);
- return NULL;
- }
-
- file = outputDirectory;
- file += "/";
- file += fileName;
-
- // Open the file.
- aFile = fopen( file.c_str(), "w" );
- if ( !aFile ) {
- fprintf( stderr, "Unable to open %s\n", file.c_str() );
- }
- return aFile;
-}
-
-void ReportsBase::WriteIndex(
- const char* const fileName
-)
-{
-}
-
-FILE* ReportsBase::OpenAnnotatedFile(
- const char* const fileName
-)
-{
- return OpenFile(fileName);
-}
-
-FILE* ReportsBase::OpenBranchFile(
- const char* const fileName,
- bool hasBranches
-)
-{
- return OpenFile(fileName);
-}
-
-FILE* ReportsBase::OpenCoverageFile(
- const char* const fileName
-)
-{
- return OpenFile(fileName);
-}
-
-FILE* ReportsBase::OpenNoRangeFile(
- const char* const fileName
-)
-{
- return OpenFile(fileName);
-}
-
-
-FILE* ReportsBase::OpenSizeFile(
- const char* const fileName
-)
-{
- return OpenFile(fileName);
-}
-
-FILE* ReportsBase::OpenSymbolSummaryFile(
- 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,
- bool hasBranches
-)
-{
- CloseFile( aFile );
-}
-
-void ReportsBase::CloseCoverageFile(
- FILE* aFile
-)
-{
- CloseFile( aFile );
-}
-
-void ReportsBase::CloseNoRangeFile(
- FILE* aFile
-)
-{
- CloseFile( aFile );
-}
-
-void ReportsBase::CloseSizeFile(
- FILE* aFile
-)
-{
- CloseFile( aFile );
-}
-
-void ReportsBase::CloseSymbolSummaryFile(
- FILE* aFile
-)
-{
- CloseFile( aFile );
-}
-
-/*
- * Write annotated report
- */
-void ReportsBase::WriteAnnotatedReport(
- const char* const fileName
-) {
- FILE* aFile = NULL;
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
- Coverage::CoverageRanges* theBranches;
- Coverage::CoverageRanges* theRanges;
- Coverage::CoverageMapBase* theCoverageMap = NULL;
- uint32_t bAddress = 0;
- AnnotatedLineState_t state;
- std::list<Coverage::ObjdumpProcessor::objdumpLine_t>* theInstructions;
- std::list<Coverage::ObjdumpProcessor::objdumpLine_t>::iterator itr;
-
- 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);
- theRanges = ditr->second.uncoveredRanges;
- theBranches = ditr->second.uncoveredBranches;
-
- // Add annotations to each line where necessary
- AnnotatedStart( aFile );
- for (itr = theInstructions->begin();
- itr != theInstructions->end();
- itr++ ) {
-
- uint32_t id = 0;
- std::string annotation = "";
- std::string line;
- char textLine[150];
-
- state = A_SOURCE;
-
- if ( itr->isInstruction ) {
- if (!theCoverageMap->wasExecuted( itr->address - bAddress )){
- annotation = "<== NOT EXECUTED";
- state = A_NEVER_EXECUTED;
- id = theRanges->getId( itr->address );
- } else if (theCoverageMap->isBranch( itr->address - bAddress )) {
- id = theBranches->getId( itr->address );
- if (theCoverageMap->wasAlwaysTaken( itr->address - bAddress )){
- annotation = "<== ALWAYS TAKEN";
- state = A_BRANCH_TAKEN;
- } else if (theCoverageMap->wasNeverTaken( itr->address - bAddress )){
- annotation = "<== NEVER TAKEN";
- state = A_BRANCH_NOT_TAKEN;
- }
- } else {
- state = A_EXECUTED;
- }
- }
-
- sprintf( textLine, "%-70s", itr->line.c_str() );
- line = textLine + annotation;
-
- PutAnnotatedLine( aFile, state, line, id);
- }
-
- AnnotatedEnd( aFile );
- }
-
- 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;
- unsigned int count;
- bool hasBranches = true;
-
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
- (BranchInfoAvailable == false) )
- hasBranches = false;
-
- // Open the branch report file
- report = OpenBranchFile( fileName, hasBranches );
- if (!report)
- return;
-
- // If no branches were found of branch coverage is not supported
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
- (BranchInfoAvailable == false) ) {
-
- PutNoBranchInfo(report);
-
- // If branches were found, ...
- } else {
-
- // Process uncovered branches for each symbol.
- count = 0;
- 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++ ) {
- count++;
- PutBranchEntry( report, count, ditr, ritr );
- }
- }
- }
- }
-
- CloseBranchFile( report, hasBranches );
-}
-
-/*
- * 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;
- unsigned int count;
- FILE* NoRangeFile;
- std::string NoRangeName;
-
- // Open special file that captures NoRange informaiton
- NoRangeName = "no_range_";
- NoRangeName += fileName;
- NoRangeFile = OpenNoRangeFile ( NoRangeName.c_str() );
- if (!NoRangeFile) {
- return;
- }
-
- // Open the coverage report file.
- report = OpenCoverageFile( fileName );
- if ( !report ) {
- return;
- }
-
- // Process uncovered ranges for each symbol.
- count = 0;
- 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, NoRangeFile, count, ditr->first );
- count++;
- } else if (!theRanges->set.empty()) {
-
- for (ritr = theRanges->set.begin() ;
- ritr != theRanges->set.end() ;
- ritr++ ) {
- PutCoverageLine( report, count, ditr, ritr );
- count++;
- }
- }
- }
-
- CloseNoRangeFile( NoRangeFile );
- CloseCoverageFile( 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;
- unsigned int count;
-
- // Open the report file.
- report = OpenSizeFile( fileName );
- if ( !report ) {
- return;
- }
-
- // Process uncovered ranges for each symbol.
- count = 0;
- 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, count, ditr, ritr );
- count++;
- }
- }
- }
-
- CloseSizeFile( report );
-}
-
-void ReportsBase::WriteSymbolSummaryReport(
- const char* const fileName
-)
-{
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr;
- FILE* report;
- unsigned int count;
-
- // Open the report file.
- report = OpenSymbolSummaryFile( fileName );
- if ( !report ) {
- return;
- }
-
- // Process each symbol.
- count = 0;
- for (ditr = SymbolsToAnalyze->set.begin();
- ditr != SymbolsToAnalyze->set.end();
- ditr++) {
-
- PutSymbolSummaryLine( report, count, ditr );
- count++;
- }
-
- CloseSymbolSummaryFile( report );
-}
-
-void ReportsBase::WriteSummaryReport(
- const char* const fileName
-)
-{
- // Calculate coverage statistics and output results.
- uint32_t a;
- uint32_t endAddress;
- Coverage::DesiredSymbols::symbolSet_t::iterator itr;
- uint32_t notExecuted = 0;
- double percentage;
- Coverage::CoverageMapBase* theCoverageMap;
- uint32_t totalBytes = 0;
- FILE* report;
-
- // Open the report file.
- report = OpenFile( fileName );
- if ( !report ) {
- return;
- }
-
- // Look at each symbol.
- for (itr = SymbolsToAnalyze->set.begin();
- itr != SymbolsToAnalyze->set.end();
- itr++) {
-
- // If the symbol's unified coverage map exists, scan through it
- // and count bytes.
- theCoverageMap = itr->second.unifiedCoverageMap;
- if (theCoverageMap) {
-
- endAddress = itr->second.stats.sizeInBytes - 1;
-
- for (a = 0; a <= endAddress; a++) {
- totalBytes++;
- if (!theCoverageMap->wasExecuted( a ))
- notExecuted++;
- }
- }
- }
-
- percentage = (double) notExecuted;
- percentage /= (double) totalBytes;
- percentage *= 100.0;
-
- fprintf( report, "Bytes Analyzed : %d\n", totalBytes );
- fprintf( report, "Bytes Not Executed : %d\n", notExecuted );
- fprintf( report, "Percentage Executed : %5.4g\n", 100.0 - percentage );
- fprintf( report, "Percentage Not Executed : %5.4g\n", percentage );
- fprintf(
- report,
- "Uncovered ranges found : %d\n",
- SymbolsToAnalyze->getNumberUncoveredRanges()
- );
- if ((SymbolsToAnalyze->getNumberBranchesFound() == 0) ||
- (BranchInfoAvailable == false) ) {
- fprintf( report, "No branch information available\n" );
- } else {
- fprintf(
- report,
- "Total branches found : %d\n",
- SymbolsToAnalyze->getNumberBranchesFound()
- );
- fprintf(
- report,
- "Uncovered branches found : %d\n",
- SymbolsToAnalyze->getNumberBranchesAlwaysTaken() +
- SymbolsToAnalyze->getNumberBranchesNeverTaken()
- );
- fprintf(
- report,
- " %d branches always taken\n",
- SymbolsToAnalyze->getNumberBranchesAlwaysTaken()
- );
- fprintf(
- report,
- " %d branches never taken\n",
- SymbolsToAnalyze->getNumberBranchesNeverTaken()
- );
- }
-}
-
-void GenerateReports()
-{
- typedef std::list<ReportsBase *> reportList_t;
-
- reportList_t reportList;
- reportList_t::iterator ritr;
- std::string reportName;
- ReportsBase* reports;
-
- time_t timestamp;
-
-
- timestamp = time(NULL); /* get current cal time */
- reports = new ReportsText(timestamp);
- reportList.push_back(reports);
- reports = new ReportsHtml(timestamp);
- reportList.push_back(reports);
-
- for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
- reports = *ritr;
-
- reportName = "index" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteIndex( reportName.c_str() );
-
- reportName = "annotated" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteAnnotatedReport( reportName.c_str() );
-
- reportName = "branch" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteBranchReport(reportName.c_str() );
-
- reportName = "uncovered" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteCoverageReport(reportName.c_str() );
-
- reportName = "sizes" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteSizeReport(reportName.c_str() );
-
- reportName = "symbolSummary" + reports->ReportExtension();
- if (Verbose)
- fprintf(
- stderr, "Generate %s\n", reportName.c_str()
- );
- reports->WriteSymbolSummaryReport(reportName.c_str() );
- }
-
- for (ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
- reports = *ritr;
- delete reports;
- }
-
- ReportsBase::WriteSummaryReport( "summary.txt" );
-}
-
-}
diff --git a/covoar/ReportsBase.h b/covoar/ReportsBase.h
deleted file mode 100644
index 7e28fd8..0000000
--- a/covoar/ReportsBase.h
+++ /dev/null
@@ -1,398 +0,0 @@
-/*! @file ReportsBase.h
- * @brief Reports Base Class 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 <time.h>
-#include "DesiredSymbols.h"
-
-namespace Coverage {
-
-/*!
- * This class contains the base information to create a report
- * set. The report set may be text based, html based or some
- * other format to be defined at a future time.
- */
-class ReportsBase {
-
- public:
- ReportsBase( time_t timestamp );
- virtual ~ReportsBase();
-
- /*!
- * This method produces an index of the reports generated.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual void WriteIndex(
- const char* const fileName
- );
-
- /*!
- * 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 report file name
- */
- void WriteSizeReport(
- const char* const fileName
- );
-
- /*!
- * This method produces a summary report that lists information on
- * each symbol which did not achieve 100% coverage
- *
- * @param[in] fileName identifies the report file name
- */
- void WriteSymbolSummaryReport(
- const char* const fileName
- );
-
- /*!
- * This method produces a sumary report for the overall test run.
- */
- static void WriteSummaryReport(
- const char* const fileName
- );
-
- /*!
- * This method returns the unique extension for the Report
- * type. If the extension is ".txt" files will be
- * named "annotated.txt", "branch.txt" ......
- */
- std::string ReportExtension() { return reportExtension_m; }
-
- protected:
-
- /*!
- * This type is used to track a state during the annotated output.
- */
- typedef enum {
- A_SOURCE,
- A_EXECUTED,
- A_NEVER_EXECUTED,
- A_BRANCH_TAKEN,
- A_BRANCH_NOT_TAKEN
- } AnnotatedLineState_t;
-
- /*!
- * This member variable contains the extension used for all reports.
- */
- std::string reportExtension_m;
-
- /*!
- * This member variable contains the timestamp for the report.
- */
- time_t timestamp_m;
-
- /*!
- * This method Opens a report file and verifies that it opened
- * correctly. Upon failure NULL is returned.
- *
- * @param[in] fileName identifies the report file name
- */
- static FILE* OpenFile(
- const char* const fileName
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appedns any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual FILE* OpenAnnotatedFile(
- const char* const fileName
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appedns any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- * @param[in] hasBranches indicates if there are branches to report
- */
- virtual FILE* OpenBranchFile(
- const char* const fileName,
- bool hasBranches
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appedns any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual FILE* OpenCoverageFile(
- const char* const fileName
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appends any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual FILE* OpenNoRangeFile(
- const char* const fileName
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appedns any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual FILE* OpenSizeFile(
- const char* const fileName
- );
-
- /*!
- * This method opens a report file and verifies that it opened.
- * Then appedns any necessary header information onto the file.
- *
- * @param[in] fileName identifies the report file name
- */
- virtual FILE* OpenSymbolSummaryFile(
- const char* const fileName
- );
-
- /*!
- * This method Closes a report file.
- *
- * @param[in] aFile identifies the report file name
- */
- static void CloseFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void CloseAnnotatedFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- * @param[in] hasBranches indicates if there are branches to report
- */
- virtual void CloseBranchFile(
- FILE* aFile,
- bool hasBranches
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void CloseCoverageFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- */
- void CloseNoRangeFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void CloseSizeFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void CloseSymbolSummaryFile(
- FILE* aFile
- );
-
- /*!
- * This method puts any necessary a line of annotated
- * data into the file.
- *
- * @param[in] aFile identifies the report file name
- * @param[in] state identifies the state machine state
- * @param[in] line identifies the string to print
- * @param[in] id identifies the branch or range id.
- */
- virtual void PutAnnotatedLine(
- FILE* aFile,
- AnnotatedLineState_t state,
- std::string line,
- uint32_t id
- )=0;
-
- /*!
- * This method puts any necessary header information in
- * front of an annotated section.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void AnnotatedStart(
- FILE* aFile
- )=0;
-
- /*!
- * This method puts any necessary footer information in
- * front of an annotated section.
- *
- * @param[in] aFile identifies the report file name
- */
- virtual void AnnotatedEnd(
- FILE* aFile
- )=0;
-
-
- /*!
- * This method puts any necessary footer information into
- * the report then closes the file.
- *
- * @param[in] report identifies the report file name
- */
- virtual bool PutNoBranchInfo(
- FILE* report
- ) = 0;
-
- /*!
- * This method puts a branch entry into the branch report.
- *
- * @param[in] report identifies the report file name
- * @param[in] number identifies the line number.
- * @param[in] symbolPtr is a pointer to the symbol information
- * @param[in] rangePtr is a pointer to the range information.
- */
- virtual bool PutBranchEntry(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
- Coverage::CoverageRanges::ranges_t::iterator rangePtr
- )=0;
-
- /*!
- * This method reports when no range is available for
- * a symbol in the coverage report.
- *
- * @param[in] report identifies the report file name
- * @param[in] number identifies the line number.
- * @param[in] symbol is a pointer to the symbol information
- */
- virtual void putCoverageNoRange(
- FILE* report,
- FILE* noRangeFile,
- unsigned int number,
- std::string symbol
- )=0;
-
- /*!
- * This method puts a line in the coverage report.
- *
- * @param[in] report identifies the report file name
- * @param[in] number identifies the line number.
- * @param[in] ditr is a iterator to the symbol information
- * @param[in] ritr is a iterator to the range information.
- */
- virtual bool PutCoverageLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
- Coverage::CoverageRanges::ranges_t::iterator ritr
- )=0;
-
- /*!
- * This method method puts a line into the size report.
- *
- * @param[in] report identifies the size report file name
- * @param[in] number identifies the line number.
- * @param[in] symbol is a pointer to the symbol information
- * @param[in] range is a iterator to the range information.
- */
- virtual bool PutSizeLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
- Coverage::CoverageRanges::ranges_t::iterator range
- )=0;
-
- /*!
- * This method method puts a line into the symbol summary report.
- *
- * @param[in] report identifies the report file name
- * @param[in] number identifies the line number.
- * @param[in] symbol is a pointer to the symbol information
- */
- virtual bool PutSymbolSummaryLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol
- )=0;
-};
-
-/*!
- * This method iterates over all report set types and generates
- * all reports.
- */
-void GenerateReports();
-
-}
-
-#endif
diff --git a/covoar/ReportsHtml.cc b/covoar/ReportsHtml.cc
deleted file mode 100644
index 101c76b..0000000
--- a/covoar/ReportsHtml.cc
+++ /dev/null
@@ -1,1057 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "ReportsHtml.h"
-#include "app_common.h"
-#include "CoverageRanges.h"
-#include "DesiredSymbols.h"
-#include "ObjdumpProcessor.h"
-
-#if 0
-#define TABLE_HEADER_CLASS \
- " table-autopage:10 table-page-number:pagenum table-page-count:pages "
-#define TABLE_FOOTER \
- "<tfoot>\n" \
- "<tr>\n" \
- "<td class=\"table-page:previous\" " \
- "style=\"cursor:pointer;\">&lt; &lt; Previous</td>\n" \
- "<td colspan=\"4\" style=\"text-align:center;\">Page " \
- "<span id=\"pagenum\"></span>&nbsp;of <span id=\"pages\"></span></td>\n" \
- "<td class=\"table-page:next\" " \
- "style=\"cursor:pointer;\">Next &gt; &gt;</td>\n" \
- "</tr>\n" \
- "</tfoot>\n"
-#else
-#define TABLE_HEADER_CLASS
-#define TABLE_FOOTER
-#endif
-
-namespace Coverage {
-
- ReportsHtml::ReportsHtml( time_t timestamp ):
- ReportsBase( timestamp )
- {
- reportExtension_m = ".html";
- }
-
- ReportsHtml::~ReportsHtml()
- {
- }
-
- void ReportsHtml::WriteIndex(
- const char* const fileName
- )
- {
- #define PRINT_ITEM( _t, _n ) \
- fprintf( \
- aFile, \
- "<li>%s (<a href=\"%s.html\">html</a> or "\
- "<a href=\"%s.txt\">text</a>)</li>\n", \
- _t, _n, _n );
- #define PRINT_TEXT_ITEM( _t, _n ) \
- fprintf( \
- aFile, \
- "<li>%s (<a href=\"%s\">text</a>)\n", \
- _t, _n );
-
- FILE* aFile;
-
- // Open the file
- aFile = OpenFile( fileName );
-
- fprintf(
- aFile,
- "<title>Index</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Coverage Analysis Reports</div>\n"
- "<div class =\"datetime\">%s</div>\n",
- asctime( localtime(&timestamp_m) )
- );
-
- fprintf( aFile, "<ul>\n" );
-
- PRINT_TEXT_ITEM( "Summary", "summary.txt" );
- PRINT_ITEM( "Coverage Report", "uncovered" );
- PRINT_ITEM( "Branch Report", "branch" );
- PRINT_ITEM( "Annotated Assembly", "annotated" );
- PRINT_ITEM( "Symbol Summary", "symbolSummary" );
- PRINT_ITEM( "Size Report", "sizes" );
-
- PRINT_TEXT_ITEM( "Explanations Not Found", "ExplanationsNotFound.txt" );
-
- fprintf(
- aFile,
- "</li>\n"
- "<!-- INSERT PROJECT SPECIFIC ITEMS HERE -->\n"
- "</html>\n"
- );
-
- CloseFile( aFile );
-
- #undef PRINT_ITEM
- #undef PRINT_TEXT_ITEM
- }
-
- FILE* ReportsHtml::OpenFile(
- const char* const fileName
- )
- {
- FILE* aFile;
-
- // Open the file
- aFile = ReportsBase::OpenFile( fileName );
-
- // Put Header information on the file
- fprintf(
- aFile,
- "<html>\n"
- "<meta http-equiv=\"Content-Language\" content=\"English\" >\n"
- "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=us-ascii\" >\n"
- "<link rel=\"stylesheet\" type=\"text/css\" href=\"covoar.css\" media=\"screen\" >\n"
- "<script type=\"text/javascript\" src=\"table.js\"></script>\n"
- );
-
- return aFile;
- }
-
- FILE* ReportsHtml::OpenAnnotatedFile(
- const char* const fileName
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- fprintf(
- aFile,
- "<title>Annotated Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Annotated Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<pre class=\"code\">\n",
- asctime( localtime(&timestamp_m) )
- );
-
- return aFile;
- }
-
- FILE* ReportsHtml::OpenBranchFile(
- const char* const fileName,
- bool hasBranches
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- if ( hasBranches ) {
- // Put header information into the file
- fprintf(
- aFile,
- "<title>Branch Report</title\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Branch Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Line</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Bytes</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Reason</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Taken</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Not Taken</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Classification</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Explanation</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
- );
- }
-
- return aFile;
- }
-
- FILE* ReportsHtml::OpenCoverageFile(
- const char* const fileName
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- // Put header information into the file
- fprintf(
- aFile,
- "<title>Coverage Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Coverage Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Range</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Bytes</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"left\">Size </br>Instructions</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">Classification</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Explanation</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
-
- );
-
- return aFile;
- }
-
- FILE* ReportsHtml::OpenNoRangeFile(
- const char* const fileName
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- // Put header information into the file
- fprintf(
- aFile,
- "<title> Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "No Range Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
-
- );
-
- return aFile;
- }
-
-
-
- FILE* ReportsHtml::OpenSizeFile(
- const char* const fileName
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- // Put header information into the file
- fprintf(
- aFile,
- "<title>Size Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Size Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:numeric\" align=\"left\">Size</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Symbol</th>\n"
- "<th class=\"table-sortable:default\" align=\"left\">Line</th>\n"
- "<th class=\"table-filterable table-sortable:default\" align=\"left\">File</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
-
- );
- return aFile;
- }
-
- FILE* ReportsHtml::OpenSymbolSummaryFile(
- const char* const fileName
- )
- {
- FILE *aFile;
-
- // Open the file
- aFile = OpenFile(fileName);
-
- // Put header information into the file
- fprintf(
- aFile,
- "<title>Symbol Summary Report</title>\n"
- "<div class=\"heading-title\">"
- );
-
- if (projectName)
- fprintf(
- aFile,
- "%s</br>",
- projectName
- );
-
- fprintf(
- aFile,
- "Symbol Summary Report</div>\n"
- "<div class =\"datetime\">%s</div>\n"
- "<body>\n"
- "<table class=\"covoar table-autosort:0 table-autofilter table-stripeclass:covoar-tr-odd"
- TABLE_HEADER_CLASS "\">\n"
- "<thead>\n"
- "<tr>\n"
- "<th class=\"table-sortable:default\" align=\"center\">Symbol</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Total</br>Size</br>Bytes</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Total</br>Size</br>Instr</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Ranges</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered</br>Size</br>Bytes</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Uncovered</br>Size</br>Instr</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Branches</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Always</br>Taken</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">#</br>Never</br>Taken</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Percent</br>Uncovered</br>Instructions</th>\n"
- "<th class=\"table-sortable:numeric\" align=\"center\">Percent</br>Uncovered</br>Bytes</th>\n"
- "</tr>\n"
- "</thead>\n"
- "<tbody>\n",
- asctime( localtime(&timestamp_m) )
-
- );
- return aFile;
- }
-
- void ReportsHtml::AnnotatedStart(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- "<hr>\n"
- );
- }
-
- void ReportsHtml::AnnotatedEnd(
- FILE* aFile
- )
- {
- }
-
- void ReportsHtml::PutAnnotatedLine(
- FILE* aFile,
- AnnotatedLineState_t state,
- std::string line,
- uint32_t id
- )
- {
- std::string stateText;
- char number[10];
-
-
- sprintf(number,"%d", id);
-
- // Set the stateText based upon the current state.
- switch (state) {
- case A_SOURCE:
- stateText = "</pre>\n<pre class=\"code\">\n";
- break;
- case A_EXECUTED:
- stateText = "</pre>\n<pre class=\"codeExecuted\">\n";
- break;
- case A_NEVER_EXECUTED:
- stateText = "</pre>\n";
- stateText += "<a name=\"range";
- stateText += number;
- stateText += "\"></a><pre class=\"codeNotExecuted\">\n";
- break;
- case A_BRANCH_TAKEN:
- stateText = "</pre>\n";
- stateText += "<a name=\"range";
- stateText += number;
- stateText += "\"></a><pre class=\"codeAlwaysTaken\">\n";
- break;
- case A_BRANCH_NOT_TAKEN:
- stateText = "</pre>\n";
- stateText += "<a name=\"range";
- stateText += number;
- stateText += "\"></a><pre class=\"codeNeverTaken\">\n";
- break;
- default:
- fprintf(stderr, "ERROR: ReportsHtml::PutAnnotatedLine Unknown state\n");
- exit( -1 );
- break;
- }
-
- // If the state has not changed there is no need to change the text block
- // format. If it has changed close out the old format and open up the
- // new format.
- if ( state != lastState_m ) {
- fprintf( aFile, "%s", stateText.c_str() );
- lastState_m = state;
- }
-
- // For all the characters in the line replace html reserved special
- // characters and output the line. Note that for a /pre block this
- // is only a '<' symbol.
- for (unsigned int i=0; i<line.size(); i++ ) {
- if ( line[i] == '<' )
- fprintf( aFile, "&lt;" );
- else
- fprintf( aFile, "%c", line[i] );
- }
- fprintf( aFile, "\n");
- }
-
- bool ReportsHtml::PutNoBranchInfo(
- FILE* report
- )
- {
- if ( BranchInfoAvailable )
- fprintf( report, "All branch paths taken.\n" );
- else
- fprintf( report, "No branch information found.\n" );
- return true;
- }
-
- bool ReportsHtml::PutBranchEntry(
- FILE* report,
- unsigned int count,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
- Coverage::CoverageRanges::ranges_t::iterator rangePtr
- )
- {
- const Coverage::Explanation* explanation;
- std::string temp;
- int i;
- uint32_t bAddress = 0;
- uint32_t lowAddress = 0;
- Coverage::CoverageMapBase* theCoverageMap = NULL;
-
- // Mark the background color different for odd and even lines.
- if ( ( count%2 ) != 0 )
- fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
- else
- fprintf( report, "<tr>\n");
-
- // symbol
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbolPtr->first.c_str()
- );
-
- // line
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%s</td>\n",
- rangePtr->id,
- rangePtr->lowSourceLine.c_str()
- );
-
- // File
- i = rangePtr->lowSourceLine.find(":");
- temp = rangePtr->lowSourceLine.substr (0, i);
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- temp.c_str()
- );
-
- // Size in bytes
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- rangePtr->highAddress - rangePtr->lowAddress + 1
- );
-
- // Reason Branch was uncovered
- if (rangePtr->reason ==
- Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN)
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">Always Taken</td>\n"
- );
- else if (rangePtr->reason ==
- Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN)
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">Never Taken</td>\n"
- );
-
- // Taken / Not taken counts
- lowAddress = rangePtr->lowAddress;
- bAddress = symbolPtr->second.baseAddress;
- theCoverageMap = symbolPtr->second.unifiedCoverageMap;
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- theCoverageMap->getWasTaken( lowAddress - bAddress )
- );
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- theCoverageMap->getWasNotTaken( lowAddress - bAddress )
- );
-
- // See if an explanation is available and write the Classification and
- // the Explination Columns.
- explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
- if ( !explanation ) {
- // Write Classificationditr->second.baseAddress
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
- "<td class=\"covoar-td\" align=\"center\">No Explanation</td>\n"
- );
- } else {
- char explanationFile[48];
- sprintf( explanationFile, "explanation%d.html", rangePtr->id );
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n"
- "<td class=\"covoar-td\" align=\"center\">"
- "<a href=\"%s\">Explanation</a></td>\n",
- explanation->classification.c_str(),
- explanationFile
- );
- WriteExplationFile( explanationFile, explanation );
- }
-
- fprintf( report, "</tr>\n");
-
- return true;
- }
-
- bool ReportsHtml::WriteExplationFile(
- const char* fileName,
- const Coverage::Explanation* explanation
- )
- {
- FILE* report;
-
- report = OpenFile( fileName );
-
- for ( unsigned int i=0 ; i < explanation->explanation.size(); i++) {
- fprintf(
- report,
- "%s\n",
- explanation->explanation[i].c_str()
- );
- }
- CloseFile( report );
- return true;
- }
-
- void ReportsHtml::putCoverageNoRange(
- FILE* report,
- FILE* noRangeFile,
- unsigned int count,
- std::string symbol
- )
- {
- Coverage::Explanation explanation;
-
- explanation.explanation.push_back(
- "<html><p>\n"
- "This symbol was never referenced by an analyzed executable. "
- "Therefore there is no size or disassembly for this symbol. "
- "This could be due to symbol misspelling or lack of a test for "
- "this symbol."
- "</p></html>\n"
- );
-
- // Mark the background color different for odd and even lines.
- if ( ( count%2 ) != 0 ){
- fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
- fprintf( noRangeFile, "<tr class=\"covoar-tr-odd\">\n");
- } else {
- fprintf( report, "<tr>\n");
- fprintf( noRangeFile, "<tr>\n");
- }
-
- // symbol
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbol.c_str()
- );
- fprintf(
- noRangeFile,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbol.c_str()
- );
-
- // starting line
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">unknown</td>\n"
- );
-
- // file
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">unknown</td>\n"
- );
-
- // Size in bytes
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">unknown</td>\n"
- );
-
- // Size in instructions
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">unknown</td>\n"
- );
-
- // See if an explanation is available
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">Unknown</td>\n"
- "<td class=\"covoar-td\" align=\"center\">"
- "<a href=\"NotReferenced.html\">No data</a></td>\n"
- );
- WriteExplationFile( "NotReferenced.html", &explanation );
-
- fprintf( report, "</tr>\n");
- fprintf( noRangeFile, "</tr>\n");
- }
-
- bool ReportsHtml::PutCoverageLine(
- FILE* report,
- unsigned int count,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
- Coverage::CoverageRanges::ranges_t::iterator rangePtr
- )
- {
- const Coverage::Explanation* explanation;
- std::string temp;
- int i;
-
- // Mark the background color different for odd and even lines.
- if ( ( count%2 ) != 0 )
- fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
- else
- fprintf( report, "<tr>\n");
-
- // symbol
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbolPtr->first.c_str()
- );
-
- // Range
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%s </br>%s</td>\n",
- rangePtr->id,
- rangePtr->lowSourceLine.c_str(),
- rangePtr->highSourceLine.c_str()
- );
-
- // File
- i = rangePtr->lowSourceLine.find(":");
- temp = rangePtr->lowSourceLine.substr (0, i);
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- temp.c_str()
- );
-
- // Size in bytes
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- rangePtr->highAddress - rangePtr->lowAddress + 1
- );
-
- // Size in instructions
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- rangePtr->instructionCount
- );
-
- // See if an explanation is available
- explanation = AllExplanations->lookupExplanation( rangePtr->lowSourceLine );
- if ( !explanation ) {
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">NONE</td>\n"
- );
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">No Explanation</td>\n"
- );
- } else {
- char explanationFile[48];
-
- sprintf( explanationFile, "explanation%d.html", rangePtr->id );
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n"
- "<td class=\"covoar-td\" align=\"center\">"
- "<a href=\"%s\">Explanation</a></td>\n",
- explanation->classification.c_str(),
- explanationFile
- );
- WriteExplationFile( explanationFile, explanation );
- }
-
- fprintf( report, "</tr>\n");
-
- return true;
- }
-
- bool ReportsHtml::PutSizeLine(
- FILE* report,
- unsigned int count,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
- Coverage::CoverageRanges::ranges_t::iterator range
- )
- {
- std::string temp;
- int i;
-
- // Mark the background color different for odd and even lines.
- if ( ( count%2 ) != 0 )
- fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
- else
- fprintf( report, "<tr>\n");
-
- // size
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- range->highAddress - range->lowAddress + 1
- );
-
- // symbol
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbol->first.c_str()
- );
-
- // line
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\"><a href =\"annotated.html#range%d\">%s</td>\n",
- range->id,
- range->lowSourceLine.c_str()
- );
-
- // File
- i = range->lowSourceLine.find(":");
- temp = range->lowSourceLine.substr (0, i);
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- temp.c_str()
- );
-
- fprintf( report, "</tr>\n");
-
- return true;
- }
-
- bool ReportsHtml::PutSymbolSummaryLine(
- FILE* report,
- unsigned int count,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol
- )
- {
-
- // Mark the background color different for odd and even lines.
- if ( ( count%2 ) != 0 )
- fprintf( report, "<tr class=\"covoar-tr-odd\">\n");
- else
- fprintf( report, "<tr>\n");
-
- // symbol
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%s</td>\n",
- symbol->first.c_str()
- );
-
- // Total Size in Bytes
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.sizeInBytes
- );
-
- // Total Size in Instructions
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.sizeInInstructions
- );
-
- // Total Uncovered Ranges
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.uncoveredRanges
- );
-
- // Uncovered Size in Bytes
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.uncoveredBytes
- );
-
- // Uncovered Size in Instructions
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.uncoveredInstructions
- );
-
- // Total number of branches
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted
- );
-
- // Total Always Taken
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.branchesAlwaysTaken
- );
-
- // Total Never Taken
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%d</td>\n",
- symbol->second.stats.branchesNeverTaken
- );
-
- // % Uncovered Instructions
- if ( symbol->second.stats.sizeInInstructions == 0 )
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">100.00</td>\n"
- );
- else
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n",
- (symbol->second.stats.uncoveredInstructions*100.0)/
- symbol->second.stats.sizeInInstructions
- );
-
- // % Uncovered Bytes
- if ( symbol->second.stats.sizeInBytes == 0 )
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">100.00</td>\n"
- );
- else
- fprintf(
- report,
- "<td class=\"covoar-td\" align=\"center\">%.2f</td>\n",
- (symbol->second.stats.uncoveredBytes*100.0)/
- symbol->second.stats.sizeInBytes
- );
-
- fprintf( report, "</tr>\n");
- return true;
- }
-
- void ReportsHtml::CloseAnnotatedFile(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile(aFile);
- }
-
- void ReportsHtml::CloseBranchFile(
- FILE* aFile,
- bool hasBranches
- )
- {
- if ( hasBranches ) {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- );
- }
- fprintf(
- aFile,
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile(aFile);
- }
-
- void ReportsHtml::CloseCoverageFile(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile(aFile);
- }
-
- void ReportsHtml::CloseNoRangeFile(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile(aFile);
- }
-
-
- void ReportsHtml::CloseSizeFile(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile( aFile );
- }
-
- void ReportsHtml::CloseSymbolSummaryFile(
- FILE* aFile
- )
- {
- fprintf(
- aFile,
- TABLE_FOOTER
- "</tbody>\n"
- "</table>\n"
- "</pre>\n"
- "</body>\n"
- "</html>"
- );
-
- CloseFile( aFile );
- }
-
-}
diff --git a/covoar/ReportsHtml.h b/covoar/ReportsHtml.h
deleted file mode 100644
index 34193da..0000000
--- a/covoar/ReportsHtml.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*! @file ReportsHtml.h
- * @brief Reports in HTML 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 __REPORTSHTML_H__
-#define __REPORTSHTML_H__
-
-#include <stdint.h>
-#include "ReportsBase.h"
-#include "Explanations.h"
-
-namespace Coverage {
-
-/*!
- * This class contains all methods and data necessary to
- * do all of the HTML style reports.
- */
-class ReportsHtml: public ReportsBase {
-
- public:
- ReportsHtml( time_t timestamp );
- ~ReportsHtml();
-
- /*!
- * This method produces an index file.
- *
- * @param[in] fileName identifies the file name.
- */
- void WriteIndex(
- 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
- );
-
- protected:
-
- /*!
- * This variable tracks the annotated state at the time the
- * last line was output. This allows the text formating to change
- * based upon the type of lines being put out: source code or assembly
- * object dump line....
- */
- AnnotatedLineState_t lastState_m;
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenAnnotatedFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenBranchFile(
- const char* const fileName,
- bool hasBranches
- );
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenCoverageFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- FILE* OpenNoRangeFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenSizeFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenSymbolSummaryFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- virtual void CloseAnnotatedFile(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void CloseBranchFile(
- FILE* aFile,
- bool hasBranches
- );
-
- /* Inherit documentation from base class. */
- virtual void CloseCoverageFile(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- void CloseNoRangeFile(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void CloseSizeFile(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void CloseSymbolSummaryFile(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void PutAnnotatedLine(
- FILE* aFile,
- AnnotatedLineState_t state,
- std::string line,
- uint32_t id
- );
-
- /* Inherit documentation from base class. */
- virtual void AnnotatedStart(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void AnnotatedEnd(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutNoBranchInfo(
- FILE* report
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutBranchEntry(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
- Coverage::CoverageRanges::ranges_t::iterator rangePtr
- );
-
- /* Inherit documentation from base class. */
- virtual void putCoverageNoRange(
- FILE* report,
- FILE* noRangeFile,
- unsigned int number,
- std::string symbol
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutCoverageLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
- Coverage::CoverageRanges::ranges_t::iterator ritr
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutSizeLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
- Coverage::CoverageRanges::ranges_t::iterator range
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutSymbolSummaryLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol
- );
-
- /* Inherit documentation from base class. */
- virtual FILE* OpenFile(
- const char* const fileName
- );
-
- /* Inherit documentation from base class. */
- virtual bool WriteExplationFile(
- const char* fileName,
- const Coverage::Explanation* explanation
- );
- };
-
-}
-
-#endif
diff --git a/covoar/ReportsText.cc b/covoar/ReportsText.cc
deleted file mode 100644
index 33d3509..0000000
--- a/covoar/ReportsText.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-#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( time_t timestamp ):
- ReportsBase( timestamp )
-{
- reportExtension_m = ".txt";
-}
-
-ReportsText::~ReportsText()
-{
-}
-
-void ReportsText::AnnotatedStart(
- FILE* aFile
-)
-{
- fprintf(
- aFile,
- "========================================"
- "=======================================\n"
- );
-}
-
-void ReportsText::AnnotatedEnd(
- FILE* aFile
-)
-{
-}
-
-void ReportsText::PutAnnotatedLine(
- FILE* aFile,
- AnnotatedLineState_t state,
- std::string line,
- uint32_t id
-)
-{
- fprintf( aFile, "%s\n", line.c_str());
-}
-
-bool ReportsText::PutNoBranchInfo(
- FILE* report
-)
-{
- if ( BranchInfoAvailable )
- fprintf( report, "All branch paths taken.\n" );
- else
- fprintf( report, "No branch information found.\n" );
- return true;
-}
-
-
-bool ReportsText::PutBranchEntry(
- FILE* report,
- unsigned int number,
- 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,
- FILE* noRangeFile,
- unsigned int number,
- 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()
- );
- fprintf( noRangeFile, "%s\n", symbol.c_str() );
-}
-
-bool ReportsText::PutCoverageLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
- Coverage::CoverageRanges::ranges_t::iterator ritr
-)
-{
- const Coverage::Explanation* explanation;
-
- fprintf(
- report,
- "============================================\n"
- "Index : %d\n"
- "Symbol : %s (0x%x)\n"
- "Starting Line : %s (0x%x)\n"
- "Ending Line : %s (0x%x)\n"
- "Size in Bytes : %d\n"
- "Size in Instructions : %d\n\n",
- ritr->id,
- ditr->first.c_str(),
- ditr->second.baseAddress,
- ritr->lowSourceLine.c_str(),
- ritr->lowAddress,
- ritr->highSourceLine.c_str(),
- ritr->highAddress,
- ritr->highAddress - ritr->lowAddress + 1,
- ritr->instructionCount
- );
-
- 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,
- unsigned int number,
- 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;
-}
-
-bool ReportsText::PutSymbolSummaryLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol
-)
-{
- float uncoveredBytes;
- float uncoveredInstructions;
-
- if ( symbol->second.stats.sizeInInstructions == 0 )
- uncoveredInstructions = 0;
- else
- uncoveredInstructions = (symbol->second.stats.uncoveredInstructions*100.0)/
- symbol->second.stats.sizeInInstructions;
-
- if ( symbol->second.stats.sizeInBytes == 0 )
- uncoveredBytes = 0;
- else
- uncoveredBytes = (symbol->second.stats.uncoveredBytes*100.0)/
- symbol->second.stats.sizeInBytes;
-
- fprintf(
- report,
- "============================================\n"
- "Symbol : %s\n"
- "Total Size in Bytes : %d\n"
- "Total Size in Instructions : %d\n"
- "Total number Branches : %d\n"
- "Total Always Taken : %d\n"
- "Total Never Taken : %d\n"
- "Percentage Uncovered Instructions : %.2f\n"
- "Percentage Uncovered Bytes : %.2f\n",
- symbol->first.c_str(),
- symbol->second.stats.sizeInBytes,
- symbol->second.stats.sizeInInstructions,
- symbol->second.stats.branchesNotExecuted + symbol->second.stats.branchesExecuted,
- symbol->second.stats.branchesAlwaysTaken,
- symbol->second.stats.branchesNeverTaken,
- uncoveredInstructions,
- uncoveredBytes
- );
-
- fprintf(report, "============================================\n");
- return true;
-}
-
-}
diff --git a/covoar/ReportsText.h b/covoar/ReportsText.h
deleted file mode 100644
index 9ae87d4..0000000
--- a/covoar/ReportsText.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*! @file ReportsText.h
- * @brief Reports Text Format Write 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 {
-
-/*!
- * This class contains all methods and data necessary to
- * produce all text style reports.
- */
-class ReportsText: public ReportsBase {
-
- public:
- ReportsText( time_t timestamp );
- virtual ~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:
-
- /* Inherit documentation from base class. */
- virtual void PutAnnotatedLine(
- FILE* aFile,
- AnnotatedLineState_t state,
- std::string line,
- uint32_t id
- );
-
- /* Inherit documentation from base class. */
- virtual void AnnotatedStart(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual void AnnotatedEnd(
- FILE* aFile
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutNoBranchInfo(
- FILE* report
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutBranchEntry(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbolPtr,
- Coverage::CoverageRanges::ranges_t::iterator rangePtr
- );
-
- /* Inherit documentation from base class. */
- virtual void putCoverageNoRange(
- FILE* report,
- FILE* noRangeFile,
- unsigned int number,
- std::string symbol
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutCoverageLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator ditr,
- Coverage::CoverageRanges::ranges_t::iterator ritr
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutSizeLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol,
- Coverage::CoverageRanges::ranges_t::iterator range
- );
-
- /* Inherit documentation from base class. */
- virtual bool PutSymbolSummaryLine(
- FILE* report,
- unsigned int number,
- Coverage::DesiredSymbols::symbolSet_t::iterator symbol
- );
-};
-
-}
-
-#endif
diff --git a/covoar/SymbolTable.cc b/covoar/SymbolTable.cc
deleted file mode 100644
index 062e0a3..0000000
--- a/covoar/SymbolTable.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*! @file SymbolTable.cc
- * @brief SymbolTable Implementation
- *
- * This file contains ...
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "SymbolTable.h"
-#include "app_common.h"
-
-namespace Coverage {
-
- SymbolTable::SymbolTable()
- {
- }
-
- SymbolTable::~SymbolTable()
- {
- }
-
- void SymbolTable::addSymbol(
- const std::string& symbol,
- const uint32_t start,
- const uint32_t length
- )
- {
- uint32_t end = 0;
- symbol_entry_t entry;
- symbolInfo_t symbolData;
-
- // Add an entry to the address map.
- end = start + length - 1;
- entry.low = start;
- entry.high = end;
- entry.symbol = symbol;
- contents[ end ] = entry;
-
- // Add an entry to the symbol information map.
- symbolData.startingAddress = start;
- symbolData.length = length;
-
- if ( info[ symbol ].empty() == false ) {
- if ( info[ symbol ].front().length != length ) {
- fprintf(stderr,
- "ERROR==> Different lengths for the symbol %s (%d and %d)\n",
- symbol.c_str(),
- info[ symbol ].front().length,
- length
- );
- exit( 0 );
- }
- }
-
- info[ symbol ].push_back( symbolData );
- }
-
- SymbolTable::symbolInfo* SymbolTable::getInfo(
- const std::string& symbol
- )
- {
- info_t::iterator it = info.find( symbol );
-
- if (it == info.end())
- return NULL;
- else
- return (&(it->second));
- }
-
- uint32_t SymbolTable::getLength(
- const std::string& symbol
- )
- {
- info_t::iterator it = info.find( symbol );
-
- if (it == info.end())
- return 0;
- else
- return ((*it).second.front().length);
- }
-
- std::string SymbolTable::getSymbol(
- uint32_t address
- )
- {
- contents_t::iterator it;
-
- // Ensure that the symbol table is not empty.
- if ( contents.size() == 0 )
- return "";
-
- // Find the first entry whose end address is greater
- // than the specified address.
- it = contents.lower_bound( address );
-
- // If an entry was found and its low address is less than or
- // equal to the specified address, then return the symbol.
- if ((it != contents.end()) && ((it->second).low <= address ))
- return (it->second).symbol;
-
- return "";
- }
-
- void SymbolTable::dumpSymbolTable( void )
- {
- symbolInfo symbolTable;
- symbolInfoIterator_t symbolIterator;
- infoIterator_t infoIterator;
-
- for (infoIterator = info.begin() ; infoIterator != info.end(); infoIterator++)
- {
- for (symbolIterator = infoIterator->second.begin() ; symbolIterator != infoIterator->second.end(); symbolIterator++)
- {
- fprintf( stdout, "%s:\tStarting address = %#x\tLength = %u\n", infoIterator->first.c_str(), symbolIterator->startingAddress, symbolIterator->length );
- }
- }
- }
-
-}
diff --git a/covoar/SymbolTable.h b/covoar/SymbolTable.h
deleted file mode 100644
index 7b71304..0000000
--- a/covoar/SymbolTable.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*! @file SymbolTable.h
- * @brief SymbolTable Specification
- *
- * This file contains the specification of the SymbolTable class.
- */
-
-#ifndef __SYMBOLTABLE_H__
-#define __SYMBOLTABLE_H__
-
-#include <stdint.h>
-#include <string>
-#include <map>
-#include <list>
-
-namespace Coverage {
-
- /*! @class SymbolTable
- *
- * This class maintains information for each desired symbol within an
- * executable. A desired symbol is a symbol for which analysis is to
- * be performed.
- */
- class SymbolTable {
-
- public:
-
- /*!
- * This structure defines the information kept for each symbol.
- */
- typedef struct {
- uint32_t startingAddress;
- uint32_t length;
- } symbolInfo_t;
-
- typedef std::list< symbolInfo_t > symbolInfo;
- typedef std::list< symbolInfo_t >::iterator symbolInfoIterator_t;
-
-
-
- /*!
- * This method constructs a SymbolTable instance.
- */
- SymbolTable();
-
- /*!
- * This method destructs a SymbolTable instance.
- */
- virtual ~SymbolTable();
-
- /*!
- * This method adds the specified symbol information to the
- * symbol table.
- *
- * @param[in] symbol specifies the symbol to add
- * @param[in] start specifies the symbol's start address
- * @param[in] length specifies the symbol's length
- *
- */
- void addSymbol(
- const std::string& symbol,
- const uint32_t start,
- const uint32_t length
- );
-
- /*!
- * This method returns the symbol information for the specified symbol.
- *
- * @param[in] symbol specifies the symbol for which to obtain information
- *
- * @return Returns a pointer to the symbol information
- */
- symbolInfo* getInfo(
- const std::string& symbol
- );
-
- /*!
- * This method returns the length in bytes of the specified symbol.
- *
- * @param[in] symbol specifies the symbol for which to obtain the length
- *
- * @return Returns the length of the symbol
- */
- uint32_t getLength(
- const std::string& symbol
- );
-
- /*!
- * This method returns the symbol that contains the specified address.
- *
- * @param[in] address specifies the address for which to obtain the symbol
- *
- * @return Returns the symbol containing the address
- */
- std::string getSymbol(
- uint32_t address
- );
-
- /*!
- * This method prints SymbolTable content to stdout
- *
- */
- void dumpSymbolTable( void );
-
- private:
-
- /*!
- * This map associates the end address of a symbol's address
- * range with the symbol's address range definition.
- */
- typedef struct {
- uint32_t low;
- uint32_t high;
- std::string symbol;
- } symbol_entry_t;
- typedef std::map< uint32_t, symbol_entry_t > contents_t;
- contents_t contents;
-
- /*!
- * This map associates each symbol from an executable with
- * the symbol's information.
- */
- typedef std::map<std::string, symbolInfo> info_t;
- typedef std::map<std::string, symbolInfo>::iterator infoIterator_t;
- info_t info;
-
- };
-}
-#endif
diff --git a/covoar/TargetBase.cc b/covoar/TargetBase.cc
deleted file mode 100644
index e5a0ee6..0000000
--- a/covoar/TargetBase.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-/*! @file TargetBase.cc
- * @brief TargetBase Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-
-#include "TargetBase.h"
-#include "qemu-traces.h"
-
-#include <algorithm>
-#include <stdio.h>
-#include <stdlib.h>
-
-namespace Target {
-
- TargetBase::TargetBase(
- std::string targetName
- ):
- targetName_m( targetName )
- {
- int i;
- std::string front = "";
-
- for (i=0 ; targetName_m[i] && targetName_m[i] != '-' ; ) {
- cpu_m[i] = targetName_m[i];
- cpu_m[++i] = '\0';
- }
- if (targetName_m[i] == '-')
- front = targetName_m + "-";
-
-
- addr2line_m = front + "addr2line";
- objdump_m = front + "objdump";
- }
-
- TargetBase::~TargetBase()
- {
- }
-
- const char* TargetBase::getAddr2line() const
- {
- return addr2line_m.c_str();
- }
-
- const char* TargetBase::getCPU( void ) const
- {
- return cpu_m.c_str();
- }
-
- const char* TargetBase::getObjdump() const
- {
- return objdump_m.c_str();
- }
-
- const char* TargetBase::getTarget( void ) const
- {
- return targetName_m.c_str();
- }
-
- bool TargetBase::isBranch(
- const char* const instruction
- )
- {
- std::list <std::string>::iterator i;
-
- if (branchInstructions.empty()) {
- fprintf(
- stderr,
- "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n"
- );
- exit( -1 );
- }
-
- i = find(branchInstructions.begin(), branchInstructions.end(), instruction);
- if ( i == branchInstructions.end() )
- return false;
-
- return true;
- }
-
- bool TargetBase::isBranchLine(
- const char* const line
- )
- {
- #define WARNING \
- "WARNING: TargetBase::isBranchLine - (%d) " \
- "Unable to find instruction in: %s\n"
- const char *ch;
- char instruction[120];
- int result;
-
-
- ch = &(line[0]);
-
- // Increment to the first tab in the line
- while ((*ch != '\t') && (*ch != '\0')) {
- ch++;
- }
- if (*ch != '\t') {
- fprintf( stderr, WARNING, 1, line );
- return false;
- }
- ch++;
-
- // Increment to the second tab in the line
- while ((*ch != '\t') && (*ch != '\0'))
- ch++;
- if (*ch != '\t') {
- fprintf( stderr, WARNING, 2, line) ;
- return false;
- }
- ch++;
-
- // Grab the instruction which is the next word in the buffer
- // after the second tab.
- result = sscanf( ch, "%s", instruction );
- if (result != 1) {
- fprintf( stderr, WARNING, 3, line );
- return false;
- }
-
- return isBranch( instruction );
- }
-
- uint8_t TargetBase::qemuTakenBit(void)
- {
- return TRACE_OP_BR0;
- }
-
- uint8_t TargetBase::qemuNotTakenBit(void)
- {
- return TRACE_OP_BR1;
- }
-
-}
diff --git a/covoar/TargetBase.h b/covoar/TargetBase.h
deleted file mode 100644
index 14cd6f2..0000000
--- a/covoar/TargetBase.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*! @file TargetBase.h
- * @brief TargetBase Specification
- *
- * This file contains the specification of the TargetBase class.
- */
-
-#ifndef __TARGETBASE_H__
-#define __TARGETBASE_H__
-
-#include <list>
-#include <string>
-#include <stdint.h>
-
-namespace Target {
-
- /*! @class TargetBase
- *
- * This class is the base class for all Target classes. Each
- * target class contains routines that are specific to the target
- * in question.
- */
- class TargetBase {
-
- public:
-
- /*!
- * This method constructs an TargetBase instance.
- *
- * @param[in] targetName specifies the desired target
- */
- TargetBase(
- std::string targetName
- );
-
- /*!
- * This method destructs an TargetBase instance.
- */
- virtual ~TargetBase();
-
- /*!
- * This method returns the program name for addr2line.
- *
- * @return Returns the target specific addr2line program name
- */
- const char* getAddr2line( void ) const;
-
- /*!
- * This method returns the CPU name.
- *
- * @return Returns the target cpu name
- */
- const char* getCPU( void ) const;
-
- /*!
- * This method returns the program name for objdump.
- *
- * @return Returns the target specific objdump program name
- */
- const char* getObjdump( void ) const;
-
- /*!
- * This method returns the target name.
- *
- * @return Returns the target name
- */
- const char* getTarget( void ) const;
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- virtual bool isNopLine(
- const char* const line,
- int& size
- ) = 0;
-
-
- /*!
- * This method determins if the objdump line contains a
- * branch instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a branch, FALSE otherwise.
- */
- bool isBranchLine(
- const char* const line
- );
-
-
- /*!
- * This method determines if the specified line from an
- * objdump file is a branch instruction.
- */
- bool isBranch(
- const char* const instruction
- );
-
- /*!
- * This method returns the bit set by Qemu in the trace record
- * when a branch is taken.
- */
- virtual uint8_t qemuTakenBit(void);
-
- /*!
- * This method returns the bit set by Qemu in the trace record
- * when a branch is taken.
- */
- virtual uint8_t qemuNotTakenBit(void);
-
- protected:
-
- /*!
- * This member variable contains the target name string.
- */
- std::string targetName_m;
-
- /*!
- * This member variable indicates either the column that the instruction
- * starts in the object dump file, when the objdump has no tabs; or the
- * number of tabs to find the instruction.
- */
- int objdumpInstructionLocation;
-
- /*!
- * This member variable indicates whether or not the objdump has
- * tabs as delemeters.
- */
- bool objdumpHasTabs;
-
- /*!
- * This member variable is an array of all branch instructions
- * for this target.
- */
- std::list <std::string> branchInstructions;
-
- private:
-
- /*!
- * This member variable contains the name of the host program
- * which reports the source line for the specified program address.
- */
- std::string addr2line_m;
-
- /*!
- * This member variable contains the name of the target cpu architecture.
- */
- std::string cpu_m;
-
- /*!
- * This member variable contains the name of the host program
- * which disassembles an executable or library.
- */
- std::string objdump_m;
- };
-}
-#endif
diff --git a/covoar/TargetFactory.cc b/covoar/TargetFactory.cc
deleted file mode 100644
index 27b0bc1..0000000
--- a/covoar/TargetFactory.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-//
-
-//! @file TargetFactory.cc
-//! @brief TargetFactory Implementation
-//!
-//! This file contains the implementation of a factory for a
-//! instances of a family of classes derived from TargetBase.
-//!
-
-#include "TargetFactory.h"
-
-#include "Target_arm.h"
-#include "Target_i386.h"
-#include "Target_m68k.h"
-#include "Target_powerpc.h"
-#include "Target_lm32.h"
-#include "Target_sparc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- //!
- //! @brief TargetBase Factory Table Entry
- //!
- //! This structure contains the @a name associated with the target
- //! in the configuration structures. The table of names is scanned
- //! to find a constructor helper.
- //!
- typedef struct {
- //! This is the string found in configuration to match.
- const char *theTarget;
- //! This is the static wrapper for the constructor.
- TargetBase *(*theCtor)(
- std::string
- );
- } FactoryEntry_t;
-
- //!
- //! @brief TargetBase Factory Table
- //!
- //! This is the table of possible types we can construct
- //! dynamically based upon user specified configuration information.
- //! All must be derived from TargetBase.
- //!
- static FactoryEntry_t FactoryTable[] = {
- { "arm", Target_arm_Constructor },
- { "i386", Target_i386_Constructor },
- { "lm32", Target_lm32_Constructor },
- { "m68k", Target_m68k_Constructor },
- { "powerpc", Target_powerpc_Constructor },
- { "sparc", Target_sparc_Constructor },
- { "TBD", NULL },
- };
-
- TargetBase* TargetFactory(
- std::string targetName
- )
- {
- size_t i;
- std::string cpu;
-
- i = targetName.find( '-' );
- if ( i == targetName.npos )
- cpu = targetName;
- else
- cpu = targetName.substr( 0, i );
-
- // fprintf( stderr, "%s --> %s\n", targetName.c_str(), cpu.c_str());
- // Iterate over the table trying to find an entry with a matching name
- for ( i=0 ; i < sizeof(FactoryTable) / sizeof(FactoryEntry_t); i++ ) {
- if ( !strcmp(FactoryTable[i].theTarget, cpu.c_str() ) )
- return FactoryTable[i].theCtor( targetName );
- }
-
- fprintf(
- stderr,
- "ERROR!!! %s is not a known architecture!!!\n",
- cpu.c_str()
- );
- fprintf( stderr, "-- fix me\n" );
- exit( 1 );
-
- return NULL;
- }
-}
diff --git a/covoar/TargetFactory.h b/covoar/TargetFactory.h
deleted file mode 100644
index f0b22bb..0000000
--- a/covoar/TargetFactory.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-//
-
-//! @file TargetFactory.h
-//! @brief TargetFactory Specification
-//!
-//! This file contains the specification of a factory for a
-//! instances of a family of classes derived from TargetBase.
-//!
-
-#ifndef __TARGET_FACTORY_H__
-#define __TARGET_FACTORY_H__
-
-#include <string>
-#include "TargetBase.h"
-
-namespace Target {
-
- //!
- //! @brief Target Construction Factory
- //!
- //! This method implements a factory for construction of instances
- //! classes derived from TargetBase. Given the name of the class instance
- //! and name of the instance, it returns an instance.
- //!
- //! @param [in] targetName is the name of the target to create.
- //!
- //! @return This method constructs a new instance of an TargetBase and
- //! returns that to the caller.
- //!
- TargetBase *TargetFactory(
- std::string targetName
- );
-
-}
-#endif
-
diff --git a/covoar/Target_arm.cc b/covoar/Target_arm.cc
deleted file mode 100644
index a2b65c8..0000000
--- a/covoar/Target_arm.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*! @file Target_arm.cc
- * @brief Target_arm Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-#include "Target_arm.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- Target_arm::Target_arm( std::string targetName ):
- TargetBase( targetName )
- {
- branchInstructions.push_back("bcc");
- branchInstructions.push_back("bcs");
- branchInstructions.push_back("beq");
- branchInstructions.push_back("bge");
- branchInstructions.push_back("bgt");
- branchInstructions.push_back("bhi");
- branchInstructions.push_back("bl-hi");
- branchInstructions.push_back("bl-lo");
- branchInstructions.push_back("ble");
- branchInstructions.push_back("bls");
- branchInstructions.push_back("blt");
- branchInstructions.push_back("bmi");
- branchInstructions.push_back("bne");
- branchInstructions.push_back("bpl");
- branchInstructions.push_back("bvc");
- branchInstructions.push_back("bvs");
-
- branchInstructions.sort();
-
- }
-
- Target_arm::~Target_arm()
- {
- }
-
- bool Target_arm::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 4;
- return true;
- }
-
- // On ARM, there are literal tables at the end of methods.
- // We need to avoid them.
- if (!strncmp( &line[strlen(line)-10], ".byte", 5)) {
- size = 1;
- return true;
- }
- if (!strncmp( &line[strlen(line)-13], ".short", 6)) {
- size = 2;
- return true;
- }
- if (!strncmp( &line[strlen(line)-16], ".word", 5)) {
- size = 4;
- return true;
- }
-
- return false;
-
- }
-
- bool Target_arm::isBranch(
- const char* instruction
- )
- {
- fprintf( stderr, "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n" );
- exit( -1 );
- }
-
- TargetBase *Target_arm_Constructor(
- std::string targetName
- )
- {
- return new Target_arm( targetName );
- }
-
-}
diff --git a/covoar/Target_arm.h b/covoar/Target_arm.h
deleted file mode 100644
index 0396402..0000000
--- a/covoar/Target_arm.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*! @file Target_arm.h
- * @brief Target_arm Specification
- *
- * This file contains the specification of the Target_arm class.
- */
-
-#ifndef __TARGET_ARM_H__
-#define __TARGET_ARM_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-namespace Target {
-
- /*! @class Target_arm
- *
- * This class is the Target classe for the arm processor.
- *
- */
- class Target_arm: public TargetBase {
-
- public:
-
- /*!
- * This method constructs an Target_arm instance.
- */
- Target_arm( std::string targetName );
-
- /*!
- * This method destructs an Target_arm instance.
- */
- virtual ~Target_arm();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- /*!
- * This method determines if the specified line from an
- * objdump file is a branch instruction.
- */
- bool isBranch(
- const char* const instruction
- );
-
- private:
-
- };
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_arm_Constructor(
- std::string targetName
- );
-
-}
-#endif
diff --git a/covoar/Target_i386.cc b/covoar/Target_i386.cc
deleted file mode 100644
index 0f82f18..0000000
--- a/covoar/Target_i386.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-/*! @file Target_i386.cc
- * @brief Target_i386 Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-
-#include "Target_i386.h"
-#include "qemu-traces.h"
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- Target_i386::Target_i386( std::string targetName ):
- TargetBase( targetName )
- {
- branchInstructions.push_back("ja");
- branchInstructions.push_back("jb");
- branchInstructions.push_back("jc");
- branchInstructions.push_back("je");
- branchInstructions.push_back("jg");
- branchInstructions.push_back("jl");
- branchInstructions.push_back("jo");
- branchInstructions.push_back("jp");
- branchInstructions.push_back("js");
- branchInstructions.push_back("jz");
- branchInstructions.push_back("jae");
- branchInstructions.push_back("jbe");
- branchInstructions.push_back("jge");
- branchInstructions.push_back("jle");
- branchInstructions.push_back("jne");
- branchInstructions.push_back("jna");
- branchInstructions.push_back("jnb");
- branchInstructions.push_back("jnc");
- branchInstructions.push_back("jne");
- branchInstructions.push_back("jng");
- branchInstructions.push_back("jnl");
- branchInstructions.push_back("jno");
- branchInstructions.push_back("jnp");
- branchInstructions.push_back("jns");
- branchInstructions.push_back("jnz");
- branchInstructions.push_back("jpe");
- branchInstructions.push_back("jpo");
- branchInstructions.push_back("jnbe");
- branchInstructions.push_back("jnae");
- branchInstructions.push_back("jnle");
- branchInstructions.push_back("jnge");
-
- branchInstructions.sort();
-
- }
-
- Target_i386::~Target_i386()
- {
- }
-
- bool Target_i386::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 1;
- return true;
- }
-
- // i386 has some two and three byte nops
- if (!strncmp( &line[strlen(line)-14], "xchg %ax,%ax", 14)) {
- size = 2;
- return true;
- }
- if (!strncmp( &line[strlen(line)-16], "xor %eax,%eax", 16)) {
- size = 2;
- return true;
- }
- if (!strncmp( &line[strlen(line)-16], "xor %ebx,%ebx", 16)) {
- size = 2;
- return true;
- }
- if (!strncmp( &line[strlen(line)-16], "xor %esi,%esi", 16)) {
- size = 2;
- return true;
- }
- if (!strncmp( &line[strlen(line)-21], "lea 0x0(%esi),%esi", 21)) {
- size = 3;
- return true;
- }
-
- return false;
- }
-
- uint8_t Target_i386::qemuTakenBit(void)
- {
- return TRACE_OP_BR1;
- }
-
- uint8_t Target_i386::qemuNotTakenBit(void)
- {
- return TRACE_OP_BR0;
- }
-
- TargetBase *Target_i386_Constructor(
- std::string targetName
- )
- {
- return new Target_i386( targetName );
- }
-
-}
diff --git a/covoar/Target_i386.h b/covoar/Target_i386.h
deleted file mode 100644
index 9c332dd..0000000
--- a/covoar/Target_i386.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*! @file Target_i386.h
- * @brief Target_i386 Specification
- *
- * This file contains the specification of the Target_i386 class.
- */
-
-#ifndef __TARGET_I386_H__
-#define __TARGET_I386_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-
-namespace Target {
-
- /*! @class Target_i386
- *
- * This class is the class for i386 Target.
- *
- */
- class Target_i386: public TargetBase {
-
- public:
-
- /*!
- * This method constructs an Target_i386 instance.
- */
- Target_i386( std::string targetName );
-
- /*!
- * This method destructs an Target_i386 instance.
- */
- virtual ~Target_i386();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- /* Documentation inherited from base class */
- virtual uint8_t qemuTakenBit(void);
-
- /* Documentation inherited from base class */
- virtual uint8_t qemuNotTakenBit(void);
-
- private:
-
- };
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_i386_Constructor(
- std::string targetName
- );
-
-}
-#endif
diff --git a/covoar/Target_lm32.cc b/covoar/Target_lm32.cc
deleted file mode 100644
index 988c735..0000000
--- a/covoar/Target_lm32.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*! @file Target_lm32.cc
- * @brief Target_lm32 Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-#include "Target_lm32.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <algorithm>
-
-namespace Target {
-
- // http://www.latticesemi.com/documents/doc20890x45.pdf
- Target_lm32::Target_lm32( std::string targetName ):
- TargetBase( targetName )
- {
- branchInstructions.push_back("be");
- branchInstructions.push_back("bge");
- branchInstructions.push_back("bgeu");
- branchInstructions.push_back("bg");
- branchInstructions.push_back("bgu");
- branchInstructions.push_back("bne");
- }
-
- Target_lm32::~Target_lm32()
- {
- }
-
- bool Target_lm32::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 4;
- return true;
- }
-
- return false;
- }
-
- TargetBase *Target_lm32_Constructor(
- std::string targetName
- )
- {
- return new Target_lm32( targetName );
- }
-
-}
diff --git a/covoar/Target_lm32.h b/covoar/Target_lm32.h
deleted file mode 100644
index 5e85da7..0000000
--- a/covoar/Target_lm32.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*! @file Target_lm32.h
- * @brief Target_lm32 Specification
- *
- * This file contains the specification of the Target_lm32 class.
- */
-
-#ifndef __TARGET_LM32_H__
-#define __TARGET_LM32_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-
-namespace Target {
-
- /*!
- *
- * This class is the class for the m68k Target.
- *
- */
- class Target_lm32: public TargetBase {
-
- public:
-
- /*!
- * This method constructs a Target_lm32 instance.
- */
- Target_lm32( std::string targetName );
-
- /*!
- * This method destructs a Target_m68 instance.
- */
- virtual ~Target_lm32();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- private:
-
- };
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_lm32_Constructor(
- std::string targetName
- );
-
-}
-#endif
diff --git a/covoar/Target_m68k.cc b/covoar/Target_m68k.cc
deleted file mode 100644
index 683458a..0000000
--- a/covoar/Target_m68k.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-/*! @file Target_m68k.cc
- * @brief Target_m68k Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-#include "Target_m68k.h"
-#include "qemu-traces.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- Target_m68k::Target_m68k( std::string targetName ):
- TargetBase( targetName )
- {
- branchInstructions.push_back("bcc");
- branchInstructions.push_back("bccs");
- branchInstructions.push_back("bccl");
- branchInstructions.push_back("bcs");
- branchInstructions.push_back("bcss");
- branchInstructions.push_back("bcsl");
- branchInstructions.push_back("beq");
- branchInstructions.push_back("beqs");
- branchInstructions.push_back("beql");
- branchInstructions.push_back("bge");
- branchInstructions.push_back("bges");
- branchInstructions.push_back("bgel");
- branchInstructions.push_back("bgt");
- branchInstructions.push_back("bgts");
- branchInstructions.push_back("bgtl");
- branchInstructions.push_back("bhi");
- branchInstructions.push_back("bhis");
- branchInstructions.push_back("bhil");
- branchInstructions.push_back("bhs");
- branchInstructions.push_back("bhss");
- branchInstructions.push_back("bhsl");
- branchInstructions.push_back("ble");
- branchInstructions.push_back("bles");
- branchInstructions.push_back("blel");
- branchInstructions.push_back("blo");
- branchInstructions.push_back("blos");
- branchInstructions.push_back("blol");
- branchInstructions.push_back("bls");
- branchInstructions.push_back("blss");
- branchInstructions.push_back("blsl");
- branchInstructions.push_back("blt");
- branchInstructions.push_back("blts");
- branchInstructions.push_back("bltl");
- branchInstructions.push_back("bmi");
- branchInstructions.push_back("bmis");
- branchInstructions.push_back("bmil");
- branchInstructions.push_back("bne");
- branchInstructions.push_back("bnes");
- branchInstructions.push_back("bnel");
- branchInstructions.push_back("bpl");
- branchInstructions.push_back("bpls");
- branchInstructions.push_back("bpll");
- branchInstructions.push_back("bvc");
- branchInstructions.push_back("bvcs");
- branchInstructions.push_back("bvcl");
- branchInstructions.push_back("bvs");
- branchInstructions.push_back("bvss");
- branchInstructions.push_back("bvsl");
-
- branchInstructions.sort();
-
- }
-
- Target_m68k::~Target_m68k()
- {
- }
-
- bool Target_m68k::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 2;
- return true;
- }
-
- #define GNU_LD_FILLS_ALIGNMENT_WITH_RTS
- #if defined(GNU_LD_FILLS_ALIGNMENT_WITH_RTS)
- // Until binutils 2.20, binutils would fill with rts not nop
- if (!strcmp( &line[strlen(line)-3], "rts")) {
- size = 4;
- return true;
- }
- #endif
-
- return false;
- }
-
- bool Target_m68k::isBranch(
- const char* const instruction
- )
- {
- fprintf(
- stderr,
- "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n"
- );
- exit( -1 );
- }
-
- uint8_t Target_m68k::qemuTakenBit(void)
- {
- return TRACE_OP_BR1;
- }
-
- uint8_t Target_m68k::qemuNotTakenBit(void)
- {
- return TRACE_OP_BR0;
- }
-
- TargetBase *Target_m68k_Constructor(
- std::string targetName
- )
- {
- return new Target_m68k( targetName );
- }
-
-}
diff --git a/covoar/Target_m68k.h b/covoar/Target_m68k.h
deleted file mode 100644
index 053e3b4..0000000
--- a/covoar/Target_m68k.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*! @file Target_m68k.h
- * @brief Target_m68k Specification
- *
- * This file contains the specification of the Target_m68k class.
- */
-
-#ifndef __TARGET_M68K_H__
-#define __TARGET_M68K_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-
-namespace Target {
-
- /*!
- *
- * This class is the class for the m68k Target.
- *
- */
- class Target_m68k: public TargetBase {
-
- public:
-
- /*!
- * This method constructs a Target_m68k instance.
- */
- Target_m68k( std::string targetName );
-
- /*!
- * This method destructs a Target_m68 instance.
- */
- virtual ~Target_m68k();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- /*!
- * This method determines if the specified line from an
- * objdump file is a branch instruction.
- */
- bool isBranch(
- const char* const instruction
- );
-
- /* Documentation inherited from base class */
- virtual uint8_t qemuTakenBit(void);
-
- /* Documentation inherited from base class */
- virtual uint8_t qemuNotTakenBit(void);
-
- private:
-
- };
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_m68k_Constructor(
- std::string targetName
- );
-
-}
-#endif
diff --git a/covoar/Target_powerpc.cc b/covoar/Target_powerpc.cc
deleted file mode 100644
index f7a5acb..0000000
--- a/covoar/Target_powerpc.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-/*! @file Target_powerpc.cc
- * @brief Target_powerpc Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-#include "Target_powerpc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- Target_powerpc::Target_powerpc( std::string targetName ):
- TargetBase( targetName )
- {
- // bl is actually branch and link which is a call
- // branchInstructions.push_back("b");
- // branchInstructions.push_back("ba");
- branchInstructions.push_back("beq");
- branchInstructions.push_back("beq+");
- branchInstructions.push_back("beq-");
- branchInstructions.push_back("bne");
- branchInstructions.push_back("bne+");
- branchInstructions.push_back("bne-");
- branchInstructions.push_back("bge");
- branchInstructions.push_back("bge+");
- branchInstructions.push_back("bge-");
- branchInstructions.push_back("bgt");
- branchInstructions.push_back("bgt+");
- branchInstructions.push_back("bgt-");
- branchInstructions.push_back("ble");
- branchInstructions.push_back("ble+");
- branchInstructions.push_back("ble-");
- branchInstructions.push_back("blt");
- branchInstructions.push_back("blt+");
- branchInstructions.push_back("blt-");
- branchInstructions.push_back("bla");
- branchInstructions.push_back("bc");
- branchInstructions.push_back("bca");
- branchInstructions.push_back("bcl");
- branchInstructions.push_back("bcla");
- branchInstructions.push_back("bcctr");
- branchInstructions.push_back("bcctrl");
- branchInstructions.push_back("bclr");
- branchInstructions.push_back("bclrl");
-
-
- branchInstructions.sort();
- }
-
- Target_powerpc::~Target_powerpc()
- {
- }
-
- bool Target_powerpc::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 4;
- return true;
- }
-
- return false;
- }
-
- bool Target_powerpc::isBranch(
- const char* const instruction
- )
- {
- fprintf( stderr, "DETERMINE BRANCH INSTRUCTIONS FOR THIS ARCHITECTURE! -- fix me\n" );
- exit( -1 );
- }
-
- TargetBase *Target_powerpc_Constructor(
- std::string targetName
- )
- {
- return new Target_powerpc( targetName );
- }
-
-}
diff --git a/covoar/Target_powerpc.h b/covoar/Target_powerpc.h
deleted file mode 100644
index 34bc0fe..0000000
--- a/covoar/Target_powerpc.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*! @file Target_powerpc.h
- * @brief Target_powerpc Specification
- *
- * This file contains the specification of the Target_powerpc class.
- */
-
-#ifndef __TARGET_POWERPC_H__
-#define __TARGET_POWERPC_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-
-namespace Target {
-
- /*!
- *
- * This class is the class for the powerpc target.
- *
- */
- class Target_powerpc: public TargetBase {
-
- public:
-
- /*!
- * This method constructs an Target_powerpc instance.
- */
- Target_powerpc( std::string targetName );
-
- /*!
- * This method destructs an Target_powerpc instance.
- */
- virtual ~Target_powerpc();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- /*!
- * This method determines if the specified line from an
- * objdump file is a branch instruction.
- */
- bool isBranch(
- const char* const instruction
- );
-
- private:
-
- };
-
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_powerpc_Constructor(
- std::string targetName
- );
-
-
-}
-#endif
diff --git a/covoar/Target_sparc.cc b/covoar/Target_sparc.cc
deleted file mode 100644
index 0e4ab2e..0000000
--- a/covoar/Target_sparc.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*! @file Target_sparc.cc
- * @brief Target_sparc Implementation
- *
- * This file contains the implementation of the base class for
- * functions supporting target unique functionallity.
- */
-#include "Target_sparc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-namespace Target {
-
- Target_sparc::Target_sparc( std::string targetName ):
- TargetBase( targetName )
- {
- branchInstructions.push_back("bn");
- branchInstructions.push_back("bn,a");
- branchInstructions.push_back("be");
- branchInstructions.push_back("be,a");
- branchInstructions.push_back("ble");
- branchInstructions.push_back("ble,a");
- branchInstructions.push_back("bl");
- branchInstructions.push_back("bl,a");
- branchInstructions.push_back("bleu");
- branchInstructions.push_back("bleu,a");
- branchInstructions.push_back("bcs");
- branchInstructions.push_back("bcs,a");
- branchInstructions.push_back("bneg");
- branchInstructions.push_back("bneg,a");
- branchInstructions.push_back("bvs");
- branchInstructions.push_back("bvs,a");
- branchInstructions.push_back("ba");
- branchInstructions.push_back("ba,a");
- branchInstructions.push_back("bne");
- branchInstructions.push_back("bne,a");
- branchInstructions.push_back("bg");
- branchInstructions.push_back("bg,a");
- branchInstructions.push_back("bge");
- branchInstructions.push_back("bge,a");
- branchInstructions.push_back("bgu");
- branchInstructions.push_back("bgu,a");
- branchInstructions.push_back("bcc");
- branchInstructions.push_back("bcc,a");
- branchInstructions.push_back("bpos");
- branchInstructions.push_back("bpos,a");
- branchInstructions.push_back("bvc");
- branchInstructions.push_back("bvc,a");
-
- branchInstructions.sort();
- }
-
- Target_sparc::~Target_sparc()
- {
- }
-
- bool Target_sparc::isNopLine(
- const char* const line,
- int& size
- )
- {
- if (!strcmp( &line[strlen(line)-3], "nop")) {
- size = 4;
- return true;
- }
-
- if (!strcmp( &line[strlen(line)-7], "unknown")) {
- size = 4;
- return true;
- }
- #define GNU_LD_FILLS_ALIGNMENT_WITH_RTS
- #if defined(GNU_LD_FILLS_ALIGNMENT_WITH_RTS)
- // Until binutils 2.20, binutils would fill with rts not nop
- if (!strcmp( &line[strlen(line)-3], "rts")) {
- size = 4;
- return true;
- }
- #endif
-
- return false;
- }
-
-
- TargetBase *Target_sparc_Constructor(
- std::string targetName
- )
- {
- return new Target_sparc( targetName );
- }
-}
diff --git a/covoar/Target_sparc.h b/covoar/Target_sparc.h
deleted file mode 100644
index 253e53a..0000000
--- a/covoar/Target_sparc.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*! @file Target_sparc.h
- * @brief Target_sparc Specification
- *
- * This file contains the specification of the Target_sparc class.
- */
-
-#ifndef __TARGET_SPARC_H__
-#define __TARGET_SPARC_H__
-
-#include <list>
-#include <string>
-#include "TargetBase.h"
-
-
-namespace Target {
-
- /*! @class Target_sparc
- *
- * This is the class for the sparc target.
- *
- */
- class Target_sparc: public TargetBase {
-
- public:
-
- /*!
- * This method constructs an Target_sparc instance.
- */
- Target_sparc( std::string targetName );
-
- /*!
- * This method destructs an Target_sparc instance.
- */
- virtual ~Target_sparc();
-
- /*!
- * This method determines whether the specified line from a
- * objdump file is a nop instruction.
- *
- * @param[in] line contains the object dump line to check
- * @param[out] size is set to the size in bytes of the nop
- *
- * @return Returns TRUE if the instruction is a nop, FALSE otherwise.
- */
- bool isNopLine(
- const char* const line,
- int& size
- );
-
- /*!
- * This method determines if the specified line from an
- * objdump file is a branch instruction.
- */
- bool isBranch(
- const char* const instruction
- );
-
- private:
-
- };
-
- //!
- //! @brief Constructor Helper
- //!
- //! This is a constructor helper for this class which can be used in support
- //! of factories.
- //!
- //! @param [in] Targetname is the name of the Target being constructed.
- //!
- //! @return This method constructs a new instance of the Target and returns
- //! that to the caller.
- //!
- TargetBase *Target_sparc_Constructor(
- std::string targetName
- );
-
-
-}
-#endif
diff --git a/covoar/TraceConverter.cc b/covoar/TraceConverter.cc
deleted file mode 100644
index 0f7a44e..0000000
--- a/covoar/TraceConverter.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/*! @file TraceReaderLogQEMU.cc
- * @brief TraceReaderLogQEMU Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the QEMU coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <getopt.h>
-
-#include "qemu-log.h"
-
-#include "TraceReaderLogQEMU.h"
-#include "TraceWriterQEMU.h"
-#include "TraceList.h"
-#include "ObjdumpProcessor.h"
-#include "app_common.h"
-#include "TargetFactory.h"
-
-char* progname;
-
-void usage()
-{
- fprintf(
- stderr,
- "Usage: %s [-v] -c CPU -e executable -t tracefile [-E logfile]\n",
- progname
- );
- exit(1);
-}
-
-int main(
- int argc,
- char** argv
-)
-{
- int opt;
- Trace::TraceReaderLogQEMU log;
- Trace::TraceWriterQEMU trace;
- const char *cpuname = "";
- const char *executable = "";
- const char *tracefile = "";
- const char *logname = "/tmp/qemu.log";
- Coverage::ExecutableInfo* executableInfo;
-
- //
- // Process command line options.
- //
- progname = argv[0];
-
- while ((opt = getopt(argc, argv, "c:e:l:L:t:v")) != -1) {
- switch (opt) {
- case 'c': cpuname = optarg; break;
- case 'e': executable = optarg; break;
- case 'l': logname = optarg; break;
- case 'L': dynamicLibrary = optarg; break;
- case 't': tracefile = optarg; break;
- case 'v': Verbose = true; break;
- default: usage();
- }
- }
-
- // Make sure we have all the required parameters
- if ( !cpuname ) {
- fprintf( stderr, "cpuname not specified\n" );
- usage();
- }
-
- if ( !executable ) {
- fprintf( stderr, "executable not specified\n" );
- usage();
- }
-
- if ( !tracefile ) {
- fprintf( stderr, "output trace file not specified\n" );
- usage();
- }
-
- // Create toolnames.
- TargetInfo = Target::TargetFactory( cpuname );
-
- if (dynamicLibrary)
- executableInfo = new Coverage::ExecutableInfo( executable, dynamicLibrary );
- else
- executableInfo = new Coverage::ExecutableInfo( executable );
-
- objdumpProcessor = new Coverage::ObjdumpProcessor();
-
- // If a dynamic library was specified, determine the load address.
- if (dynamicLibrary)
- executableInfo->setLoadAddress(
- objdumpProcessor->determineLoadAddress( executableInfo )
- );
-
- objdumpProcessor->loadAddressTable( executableInfo );
-
- log.processFile( logname );
-
- trace.writeFile( tracefile, &log );
-
-}
diff --git a/covoar/TraceList.cc b/covoar/TraceList.cc
deleted file mode 100644
index 514813b..0000000
--- a/covoar/TraceList.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "TraceList.h"
-#include <stdio.h>
-
-namespace Trace {
-
- TraceList::TraceList()
- {
- }
-
- TraceList::~TraceList()
- {
- }
-
- void TraceList::add(
- uint32_t lowAddressArg,
- uint32_t highAddressArg,
- exitReason_t why
- )
- {
- traceRange_t t;
-
- t.lowAddress = lowAddressArg;
- t.length = highAddressArg - lowAddressArg;
- t.exitReason = why;
-
- set.push_back( t );
- }
-
- void TraceList::ShowTrace( traceRange_t *t)
- {
- printf(
- "Start 0x%x, length 0x%03x Reason %d\n",
- t->lowAddress,
- t->length,
- t->exitReason
- );
- }
-
- void TraceList::ShowList()
- {
- ranges_t::iterator ritr;
- traceRange_t t;
-
- for ( ritr=set.begin(); ritr != set.end(); ritr++ ) {
- t = *ritr;
- ShowTrace( &t );
- }
- }
-
-}
diff --git a/covoar/TraceList.h b/covoar/TraceList.h
deleted file mode 100644
index 7fa1751..0000000
--- a/covoar/TraceList.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*! @file TraceList.h
- * @brief TraceList Specification
- *
- * This file contains the specification of the TraceList class.
- */
-
-#ifndef __TRACE_LIST_H__
-#define __TRACE_LIST_H__
-
-#include <stdint.h>
-#include <list>
-#include <string>
-
-namespace Trace {
-
- /*! @class TraceList
- *
- * This class defines XXX
- */
- class TraceList {
-
- public:
-
- /*!
- * This enumberated type defines an exit reason
- * for the end of a section.
- */
- typedef enum {
- EXIT_REASON_BRANCH_TAKEN,
- EXIT_REASON_BRANCH_NOT_TAKEN,
- EXIT_REASON_OTHER
- } exitReason_t;
-
- /*!
- * This type defines the information kept for each range.
- */
- typedef struct {
- /*!
- * This member variable contains the low address for the
- * trace range.
- */
- uint32_t lowAddress;
-
- /*!
- * This member variable contains the length of the trace
- * range.
- */
- uint16_t length;
-
- /*!
- * This member variable contains the reason that this
- * trace range ended.
- */
- exitReason_t exitReason;
- } traceRange_t;
-
- /*!
- * This member variable contains a list of CoverageRange instances.
- */
- typedef std::list<traceRange_t> ranges_t;
-
- /*!
- * This member variable contains a list of coverageRange
- * instaces.
- */
- ranges_t set;
-
- /*!
- * This method constructs a TraceList instance.
- */
- TraceList();
-
- /*!
- * This method destructs a TraceList instance.
- */
- ~TraceList();
-
- /*!
- * This method adds a range entry to the set of ranges.
- *
- * @param[in] lowAddressArg specifies the lowest address of the range
- * @param[in] highAddressArg specifies the highest address of the range
- * @param[in] why specifies the reason that the range was finished
- *
- */
- void add(
- uint32_t lowAddressArg,
- uint32_t highAddressArg,
- exitReason_t why
- );
-
- /*!
- * This method displays the trace information in the variable t.
- */
- void ShowTrace( traceRange_t *t);
-
-
- /*!
- * This method iterates through set displaying the data on the screen.
- */
- void ShowList();
-
- };
-
-}
-#endif
diff --git a/covoar/TraceReaderBase.cc b/covoar/TraceReaderBase.cc
deleted file mode 100644
index 6ca0557..0000000
--- a/covoar/TraceReaderBase.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-/*! @file TraceReaderBase.cc
- * @brief TraceReaderBase Implementation
- *
- * This file contains the implementation of the TraceReader base class.
- * All TraceReader implementations inherit from this.
- */
-
-#include "TraceReaderBase.h"
-
-namespace Trace {
-
- TraceReaderBase::TraceReaderBase()
- {
- }
-
- TraceReaderBase::~TraceReaderBase()
- {
- }
-}
diff --git a/covoar/TraceReaderBase.h b/covoar/TraceReaderBase.h
deleted file mode 100644
index cf1cd22..0000000
--- a/covoar/TraceReaderBase.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*! @file TraceReaderBase.h
- * @brief TraceReaderBase Specification
- *
- * This file contains the specification of the TraceReaderBase class.
- */
-
-#ifndef __TRACE_READER_BASE_H__
-#define __TRACE_READER_BASE_H__
-
-#include "TraceList.h"
-
-namespace Trace {
-
- /*! @class TraceReaderBase
- *
- * This is the specification of the TraceReader base class.
- * All TraceReader implementations inherit from this class.
- */
- class TraceReaderBase {
-
- public:
-
- /*!
- * Trace list that is filled by processFile.
- */
- TraceList Trace;
-
-
- /*!
- * This method constructs a TraceReaderBase instance.
- */
- TraceReaderBase();
-
- /*!
- * This method destructs a TraceReaderBase instance.
- */
- virtual ~TraceReaderBase();
-
- /*!
- * This method processes the coverage information from the input
- * @a file and adds it to the specified @a executableInformation.
- *
- * @param[in] file is the coverage file to process
- * @param[in] executableInformation is the information for an
- * associated executable
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- virtual bool processFile(
- const char* const file
- ) = 0;
- };
-
-}
-#endif
diff --git a/covoar/TraceReaderLogQEMU.cc b/covoar/TraceReaderLogQEMU.cc
deleted file mode 100644
index d92614a..0000000
--- a/covoar/TraceReaderLogQEMU.cc
+++ /dev/null
@@ -1,172 +0,0 @@
-/*! @file TraceReaderLogQEMU.cc
- * @brief TraceReaderLogQEMU Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the QEMU coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#include "qemu-log.h"
-
-#include "app_common.h"
-#include "TraceReaderBase.h"
-#include "TraceReaderLogQEMU.h"
-#include "TraceList.h"
-
-/* XXX really not always right */
-typedef uint32_t target_ulong;
-
-#include "qemu-traces.h"
-
-/* hack so this can compile on old Linux versions and FreeBSD */
-#if (__GNUC__ <= 2) || defined(__FreeBSD__)
-#define STAT stat
-#define OPEN fopen
-#else
-#define STAT stat64
-#define OPEN fopen64
-#endif
-
-
-namespace Trace {
-
- TraceReaderLogQEMU::TraceReaderLogQEMU()
- {
- }
-
- TraceReaderLogQEMU::~TraceReaderLogQEMU()
- {
- }
-
- bool TraceReaderLogQEMU::processFile(
- const char* const file
- )
- {
- bool done = false;
- QEMU_LOG_IN_Block_t first = { 0, "", "" };
- QEMU_LOG_IN_Block_t last = { 0, "", "" };
- QEMU_LOG_IN_Block_t nextExecuted = { 0, "", "" };
- uint32_t nextlogical;
- struct STAT statbuf;
- int status;
- FILE* logFile;
- int result;
-
- //
- // Verify that the log file has a non-zero size.
- //
- // NOTE: We prefer stat64 because some of the coverage files are HUGE!
- status = STAT( file, &statbuf );
- if (status == -1) {
- fprintf( stderr, "Unable to stat %s\n", file );
- return false;
- }
-
- if (statbuf.st_size == 0) {
- fprintf( stderr, "%s is 0 bytes long\n", file );
- return false;
- }
-
- //
- // Open the coverage file and discard the header.
- //
- logFile = OPEN( file, "r" );
- if (!logFile) {
- fprintf( stderr, "Unable to open %s\n", file );
- return false;
- }
-
-
- //
- // Discard Header section
- //
- if (! ReadUntilFound( logFile, QEMU_LOG_SECTION_END ) ) {
- fprintf( stderr, "Unable to locate end of log file header\n" );
- return false;
- }
-
- //
- // Find first IN block
- //
- if (! ReadUntilFound( logFile, QEMU_LOG_IN_KEY )){
- fprintf(stderr,"Error: Unable to locate first IN: Block in Log file \n");
- return false;
- }
-
- //
- // Read First Start Address
- //
- fgets(inputBuffer, MAX_LINE_LENGTH, logFile );
- result = sscanf(
- inputBuffer,
- "0x%08lx: %s %s\n",
- &first.address,
- first.instruction,
- first.data
- );
- if ( result < 2 )
- {
- fprintf(stderr, "Error Unable to Read Initial First Block\n" );
- done = true;
- }
-
- while (!done) {
-
- last = first;
-
- // Read until we get to the last instruction in the block.
- do {
- fgets(inputBuffer, MAX_LINE_LENGTH, logFile );
- result = sscanf(
- inputBuffer,
- "0x%08lx: %s %s\n",
- &last.address,
- last.instruction,
- last.data
- );
- } while( result > 1);
-
- nextlogical = objdumpProcessor->getAddressAfter(last.address);
-
- if (! ReadUntilFound( logFile, QEMU_LOG_IN_KEY )) {
- done = true;
- nextExecuted = last;
- } else {
- fgets(inputBuffer, MAX_LINE_LENGTH, logFile );
- result = sscanf(
- inputBuffer,
- "0x%08lx: %s %s\n",
- &nextExecuted.address,
- nextExecuted.instruction,
- nextExecuted.data
- );
- if ( result < 2 )
- {
- fprintf(stderr, "Error Unable to Read First Block\n" );
- }
- }
-
- // If the nextlogical was not found we are throwing away
- // the block; otherwise add the block to the trace list.
- if (nextlogical != 0) {
- TraceList::exitReason_t reason = TraceList::EXIT_REASON_OTHER;
-
- if ( objdumpProcessor->IsBranch( last.instruction ) ) {
- if ( nextExecuted.address == nextlogical ) {
- reason = TraceList::EXIT_REASON_BRANCH_NOT_TAKEN;
- } else {
- reason = TraceList::EXIT_REASON_BRANCH_TAKEN;
- }
- }
- Trace.add( first.address, nextlogical, reason );
- }
- first = nextExecuted;
- }
- fclose( logFile );
- return true;
- }
-}
diff --git a/covoar/TraceReaderLogQEMU.h b/covoar/TraceReaderLogQEMU.h
deleted file mode 100644
index c4877fd..0000000
--- a/covoar/TraceReaderLogQEMU.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*! @file TraceReaderLogQEMU.h
- * @brief TraceReaderLogQEMU Specification
- *
- * This file contains the specification of the TraceReaderLogQEMU class.
- */
-
-#ifndef __TRACE_READER_LOG_QEMU_H__
-#define __TRACE_READER_LOG_QEMU_H__
-
-#include "TraceReaderBase.h"
-
-namespace Trace {
-
- /*! @class TraceReaderLogQEMU
- *
- * This is the specification of the TraceReader base class.
- * All TraceReader implementations inherit from this class.
- */
- class TraceReaderLogQEMU: public TraceReaderBase {
-
- public:
-
-
- /*!
- * This method constructs a TraceReaderLogQEMU instance.
- */
- TraceReaderLogQEMU();
-
- /*!
- * This method destructs a TraceReaderLogQEMU instance.
- */
- virtual ~TraceReaderLogQEMU();
-
- /*!
- * This method processes the coverage information from the input
- * @a file and adds it to the specified @a executableInformation.
- *
- * @param[in] file is the coverage file to process
- * @param[in] executableInformation is the information for an
- * associated executable
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- virtual bool processFile(
- const char* const file
- );
- };
-
-}
-#endif
diff --git a/covoar/TraceWriterBase.cc b/covoar/TraceWriterBase.cc
deleted file mode 100644
index 2fa16dc..0000000
--- a/covoar/TraceWriterBase.cc
+++ /dev/null
@@ -1,20 +0,0 @@
-/*! @file TraceWriterBase.cc
- * @brief TraceWriterBase Implementation
- *
- * This file contains the implementation of the TraceWriter base class.
- * All TraceWriter implementations inherit from this.
- */
-
-#include "TraceWriterBase.h"
-
-namespace Trace {
-
- TraceWriterBase::TraceWriterBase()
- {
- }
-
- TraceWriterBase::~TraceWriterBase()
- {
- }
-
-}
diff --git a/covoar/TraceWriterBase.h b/covoar/TraceWriterBase.h
deleted file mode 100644
index 2d27d04..0000000
--- a/covoar/TraceWriterBase.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*! @file TraceWriterBase.h
- * @brief TraceWriterBase Specification
- *
- * This file contains the specification of the TraceWriterBase class.
- */
-
-#ifndef __TRACE_WRITER_BASE_H__
-#define __TRACE_WRITER_BASE_H__
-
-#include <stdint.h>
-#include "TraceReaderBase.h"
-
-namespace Trace {
-
- /*! @class TraceWriterBase
- *
- * This is the specification of the TraceWriter base class.
- * All TraceWriter implementations inherit from this class.
- */
- class TraceWriterBase {
-
- public:
-
- /*!
- * This method constructs a TraceWriterBase instance.
- */
- TraceWriterBase();
-
- /*!
- * This method destructs a TraceWriterBase instance.
- */
- virtual ~TraceWriterBase();
-
- /*!
- * This method writes the specified @a trace file.
- *
- * @param[in] file specifies the name of the file to write
- * @param[in] log structure where the trace data was read into
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- virtual bool writeFile(
- const char* const file,
- Trace::TraceReaderBase *log
- ) = 0;
- };
-
-}
-#endif
diff --git a/covoar/TraceWriterQEMU.cc b/covoar/TraceWriterQEMU.cc
deleted file mode 100644
index 89cfd01..0000000
--- a/covoar/TraceWriterQEMU.cc
+++ /dev/null
@@ -1,144 +0,0 @@
-/*! @file TraceWriterQEMU.cc
- * @brief TraceWriterQEMU Implementation
- *
- * This file contains the implementation of the functions supporting
- * reading the QEMU coverage data files.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-
-#include "app_common.h"
-#include "TraceWriterQEMU.h"
-#include "ExecutableInfo.h"
-#include "CoverageMap.h"
-
-/* XXX really not always right */
-typedef uint32_t target_ulong;
-
-#include "qemu-traces.h"
-
-/* hack so this can compile on old Linux versions and FreeBSD */
-#if (__GNUC__ <= 2) || defined(__FreeBSD__)
-#define STAT stat
-#define OPEN fopen
-#else
-#define STAT stat64
-#define OPEN fopen64
-#endif
-
-namespace Trace {
-
- TraceWriterQEMU::TraceWriterQEMU():
- TraceWriterBase()
- {
- }
-
- TraceWriterQEMU::~TraceWriterQEMU()
- {
- }
-
- bool TraceWriterQEMU::writeFile(
- const char* const file,
- Trace::TraceReaderBase *log
- )
- {
- struct trace_header header;
- int status;
- FILE* traceFile;
- uint8_t taken;
- uint8_t notTaken;
-
- taken = TargetInfo->qemuTakenBit();
- notTaken = TargetInfo->qemuNotTakenBit();
-
- //
- // Verify that the TraceList has a non-zero size.
- //
- if ( log->Trace.set.begin() == log->Trace.set.end() ){
- fprintf( stderr, "ERROR: Empty TraceList\n" );
- return false;
- }
-
- //
- // Open the trace file.
- //
- traceFile = OPEN( file, "w" );
- if (!traceFile) {
- fprintf( stderr, "Unable to open %s\n", file );
- return false;
- }
-
- //
- // Write the Header to the file
- //
- sprintf( header.magic, "%s", QEMU_TRACE_MAGIC );
- header.version = QEMU_TRACE_VERSION;
- header.kind = QEMU_TRACE_KIND_RAW; // XXX ??
- header.sizeof_target_pc = 32;
- header.big_endian = false;
- header.machine[0] = 0; // XXX ??
- header.machine[1] = 0; // XXX ??
- status = fwrite( &header, sizeof(trace_header), 1, traceFile );
- if (status != 1) {
- fprintf( stderr, "Unable to write header to %s\n", file );
- return false;
- }
-
- if (Verbose)
- fprintf(
- stderr,
- "magic = %s\n"
- "version = %d\n"
- "kind = %d\n"
- "sizeof_target_pc = %d\n"
- "big_endian = %d\n"
- "machine = %02x:%02x\n",
- header.magic,
- header.version,
- header.kind,
- header.sizeof_target_pc,
- header.big_endian,
- header.machine[0], header.machine[1]
- );
-
- //
- // Loop through log and write each entry.
- //
- struct trace_entry32 entry;
- TraceList::ranges_t::iterator itr;
-
- for (itr = log->Trace.set.begin(); (itr != log->Trace.set.end()); itr++ ){
- entry.pc = itr->lowAddress;
- entry.size = itr-> length;
- entry.op = TRACE_OP_BLOCK;
- switch (itr->exitReason) {
- case TraceList::EXIT_REASON_BRANCH_TAKEN:
- entry.op |= taken;
- break;
- case TraceList::EXIT_REASON_BRANCH_NOT_TAKEN:
- entry.op |= notTaken;
- break;
- case TraceList::EXIT_REASON_OTHER:
- break;
- default:
- fprintf(stderr, "Unknown exit Reason\n");
- exit(1);
- break;
- }
-
- if ( Verbose )
- fprintf(stderr, "%x %x %x\n", entry.pc, entry.size, entry.op);
-
- status = fwrite( &entry, sizeof(entry), 1, traceFile );
- if (status != 1) {
- fprintf( stderr, "Unable to emtry to %s\n", file );
- return false;
- }
- }
-
- fclose( traceFile );
- return true;
- }
-}
diff --git a/covoar/TraceWriterQEMU.h b/covoar/TraceWriterQEMU.h
deleted file mode 100644
index 3b1c254..0000000
--- a/covoar/TraceWriterQEMU.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*! @file TraceWriterQEMU.h
- * @brief TraceWriterQEMU Specification
- *
- * This file contains the specification of the TraceWriterQEMU class.
- */
-
-#ifndef __TRACE_WRITER_QEMU_H__
-#define __TRACE_WRITER_QEMU_H__
-
-#include <stdint.h>
-#include "TraceReaderBase.h"
-#include "TraceWriterBase.h"
-
-namespace Trace {
-
- /*! @class TraceWriterQEMU
- *
- * This is the specification of the TraceWriter base class.
- * All TraceWriter implementations inherit from this class.
- */
- class TraceWriterQEMU: public TraceWriterBase {
-
- public:
-
- /*!
- * This method constructs a TraceWriterQEMU instance.
- */
- TraceWriterQEMU();
-
- /*!
- * This method destructs a TraceWriterQEMU instance.
- */
- virtual ~TraceWriterQEMU();
-
- /*!
- * This method writes the specified @a trace file.
- *
- * @param[in] file specifies the name of the file to write
- * @param[in] log structure where the trace data was read into
- *
- * @return Returns TRUE if the method succeeded and FALSE if it failed.
- */
- bool writeFile(
- const char* const file,
- Trace::TraceReaderBase *log
- );
- };
-
-}
-#endif
diff --git a/covoar/app_common.cc b/covoar/app_common.cc
deleted file mode 100644
index d62e435..0000000
--- a/covoar/app_common.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "app_common.h"
-#include "DesiredSymbols.h"
-#include "Explanations.h"
-
-/* hack so this can compile on old Linux versions and FreeBSD */
-#if (__GNUC__ <= 2) || defined(__FreeBSD__)
-#define STAT stat
-#define OPEN fopen
-#else
-#define STAT stat64
-#define OPEN fopen64
-#endif
-
-/*
- * Global variables for the program
- */
-Coverage::Explanations* AllExplanations = NULL;
-Coverage::ObjdumpProcessor* objdumpProcessor = NULL;
-Coverage::DesiredSymbols* SymbolsToAnalyze = NULL;
-bool Verbose = false;
-const char* outputDirectory = ".";
-bool BranchInfoAvailable = false;
-Target::TargetBase* TargetInfo = NULL;
-const char* dynamicLibrary = NULL;
-const char* projectName = NULL;
-char inputBuffer[MAX_LINE_LENGTH];
-char inputBuffer2[MAX_LINE_LENGTH];
-
-
-bool FileIsNewer(
- const char *f1,
- const char *f2
-)
-{
- struct STAT buf1, buf2;
-
- if (STAT( f2, &buf2 ) == -1)
- return true;
-
- if (STAT( f1, &buf1 ) == -1)
- exit (1);
-
- if (buf1.st_mtime > buf2.st_mtime)
- return true;
-
- return false;
-}
-
-bool FileIsReadable( const char *f1 )
-{
- struct STAT buf1;
-
- if (STAT( f1, &buf1 ) == -1)
- return false;
-
- if (buf1.st_size == 0)
- return false;
-
- // XXX check permission ??
- return true;
-}
-
-bool ReadUntilFound( FILE *file, const char *line )
-{
- char discardBuff[100];
- size_t len = strlen( line );
-
- do {
- if ( !fgets( discardBuff, 99, file ) )
- return false;
-
- if ( strncmp( discardBuff, line, len ) == 0 )
- return true;
- } while (1);
-}
-
diff --git a/covoar/app_common.h b/covoar/app_common.h
deleted file mode 100644
index d28bfd0..0000000
--- a/covoar/app_common.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __APP_COMMON_h
-#define __APP_COMMON_h
-
-#include <list>
-
-#include "DesiredSymbols.h"
-#include "Explanations.h"
-#include "TargetBase.h"
-
-extern Coverage::Explanations* AllExplanations;
-extern Coverage::ObjdumpProcessor* objdumpProcessor;
-extern Coverage::DesiredSymbols* SymbolsToAnalyze;
-extern bool Verbose;
-extern const char* outputDirectory;
-extern bool BranchInfoAvailable;
-extern Target::TargetBase* TargetInfo;
-extern const char* dynamicLibrary;
-extern const char* projectName;
-
-#define MAX_LINE_LENGTH 512
-extern char inputBuffer[MAX_LINE_LENGTH];
-extern char inputBuffer2[MAX_LINE_LENGTH];
-
-
-bool FileIsNewer( const char *f1, const char *f2 );
-bool FileIsReadable( const char *f1 );
-bool ReadUntilFound( FILE *file, const char *line );
-
-#endif
diff --git a/covoar/configFile.txt b/covoar/configFile.txt
deleted file mode 100644
index d69cda5..0000000
--- a/covoar/configFile.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# This is a comment.
-#
-
-projectName = RTEMS 4.10
-
-verbose = no
-
-verbose
-
-verbose yes
-
-bad_option = no
-
-verbose = yes # comment
-
-verbose = no # comment
-
- verbose = yes
-# next line is filled with spaces
-
- # comment
diff --git a/covoar/configfile_test.cc b/covoar/configfile_test.cc
deleted file mode 100644
index 253c248..0000000
--- a/covoar/configfile_test.cc
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "ConfigFile.h"
-#include <stdio.h>
-
-Configuration::Options_t Options[] = {
- { "projectName", NULL },
- { "verbose", NULL },
- { NULL, NULL }
-};
-
-int main(
- int argc,
- char *argv[]
-)
-{
- Configuration::FileReader *config;
-
- config = new Configuration::FileReader(Options);
-
- config->processFile( "configFile.txt" );
- config->printOptions();
-
-}
-
diff --git a/covoar/coverage_converter.cc b/covoar/coverage_converter.cc
deleted file mode 100644
index 8144d93..0000000
--- a/covoar/coverage_converter.cc
+++ /dev/null
@@ -1,220 +0,0 @@
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <netdb.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "app_common.h"
-#include "CoverageFactory.h"
-#include "CoverageMap.h"
-
-/*
- * Variables to control global behavior
- */
-Coverage::CoverageReaderBase* coverageReader = NULL;
-Coverage::CoverageWriterBase* coverageWriter = NULL;
-uint32_t highAddress = 0xffffffff;
-Coverage::CoverageFormats_t inputFormat;
-uint32_t lowAddress = 0xffffffff;
-char* progname;
-
-/*
- * Global variables for the program
- */
-Coverage::CoverageMapBase *CoverageMap = NULL;
-
-/*
- * Convert string to int with status out
- */
-
-bool stringToUint32(
- const char* s,
- int base,
- uint32_t* n
-)
-{
- long long result;
-
- if (!n)
- return false;
-
- errno = 0;
- *n = 0;
-
- result = strtoll( s, NULL, base );
-
- if ((result == 0) && errno)
- return false;
-
- if ((result == LLONG_MAX) && (errno == ERANGE))
- return false;
-
- if ((result == LLONG_MIN) && (errno == ERANGE))
- return false;
-
- *n = (uint32_t)result;
- return true;
-}
-
-/*
- * Print program usage message
- */
-void usage()
-{
- fprintf(
- stderr,
- "Usage: %s [-v] -l ADDRESS -h ADDRESS coverage_in coverage_out\n"
- "\n"
- " -l low address - low address of range to merge\n"
- " -l high address - high address of range to merge\n"
- " -f format - coverage files are in <format> (Qemu)\n"
- " -v - verbose at initialization\n"
- "\n",
- progname
- );
-}
-
-#define PrintableString(_s) \
- ((!(_s)) ? "NOT SET" : (_s))
-
-int main(
- int argc,
- char** argv
-)
-{
- char* format = NULL;
- const char* coverageFile;
- const char* coverageIn;
- int opt;
-
- //
- // Process command line options.
- //
- progname = argv[0];
-
- while ((opt = getopt(argc, argv, "f:h:l:v")) != -1) {
- switch (opt) {
- case 'v': Verbose = 1; break;
- case 'f':
- inputFormat = Coverage::CoverageFormatToEnum(optarg);
- format = optarg;
- break;
- case 'l':
- if (!stringToUint32( optarg, 16, &lowAddress )) {
- fprintf( stderr, "ERROR: Low address is not a hexadecimal number\n" );
- usage();
- exit(-1);
- }
- break;
- case 'h':
- if (!stringToUint32( optarg, 16, &highAddress )) {
- fprintf( stderr, "ERROR: High address is not a hexadecimal number\n" );
- usage();
- exit(-1);
- }
- break;
- default: /* '?' */
- usage();
- exit( -1 );
- }
- }
-
- if ((argc - optind) != 2) {
- fprintf( stderr, "ERROR: Must provide input and output files\n" );
- exit(1);
- }
-
- coverageIn = argv[optind];
- coverageFile = argv[optind + 1];
-
- if (Verbose) {
- fprintf( stderr, "Verbose : %d\n", Verbose );
- fprintf( stderr, "Input Format : %s\n", format );
- fprintf( stderr, "Input File : %s\n", coverageIn );
- fprintf( stderr, "Output Format : %s\n", "RTEMS" );
- fprintf( stderr, "Output File : %s\n", coverageFile );
- fprintf( stderr, "low address : 0x%08x\n", lowAddress );
- fprintf( stderr, "high address : 0x%08x\n", highAddress );
- fprintf( stderr, "\n" );
- }
-
- //
- // Validate inputs.
- //
-
- // Validate format.
- if (!format) {
- fprintf( stderr, "ERROR: input format must be given.\n\n" );
- usage();
- exit(-1);
- }
-
- // Validate address range
- if (lowAddress == 0xffffffff) {
- fprintf( stderr, "ERROR: Low address not specified.\n\n" );
- usage();
- exit(-1);
- }
-
- if (highAddress == 0xffffffff) {
- fprintf( stderr, "ERROR: High address not specified.\n\n" );
- usage();
- exit(-1);
- }
-
- if (lowAddress >= highAddress) {
- fprintf( stderr, "ERROR: Low address >= high address.\n\n" );
- usage();
- exit(-1);
- }
-
- //
- // Create data to support conversion.
- //
-
- // Create coverage map.
- CoverageMap = new Coverage::CoverageMap( lowAddress, highAddress );
- if (!CoverageMap) {
- fprintf( stderr, "ERROR: Unable to create coverage map.\n\n" );
- exit(-1);
- }
-
- // Create coverage writer.
- coverageWriter =
- Coverage::CreateCoverageWriter(Coverage::COVERAGE_FORMAT_RTEMS);
- if (!coverageWriter) {
- fprintf( stderr, "ERROR: Unable to create coverage file writer.\n\n" );
- exit(-1);
- }
-
- // Create coverage reader.
- coverageReader = CreateCoverageReader( inputFormat );
- if (!coverageReader) {
- fprintf( stderr, "ERROR: Unable to create input file reader.\n\n" );
- exit(-1);
- }
-
- // Now get to some real work.
- if (Verbose)
- fprintf( stderr, "Processing %s\n", coverageIn );
- coverageReader->processFile( coverageIn, CoverageMap );
-
- if (Verbose)
- fprintf(
- stderr, "Writing coverage file (%s)\n", coverageFile );
- coverageWriter->writeFile(
- coverageFile,
- CoverageMap,
- lowAddress,
- highAddress
- );
-
- return 0;
-}
diff --git a/covoar/covmerge.cc b/covoar/covmerge.cc
deleted file mode 100644
index e283774..0000000
--- a/covoar/covmerge.cc
+++ /dev/null
@@ -1,541 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "app_common.h"
-#include "CoverageFactory.h"
-#include "CoverageMap.h"
-#include "CoverageRanges.h"
-#include "Explanations.h"
-#include "ObjdumpProcessor.h"
-#include "Reports.h"
-
-/*
- * Variables to control global behavior
- */
-int verbose = 0;
-Coverage::CoverageFormats_t coverageFormat;
-char *mergedCoverageFile = NULL;
-char *branchReportFile = NULL;
-char *coverageReportFile = NULL;
-char *sizeReportFile = NULL;
-uint32_t lowAddress = 0xffffffff;
-uint32_t highAddress = 0xffffffff;
-
-char *target = NULL;
-char *executable = NULL;
-char *explanations = NULL;
-char *noExplanations = NULL;
-char *progname;
-
-/*
- * Global variables for the program
- */
-Coverage::CoverageMapBase *CoverageMap = NULL;
-Coverage::CoverageReaderBase *CoverageReader = NULL;
-Coverage::CoverageWriterBase *CoverageWriter = NULL;
-Coverage::ObjdumpProcessor *ObjdumpProcessor = NULL;
-Coverage::CoverageRanges *Ranges = NULL;
-Coverage::Explanations *Explanations = NULL;
-
-int BranchesAlwaysTaken = 0;
-bool BranchesFound = false;
-int BranchesNeverTaken = 0;
-int UncoveredRanges = 0;
-
-/*
- * Set of addresses we need source line number for
- */
-std::list<uint32_t> AddressesNeedingSourceLine;
-
-/*
- * Convert string to int with status out
- */
-
-bool stringToUint32(
- const char *s,
- int base,
- uint32_t *n
-)
-{
- long long result;
-
- if ( !n )
- return false;
-
- errno = 0;
- *n = 0;
-
- result = strtoll( s, NULL, base );
-
- if ( (result == 0) && errno )
- return false;
-
- if ( (result == LLONG_MAX) && (errno == ERANGE))
- return false;
-
- if ( (result == LLONG_MIN) && (errno == ERANGE))
- return false;
-
- *n = (uint32_t)result;
- return true;
-}
-
-/*
- * Print program usage message
- */
-void usage()
-{
- fprintf(
- stderr,
- "Usage: %s [-v] [-t] [-m file] -T TARGET [-e EXECUTABLE]-l ADDRESS -h ADDRESS coverage1... coverageN\n"
- "\n"
- " -l low address - low address of range to merge\n"
- " -l high address - high address of range to merge\n"
- " -f format - coverage files are in <format> "
- "(RTEMS, TSIM or Skyeye)\n"
- " -m FILE - optional merged coverage file to write\n"
- " -r REPORT - optional coverage report to write\n"
- " -s REPORT - optional size report to write\n"
- " -T TARGET - target name\n"
- " -e EXECUTABLE - name of executable to get symbols from\n"
- " -E EXPLANATIONS - name of file with explanations\n"
- " -v - verbose at initialization\n"
- "\n",
- progname
- );
-}
-
-/*
- * Look over the coverage map and compute uncovered ranges and branches
- */
-void ComputeUncovered(void)
-{
- uint32_t a, la, ha;
- std::list<Coverage::CoverageRange>::iterator it;
-
- a = lowAddress;
- while (a < highAddress) {
-
- /*
- * Find all the unexecuted addresses and add them to the range.
- */
- if (!CoverageMap->wasExecuted( a )) {
- la = a;
- for (ha=a+1; ha<=highAddress && !CoverageMap->wasExecuted(ha); ha++)
- ;
- ha--;
-
- UncoveredRanges++;
- Ranges->add( la, ha );
- AddressesNeedingSourceLine.push_back( la );
- AddressesNeedingSourceLine.push_back( ha );
- a = ha + 1;
- }
-
- else if (CoverageMap->isBranch( a )) {
- BranchesFound = true;
- la = a;
- for (ha=a+1;
- ha<=highAddress && !CoverageMap->isStartOfInstruction(ha);
- ha++)
- ;
- ha--;
-
- if (CoverageMap->wasAlwaysTaken( la )) {
- BranchesAlwaysTaken++;
- AddressesNeedingSourceLine.push_back( la );
- }
- else if (CoverageMap->wasNeverTaken( la )) {
- BranchesNeverTaken++;
- AddressesNeedingSourceLine.push_back( la );
- }
- a = ha + 1;
- }
- else
- a++;
- }
-}
-
-/*
- * Find source lines for addresses
- */
-void FindSourceForAddresses(void)
-{
- FILE *tmpfile;
- std::list<uint32_t>::iterator it;
-
- /*
- * Write a temporary file with ranges
- */
- if ( verbose )
- fprintf( stderr, "Writing ranges.tmp input to addr2line\n" );
-
- tmpfile = fopen( "ranges.tmp", "w" );
- if ( !tmpfile ) {
- fprintf( stderr, "Unable to open %s\n\n", "ranges.tmp" );
- exit(-1);
- }
-
- for (it = AddressesNeedingSourceLine.begin() ;
- it != AddressesNeedingSourceLine.end() ;
- it++ ) {
- fprintf(tmpfile, "0x%08x\n", *it);
- }
-
- fclose( tmpfile );
-
- /*
- * Generate a file with the addr2line mapping
- */
- if ( verbose )
- fprintf( stderr, "Running addr2line\n" );
-
- {
- char command[512];
- sprintf(
- command,
- "%s -e %s <%s | dos2unix >%s",
- Tools->getAddr2line(),
- executable,
- "ranges.tmp",
- "ranges01.tmp"
- );
- if ( system( command ) ) {
- fprintf( stderr, "addr2line command (%s) failed\n", command );
- exit( -1 );
- }
- }
-
- /*
- * Go back over the ranges, read the addr2line output, and correlate it.
- */
- if ( verbose )
- fprintf( stderr, "Merging addr2line output into range\n" );
-
- tmpfile = fopen( "ranges01.tmp", "r" );
- if ( !tmpfile ) {
- fprintf( stderr, "Unable to open %s\n\n", "ranges01.tmp" );
- exit(-1);
- }
-
- for (it = AddressesNeedingSourceLine.begin() ;
- it != AddressesNeedingSourceLine.end() ;
- it++ ) {
- char buffer[512];
- char *cStatus;
-
- cStatus = fgets( buffer, 512, tmpfile );
- if ( cStatus == NULL ) {
- fprintf( stderr, "Out of sync in addr2line output\n" );
- exit( -1 );
- }
- buffer[ strlen(buffer) - 1] = '\0';
-
- CoverageMap->setSourceLine( *it, std::string( buffer ) );
- }
- fclose( tmpfile );
-}
-
-#define PrintableString(_s) \
- ((!(_s)) ? "NOT SET" : (_s))
-
-int main(
- int argc,
- char **argv
-)
-{
- int opt;
- int i;
- char *format = NULL;
-
- progname = argv[0];
-
- while ((opt = getopt(argc, argv, "b:e:E:f:h:l:m:r:s:T:v")) != -1) {
- switch (opt) {
- case 'b': branchReportFile = optarg; break;
- case 'e': executable = optarg; break;
- case 'E': explanations = optarg; break;
- case 'm': mergedCoverageFile = optarg; break;
- case 'r': coverageReportFile = optarg; break;
- case 's': sizeReportFile = optarg; break;
- case 'T': target = optarg; break;
- case 'v': verbose = 1; break;
- case 'f':
- coverageFormat = Coverage::CoverageFormatToEnum(optarg);
- format = optarg;
- break;
- case 'l':
- if ( ! stringToUint32( optarg, 16, &lowAddress ) ) {
- fprintf( stderr, "Low address is not a hexadecimal number\n" );
- usage();
- exit(-1);
- }
- break;
- case 'h':
- if ( ! stringToUint32( optarg, 16, &highAddress ) ) {
- fprintf( stderr, "High address is not a hexadecimal number\n" );
- usage();
- exit(-1);
- }
- break;
- default: /* '?' */
- usage();
- exit( -1 );
- }
- }
- if ( verbose ) {
- fprintf( stderr, "verbose : %d\n", verbose );
- fprintf( stderr, "Coverage Format : %s\n", format );
- fprintf( stderr, "low address : 0x%08x\n", lowAddress );
- fprintf( stderr, "high address : 0x%08x\n", highAddress );
- fprintf( stderr, "Target : %s\n", PrintableString(target) );
- fprintf( stderr, "executable : %s\n", PrintableString(executable) );
- fprintf( stderr, "merged coverage : %s\n",
- PrintableString(mergedCoverageFile) );
- fprintf( stderr, "\n" );
- }
-
- /*
- * Target name must be set
- */
- if ( !target ) {
- fprintf( stderr, "target must be given.\n\n" );
- usage();
- exit(-1);
- }
-
- /*
- * Validate format
- */
- if ( !format ) {
- fprintf( stderr, "coverage format report must be given.\n\n" );
- usage();
- exit(-1);
- }
-
- /*
- * Validate address range
- */
- if ( lowAddress == 0xffffffff ) {
- fprintf( stderr, "Low address not specified.\n\n" );
- usage();
- exit(-1);
- }
-
- if ( highAddress == 0xffffffff ) {
- fprintf( stderr, "High address not specified.\n\n" );
- usage();
- exit(-1);
- }
-
- if ( lowAddress >= highAddress ) {
- fprintf( stderr, "Low address >= high address.\n\n" );
- usage();
- exit(-1);
- }
-
- /*
- * Create toolnames based on target
- */
- TargetInfo = Target::TargetFactory( target );
-
- /*
- * Create a ranges set
- */
- Ranges = new Coverage::CoverageRanges();
- Explanations = new Coverage::Explanations();
-
- Explanations->load( explanations );
-
- /*
- * Create coverage map
- */
- CoverageMap = new Coverage::CoverageMap( lowAddress, highAddress );
- if ( !CoverageMap ) {
- fprintf( stderr, "Unable to create coverage map.\n\n" );
- exit(-1);
- }
-
- /*
- * Create input
- */
- CoverageReader = Coverage::CreateCoverageReader(coverageFormat);
- if ( !CoverageReader ) {
- fprintf( stderr, "Unable to create coverage file reader.\n\n" );
- exit(-1);
- }
-
- /*
- * Create the objdump processor
- */
- ObjdumpProcessor = new Coverage::ObjdumpProcessor();
-
- /*
- * Create writer
- *
- * NOTE: We ALWAYS write the merged coverage in RTEMS format.
- */
- CoverageWriter = Coverage::CreateCoverageWriter(
- Coverage::COVERAGE_FORMAT_RTEMS
- );
- if ( !CoverageWriter ) {
- fprintf( stderr, "Unable to create coverage file writer.\n\n" );
- exit(-1);
- }
-
- /*
- * Add in the objdump before reading the coverage information. We may
- * want to take advantage of the information line where instructions
- * begin.
- */
- if ( executable ) {
- if ( verbose )
- fprintf( stderr, "Reading objdump of %s\n", executable );
- ObjdumpProcessor->initialize( executable, CoverageMap );
- }
-
- /*
- * Now get to some real work
- */
- if ( verbose )
- fprintf( stderr, "Processing coverage files\n" );
- for ( i=optind ; i < argc ; i++ ) {
- //fprintf( stderr, "Processing %s\n", argv[i] );
- CoverageReader->ProcessFile( argv[i], CoverageMap );
- }
-
- /*
- * Now to write some output
- */
- if ( mergedCoverageFile ) {
- if ( verbose )
- fprintf(
- stderr,
- "Writing merged coverage file (%s)\n",
- mergedCoverageFile
- );
- CoverageWriter->writeFile(
- mergedCoverageFile,
- CoverageMap,
- lowAddress,
- highAddress
- );
- }
-
- /*
- * Marks nops as executed when they are surrounded by executed instructions.
- */
- ObjdumpProcessor->markNopsAsExecuted( CoverageMap );
-
- /*
- * Iterate over the coverage map and determine the uncovered
- * ranges and branches.
- */
- ComputeUncovered();
-
- /*
- * Look up the source file and line number for the addresses
- * of interest.
- */
- FindSourceForAddresses();
-
- /*
- * Generate report of ranges not executed
- */
- if ( coverageReportFile ) {
- if ( verbose )
- fprintf( stderr, "Writing coverage report (%s)\n", coverageReportFile );
- WriteCoverageReport( coverageReportFile );
-
- /*
- * Let the user know how many cases there were
- */
- printf( "%d uncovered ranges found\n", UncoveredRanges );
- }
-
- /*
- * Generate report of branches taken/not taken
- */
- if ( branchReportFile ) {
- if ( verbose )
- fprintf( stderr, "Writing branch report (%s)\n", branchReportFile );
- WriteBranchReport( branchReportFile, lowAddress, highAddress );
-
- /*
- * Let the user know how many branch cases were found
- */
- if (!BranchesFound)
- printf( "No branch information found\n" );
- else {
- printf(
- "%d uncovered branches found\n",
- BranchesAlwaysTaken + BranchesNeverTaken
- );
- printf(
- " %d branches always taken\n", BranchesAlwaysTaken
- );
- printf(
- " %d branches never taken\n", BranchesNeverTaken
- );
- }
- }
-
- /*
- * Simple formatted report of size of ranges
- */
- if ( sizeReportFile ) {
- if ( verbose )
- fprintf( stderr, "Writing size report (%s)\n", sizeReportFile );
- WriteSizeReport( sizeReportFile );
- }
-
- /*
- * Generate annotated assembly file
- */
- if ( verbose )
- fprintf( stderr, "Writing annotated report (%s)\n", "annotated.txt" );
- WriteAnnotatedReport( "annotated.txt", lowAddress, highAddress );
-
- /*
- * write explanations that were not found
- */
- std::string str = explanations;
- str = str + ".NotFound";
- if ( verbose )
- fprintf( stderr, "Writing Not Found Report (%s)\n", str.c_str() );
- Explanations->writeNotFound(str.c_str());
-
- /*
- * Calculate coverage percentage
- */
- {
- uint32_t a;
- uint32_t notExecuted = 0;
- double percentage;
-
- for ( a=lowAddress ; a < highAddress ; a++ ) {
- if ( !CoverageMap->wasExecuted( a ) )
- notExecuted++;
- }
-
- percentage = (double) notExecuted;
- percentage /= (double) (highAddress - lowAddress);
- percentage *= 100.0;
- printf( "Bytes Analyzed : %d\n", highAddress - lowAddress );
- printf( "Bytes Not Executed : %d\n", notExecuted );
- printf( "Percentage Executed : %5.4g\n", 100.0 - percentage );
- printf( "Percentage Not Executed : %5.4g\n", percentage );
- }
-
- return 0;
-}
diff --git a/covoar/covoar.cc b/covoar/covoar.cc
deleted file mode 100644
index 78954fd..0000000
--- a/covoar/covoar.cc
+++ /dev/null
@@ -1,507 +0,0 @@
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <list>
-#include <netdb.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "app_common.h"
-#include "CoverageFactory.h"
-#include "CoverageMap.h"
-#include "DesiredSymbols.h"
-#include "ExecutableInfo.h"
-#include "Explanations.h"
-#include "ObjdumpProcessor.h"
-#include "ReportsBase.h"
-#include "TargetFactory.h"
-#include "GcovData.h"
-
-/*
- * Variables to control general behavior
- */
-const char* coverageFileExtension = NULL;
-std::list<std::string> coverageFileNames;
-int coverageExtensionLength = 0;
-Coverage::CoverageFormats_t coverageFormat;
-Coverage::CoverageReaderBase* coverageReader = NULL;
-char* executable = NULL;
-const char* executableExtension = NULL;
-int executableExtensionLength = 0;
-std::list<Coverage::ExecutableInfo*> executablesToAnalyze;
-const char* explanations = NULL;
-char* progname;
-const char* symbolsFile = NULL;
-const char* gcnosFileName = NULL;
-char gcnoFileName[FILE_NAME_LENGTH];
-char gcdaFileName[FILE_NAME_LENGTH];
-char gcovBashCommand[256];
-const char* target = NULL;
-const char* format = NULL;
-FILE* gcnosFile = NULL;
-Gcov::GcovData* gcovFile;
-
-/*
- * Print program usage message
- */
-void usage()
-{
- fprintf(
- stderr,
- "Usage: %s [-v] -T TARGET -f FORMAT [-E EXPLANATIONS] -1 EXECUTABLE coverage1 ... coverageN\n"
- "--OR--\n"
- "Usage: %s [-v] -T TARGET -f FORMAT [-E EXPLANATIONS] -e EXE_EXTENSION -c COVERAGEFILE_EXTENSION EXECUTABLE1 ... EXECUTABLE2\n"
- "\n"
- " -v - verbose at initialization\n"
- " -T TARGET - target name\n"
- " -f FORMAT - coverage file format "
- "(RTEMS, QEMU, TSIM or Skyeye)\n"
- " -E EXPLANATIONS - name of file with explanations\n"
- " -s SYMBOLS_FILE - name of file with symbols of interest\n"
- " -1 EXECUTABLE - name of executable to get symbols from\n"
- " -e EXE_EXTENSION - extension of the executables to analyze\n"
- " -c COVERAGEFILE_EXTENSION - extension of the coverage files to analyze\n"
- " -g GCNOS_LIST - name of file with list of *.gcno files\n"
- " -p PROJECT_NAME - name of the project\n"
- " -C ConfigurationFileName - name of configuration file\n"
- " -O Output_Directory - name of output directory (default=."
- "\n",
- progname,
- progname
- );
-}
-
-#define PrintableString(_s) \
- ((!(_s)) ? "NOT SET" : (_s))
-
-/*
- * Configuration File Support
- */
-#include "ConfigFile.h"
-Configuration::FileReader *CoverageConfiguration;
-Configuration::Options_t Options[] = {
- { "explanations", NULL },
- { "format", NULL },
- { "symbolsFile", NULL },
- { "outputDirectory", NULL },
- { "executableExtension", NULL },
- { "coverageExtension", NULL },
- { "gcnosFile", NULL },
- { "target", NULL },
- { "verbose", NULL },
- { "projectName", NULL },
- { NULL, NULL }
-};
-
-bool isTrue(const char *value)
-{
- if ( !value ) return false;
- if ( !strcmp(value, "true") ) return true;
- if ( !strcmp(value, "TRUE") ) return true;
- if ( !strcmp(value, "yes") ) return true;
- if ( !strcmp(value, "YES") ) return true;
- return false;
-}
-
-#define GET_BOOL(_opt, _val) \
- if (isTrue(CoverageConfiguration->getOption(_opt))) \
- _val = true;
-
-#define GET_STRING(_opt, _val) \
- do { \
- const char *_t; \
- _t = CoverageConfiguration->getOption(_opt); \
- if ( _t ) _val = _t; \
- } while(0)
-
-
-void check_configuration(void)
-{
- GET_BOOL( "verbose", Verbose );
-
- GET_STRING( "format", format );
- GET_STRING( "target", target );
- GET_STRING( "explanations", explanations );
- GET_STRING( "symbolsFile", symbolsFile );
- GET_STRING( "outputDirectory", outputDirectory );
- GET_STRING( "executableExtension", executableExtension );
- GET_STRING( "coverageExtension", coverageFileExtension );
- GET_STRING( "gcnosFile", gcnosFileName );
- GET_STRING( "projectName", projectName );
-
- // Now calculate some values
- if ( coverageFileExtension )
- coverageExtensionLength = strlen( coverageFileExtension );
-
- if ( executableExtension )
- executableExtensionLength = strlen( executableExtension );
-
- if ( format )
- coverageFormat = Coverage::CoverageFormatToEnum( format );
-}
-
-int main(
- int argc,
- char** argv
-)
-{
- std::list<std::string>::iterator citr;
- std::string coverageFileName;
- std::list<Coverage::ExecutableInfo*>::iterator eitr;
- Coverage::ExecutableInfo* executableInfo = NULL;
- int i;
- int opt;
- const char* singleExecutable = NULL;
-
- CoverageConfiguration = new Configuration::FileReader(Options);
-
- //
- // Process command line options.
- //
- progname = argv[0];
-
- while ((opt = getopt(argc, argv, "C:1:L:e:c:g:E:f:s:T:O:p:v")) != -1) {
- switch (opt) {
- case 'C': CoverageConfiguration->processFile( optarg ); break;
- case '1': singleExecutable = optarg; break;
- case 'L': dynamicLibrary = optarg; break;
- case 'e': executableExtension = optarg; break;
- case 'c': coverageFileExtension = optarg; break;
- case 'g': gcnosFileName = optarg; break;
- case 'E': explanations = optarg; break;
- case 'f': format = optarg; break;
- case 's': symbolsFile = optarg; break;
- case 'T': target = optarg; break;
- case 'O': outputDirectory = optarg; break;
- case 'v': Verbose = true; break;
- case 'p': projectName = optarg; break;
- default: /* '?' */
- usage();
- exit( -1 );
- }
- }
-
- // Do not trust any arguments until after this point.
- check_configuration();
-
- // XXX We need to verify that all of the needed arguments are non-NULL.
-
- // If a single executable was specified, process the remaining
- // arguments as coverage file names.
- if (singleExecutable) {
-
- // Ensure that the executable is readable.
- if (!FileIsReadable( singleExecutable )) {
- fprintf(
- stderr,
- "WARNING: Unable to read executable %s\n",
- singleExecutable
- );
- }
-
- else {
-
- for (i=optind; i < argc; i++) {
-
- // Ensure that the coverage file is readable.
- if (!FileIsReadable( argv[i] )) {
- fprintf(
- stderr,
- "WARNING: Unable to read coverage file %s\n",
- argv[i]
- );
- }
-
- else
- coverageFileNames.push_back( argv[i] );
- }
-
- // If there was at least one coverage file, create the
- // executable information.
- if (!coverageFileNames.empty()) {
- if (dynamicLibrary)
- executableInfo = new Coverage::ExecutableInfo(
- singleExecutable, dynamicLibrary
- );
- else
- executableInfo = new Coverage::ExecutableInfo( singleExecutable );
-
- executablesToAnalyze.push_back( executableInfo );
- }
- }
- }
-
- // If not invoked with a single executable, process the remaining
- // arguments as executables and derive the coverage file names.
- else {
- for (i = optind; i < argc; i++) {
-
- // Ensure that the executable is readable.
- if (!FileIsReadable( argv[i] )) {
- fprintf(
- stderr,
- "WARNING: Unable to read executable %s\n",
- argv[i]
- );
- }
-
- else {
- coverageFileName = argv[i];
- coverageFileName.replace(
- coverageFileName.length() - executableExtensionLength,
- executableExtensionLength,
- coverageFileExtension
- );
-
- if (!FileIsReadable( coverageFileName.c_str() )) {
- fprintf(
- stderr,
- "WARNING: Unable to read coverage file %s\n",
- coverageFileName.c_str()
- );
- }
-
- else {
- executableInfo = new Coverage::ExecutableInfo( argv[i] );
- executablesToAnalyze.push_back( executableInfo );
- coverageFileNames.push_back( coverageFileName );
- }
- }
- }
- }
-
- // Ensure that there is at least one executable to process.
- if (executablesToAnalyze.empty()) {
- fprintf(
- stderr, "ERROR: No information to analyze\n"
- );
- exit( -1 );
- }
-
- if (Verbose) {
- if (singleExecutable)
- fprintf(
- stderr,
- "Processing a single executable and multiple coverage files\n"
- );
- else
- fprintf(
- stderr,
- "Processing multiple executable/coverage file pairs\n"
- );
- fprintf( stderr, "Coverage Format : %s\n", format );
- fprintf( stderr, "Target : %s\n", PrintableString(target) );
- fprintf( stderr, "\n" );
-#if 1
- // Process each executable/coverage file pair.
- eitr = executablesToAnalyze.begin();
- for (citr = coverageFileNames.begin();
- citr != coverageFileNames.end();
- citr++) {
-
- fprintf(
- stderr,
- "Coverage file %s for executable %s\n",
- (*citr).c_str(),
- ((*eitr)->getFileName()).c_str()
- );
-
- if (!singleExecutable)
- eitr++;
- }
-#endif
- }
-
- //
- // Validate inputs.
- //
-
- // Target name must be set.
- if (!target) {
- fprintf( stderr, "ERROR: target not specified\n" );
- usage();
- exit(-1);
- }
-
- // Validate format.
- if (!format) {
- fprintf( stderr, "ERROR: coverage format report not specified\n" );
- usage();
- exit(-1);
- }
-
- // Validate that we have a symbols of interest file.
- if (!symbolsFile) {
- fprintf( stderr, "ERROR: symbols of interest file not specified\n" );
- usage();
- exit(-1);
- }
-
- //
- // Create data to support analysis.
- //
-
- // Create data based on target.
- TargetInfo = Target::TargetFactory( target );
-
- // Create the set of desired symbols.
- SymbolsToAnalyze = new Coverage::DesiredSymbols();
- SymbolsToAnalyze->load( symbolsFile );
- if (Verbose)
- fprintf(
- stderr,
- "Analyzing %u symbols\n",
- (unsigned int) SymbolsToAnalyze->set.size()
- );
-
- // Create explanations.
- AllExplanations = new Coverage::Explanations();
- if ( explanations )
- AllExplanations->load( explanations );
-
- // Create coverage map reader.
- coverageReader = Coverage::CreateCoverageReader(coverageFormat);
- if (!coverageReader) {
- fprintf( stderr, "ERROR: Unable to create coverage file reader\n" );
- exit(-1);
- }
-
- // Create the objdump processor.
- objdumpProcessor = new Coverage::ObjdumpProcessor();
-
- // Prepare each executable for analysis.
- for (eitr = executablesToAnalyze.begin();
- eitr != executablesToAnalyze.end();
- eitr++) {
-
- if (Verbose)
- fprintf(
- stderr,
- "Extracting information from %s\n",
- ((*eitr)->getFileName()).c_str()
- );
-
- // If a dynamic library was specified, determine the load address.
- if (dynamicLibrary)
- (*eitr)->setLoadAddress(
- objdumpProcessor->determineLoadAddress( *eitr )
- );
-
- // Load the objdump for the symbols in this executable.
- objdumpProcessor->load( *eitr );
- }
-
- //
- // Analyze the coverage data.
- //
-
- // Process each executable/coverage file pair.
- eitr = executablesToAnalyze.begin();
- for (citr = coverageFileNames.begin();
- citr != coverageFileNames.end();
- citr++) {
-
- if (Verbose)
- fprintf(
- stderr,
- "Processing coverage file %s for executable %s\n",
- (*citr).c_str(),
- ((*eitr)->getFileName()).c_str()
- );
-
- // Process its coverage file.
- coverageReader->processFile( (*citr).c_str(), *eitr );
-
- // Merge each symbols coverage map into a unified coverage map.
- (*eitr)->mergeCoverage();
-
- // DEBUG Print ExecutableInfo content
- //(*eitr)->dumpExecutableInfo();
-
- if (!singleExecutable)
- eitr++;
- }
-
- // Do necessary preprocessing of uncovered ranges and branches
- if (Verbose)
- fprintf( stderr, "Preprocess uncovered ranges and branches\n" );
- SymbolsToAnalyze->preprocess();
-
- //
- // Generate Gcov reports
- //
- if (Verbose)
- fprintf( stderr, "Generating Gcov reports...\n");
- gcnosFile = fopen ( gcnosFileName , "r" );
-
- if ( !gcnosFile ) {
- fprintf( stderr, "Unable to open %s\n", gcnosFileName );
- }
- else {
- while ( fscanf( gcnosFile, "%s", inputBuffer ) != EOF) {
- gcovFile = new Gcov::GcovData();
- strcpy( gcnoFileName, inputBuffer );
-
- if ( Verbose )
- fprintf( stderr, "Processing file: %s\n", gcnoFileName );
-
- if ( gcovFile->readGcnoFile( gcnoFileName ) ) {
- // Those need to be in this order
- gcovFile->processCounters();
- gcovFile->writeReportFile();
- gcovFile->writeGcdaFile();
- gcovFile->writeGcovFile();
- }
-
- delete gcovFile;
- }
- fclose( gcnosFile );
- }
-
- // Determine the uncovered ranges and branches.
- if (Verbose)
- fprintf( stderr, "Computing uncovered ranges and branches\n" );
- SymbolsToAnalyze->computeUncovered();
-
- // Calculate remainder of statistics.
- if (Verbose)
- fprintf( stderr, "Calculate statistics\n" );
- SymbolsToAnalyze->calculateStatistics();
-
- // Look up the source lines for any uncovered ranges and branches.
- if (Verbose)
- fprintf(
- stderr, "Looking up source lines for uncovered ranges and branches\n"
- );
- SymbolsToAnalyze->findSourceForUncovered();
-
- //
- // Report the coverage data.
- //
- if (Verbose)
- fprintf(
- stderr, "Generate Reports\n"
- );
- Coverage::GenerateReports();
-
- // Write explanations that were not found.
- if ( explanations ) {
- std::string notFound;
-
- notFound = outputDirectory;
- notFound += "/";
- notFound += "ExplanationsNotFound.txt";
-
- if (Verbose)
- fprintf( stderr, "Writing Not Found Report (%s)\n", notFound.c_str() );
- AllExplanations->writeNotFound( notFound.c_str() );
- }
-
- return 0;
-}
diff --git a/covoar/covoar.css b/covoar/covoar.css
deleted file mode 100644
index e5be14e..0000000
--- a/covoar/covoar.css
+++ /dev/null
@@ -1,372 +0,0 @@
-body {
- background: rgb(253,253,253);
- color: rgb(0,0,0);
- font-family: helvetica, sans-serif;
- font-size: 1em;
- line-height: 1.4;
- margin: 5px, 5px, 5px, 5px;
- padding: 0;
-}
-
-a:link {
- color: rgb(180, 50, 50);
- font-family: helvetica, sans-serif;
- font-size: 1.0em;
-}
-
-a:visited {
- color: purple;
- font-family: helvetica, sans-serif;
- font-size: 1.0em;
-}
-
-a:hover {
- color: rgb(0, 0, 0);
- font-family: helvetica, sans-serif;
- font-size: 1.0em;
-}
-
-a:active {
- color: red;
- font-family: helvetica, sans-serif;
- font-size: 1.0em;
-}
-
-.code {
- background: rgb(255,255,255);
- font-family: courier, sans-serif;
- font-size: 0.9em;
- font-weight: bold;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.codeExecuted {
- background: rgb(255,255,255);
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.codeNotExecuted {
- background: rgb(255,255,255);
- color: red;
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.codeAlwaysTaken {
- background: rgb(255,255,255);
- color: green;
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.codeNeverTaken {
- background: rgb(255,255,255);
- color: blue;
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.branchesEven {
- background: rgb(255,255,255);
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.branchesOdd {
- background: yellow;
- font-family: courier, sans-serif;
- font-size: 0.9em;
- line-height: 0.9;
- margin-top: 0.0;
- margin-bottom: 0.4em;
- text-align: left;
- padding-right: 10px;
-}
-
-.covoar-table {
- border-collapse: none;
- background:black;
- border:1px solid black;
-}
-
-.covoar-th {
- text-align: center;
-}
-
-table.covoar {
- border:1px solid black;
- border-collapse:collapse;
-}
-table.covoar th, table.covoar td {
- border:1px solid #aaaaaa;
- padding: 2px 15px 2px 15px;
-}
-table.covoar thead th {
- background-color:#A4BC92;
-}
-table.covoar tfoot td {
- background-color:#A4BC92;
-}
-
-table.covoar tr.tbody_header {
- font-weight:bold;
- text-align:center;
- background-color:#dddddd;
-}
-
-table.covoar a.pagelink {
- padding-left:5px;
- padding-right:5px;
- border:1px solid #666666;
- margin:0px 5px 0px 5px;
-}
-table.covoar a.currentpage {
- background-color:yellow;
-}
-
-/* Sorting */
-th.table-sortable {
- border:1px solid black;
- color: #F8F8F8;
- background: #A4BC92;
- cursor:pointer;
- background-image:url("05_unsorted.gif");
- background-position:center left;
- background-repeat:no-repeat;
- padding-left:12px;
-}
-th.table-sorted-asc {
- background-image:url("05_ascending.gif");
- background-position:center left;
- background-repeat:no-repeat;
-}
-th.table-sorted-desc {
- background-image:url("05_descending.gif");
- background-position:center left;
- background-repeat:no-repeat;
-}
-th.table-filtered {
- background-image:url("filter.gif");
- background-position:center left;
- background-repeat:no-repeat;
-}
-select.table-autofilter {
- font-size:smaller;
-}
-
-/* Icons box */
-.iconset {
- margin:5px;
- border:1px solid #cccccc;
- border-color:#cccccc #666666 #666666 #cccccc;
- text-align:center;
- cursor:pointer;
- width:100px;
-}
-.iconset img {
- margin:3px;
-}
-
-.covoar-tr-first {
- color: #F8F8F8;
- background: #A4BC92;
-}
-
-tr.alternate {
- background: #CBE4B1;
-}
-
-/* Examples which stray from the default */
-table.altstripe tr.alternate2 {
- background-color:#CBE4B1;
-}
-
-.covoar-tr-odd {
- background: #CBE4B1;
-}
-
-.covoar-tr-even {
- background: #DBE5C6;
-}
-
-.heading {
- background: rgb(250,250,250);
- background-image: url("http://www.rtems.org/logos/rtems_logo.jpg");
- background-repeat: no-repeat;
- color: rgb(55,55,55);
- font-size: 1.5em;
- height: 140px;
- padding-top: 20px;
- padding-left: 300px;
-}
-
-.heading-title {
- text-align: center;
- color: rgb(0,0,0);
- font-size: 3.5em;
- font-weight: bold;
- line-height: 0.9;
- padding-top: 5px;
- padding-left: 0px;
- text-align: center;
- width: 100%;
-}
-
-.datetime {
- color: rgb(55,55,55);
- font-size: 1.0em;
- padding-top: 5px;
- padding-left: 0px;
- text-align: center;
- width: 100%;
-}
-
-.info {
- color: rgb(55,55,55);
- font-size: 0.6em;
- padding-top: 5px;
- padding-left: 00px;
- text-align: center;
- width: 100%;
-}
-
-.stats-table {
- background: rgb(225,225,225);
- font-size: 0.9em;
- border: 1px solid rgb(200, 200, 200);
- padding: 0;
- margin-top: 3px;
- margin-left: 10px;
- width: 70%;
-}
-
-.stats-table-target {
- background: rgb(243,243,243);
- font-size: 1.2em;
- padding-left: 10px;
- text-align: left;
-}
-
-.stats-target-results {
- background: rgb(243,243,243);
- font-size: 0.9em;
- text-align: right;
- padding-right: 10px;
-}
-
-.stats-target-good {
- background: rgb(30,230,30);
- font-size: 0.9em;
- text-align: right;
- padding-right: 10px;
-}
-
-.stats-target-good {
- background: rgb(50,180,50);
- color: rgb(230,230,230);
- font-size: 0.9em;
- text-align: center;
- padding-right: 10px;
-}
-
-.stats-target-bad {
- background: rgb(180,50,50);
- color: rgb(230,230,230);
- font-size: 0.9em;
- text-align: center;
- padding-right: 10px;
-}
-
-.stats-table-top {
- background: rgb(243,243,243);
- color: rgb(0,0,0);
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.stats-table-row {
- background: rgb(253,253,253);
- font-size: 0.9em;
- padding: 1px;
- text-align: right;
-}
-
-.error-table {
- font-size: 0.9em;
- border: 1px solid rgb(200, 200, 200);
- padding: 0;
- margin-left: 10px;
- width: 96%;
-}
-
-.error-table-top {
- background: rgb(225,225,225);
- color: rgb(0,0,0);
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.error-table-on {
- background: rgb(225,225,225);
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.error-table-off {
- background: rgb(253,253,253);
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.error-table-dups {
- text-align: right;
- padding-right: 2px;
-}
-
-.error-table-error {
- background: rgb(255,150,150);
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.error-table-warning {
- font-size: 0.9em;
- padding-left: 2px;
-}
-
-.navbar {
- margin-left: auto;
- margin-right: auto;
- margin-top: 10px;
- width: 40%;
-}
diff --git a/covoar/covoar_flow.doc b/covoar/covoar_flow.doc
deleted file mode 100644
index 124481f..0000000
--- a/covoar/covoar_flow.doc
+++ /dev/null
Binary files differ
diff --git a/covoar/filter.gif b/covoar/filter.gif
deleted file mode 100644
index 7ebec79..0000000
--- a/covoar/filter.gif
+++ /dev/null
Binary files differ
diff --git a/covoar/mkExplanation b/covoar/mkExplanation
deleted file mode 100755
index 6aa7940..0000000
--- a/covoar/mkExplanation
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /bin/sh
-#
-# Script to help generate an explanation for the covoar explanations file.
-#
-
-toggle()
-{
- case $1 in
- no) echo "yes" ;;
- yes) echo "no" ;;
- *) fatal "Unknown value to toggle ($1)" ;;
- esac
-}
-
-usage()
-{
- echo "$progname -r sourceLine -c category [-m message|-M msgfile] "
- exit 1
-}
-
-message=
-messageFile=
-category=
-sourceLine=
-verbose=no
-while getopts c:m:M:r:v OPT
-do
- case "$OPT" in
- c) category=$OPTARG ;;
- m) message=$OPTARG ;;
- M) messageFile=$OPTARG ;;
- r) sourceLine=$OPTARG ;;
- v) verbose=`toggle ${verbose}` ;;
- *) usage ;;
- esac
-done
-
-# Error check
-if [ "X${sourceLine}" = "X" ] ; then
- echo No sourceLine provided
- usage
-fi
-
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-if [ "X${category}" = "X" ] ; then
- echo No category provided
- usage
-fi
-
-if [ "X${message}" = "X" -a "X${messageFile}" = "X" ] ; then
- echo No message provided
- usage
-fi
-
-# Generate the explanation
-echo ${sourceLine}
-echo ${category}
-if [ "X${message}" = "X" ] ; then
- cat ${messageFile}
-else
- echo ${message} | xargs -s 76
-fi
-echo "+++"
-echo
-
-exit 0
diff --git a/covoar/qemu-dump-trace.c b/covoar/qemu-dump-trace.c
deleted file mode 100644
index aeb93fd..0000000
--- a/covoar/qemu-dump-trace.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <stdint.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-#include "qemu-traces.h"
-
-
-int dump_file(
- const char *name
-)
-{
- FILE *trace;
- struct trace_header header;
- struct trace_entry entry;
- size_t bytes;
- int instructions;
-
- trace = fopen( name, "r" );
- if ( !trace ) {
- perror( "unable to open trace file" );
- return -1;
- }
-
- bytes = fread( &header, sizeof(struct trace_header), 1, trace );
- if ( bytes != 1 ) {
- fprintf( stderr, "error reading header of %s (%s)\n",
- name, strerror(errno) );
- return -1;
- }
- printf( "magic = %s\n", header.magic );
- printf( "version = %d\n", header.version );
- printf( "kind = %d\n", header.kind );
- printf( "sizeof_target_pc = %d\n", header.sizeof_target_pc );
- printf( "big_endian = %d\n", header.big_endian );
- printf( "machine = %02x:%02x\n", header.machine[0], header.machine[1] );
-
- instructions = 0;
- while (1) {
- bytes = fread( &entry, sizeof(struct trace_entry), 1, trace );
- if ( bytes != 1 )
- break;
- instructions++;
- printf( "0x%08x %d 0x%2x\n", entry.pc, entry.size, entry.op );
- }
-
-
- fclose( trace );
- printf( "instructions = %d\n", instructions );
-
- return 0;
-
-}
-
-int main(
- int argc,
- char **argv
-)
-{
- int i;
-
- for (i=1 ; i<argc ; i++) {
- if ( dump_file( argv[i] ) )
- return -1;
- }
- return 0;
-}
diff --git a/covoar/qemu-log.h b/covoar/qemu-log.h
deleted file mode 100644
index cbca05e..0000000
--- a/covoar/qemu-log.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/*
- * Qemu log file format.
- */
-
-#ifndef QEMU_LOG_H
-#define QEMU_LOG_H
-
-#define QEMU_LOG_SECTION_END "----------------"
-#define QEMU_LOG_IN_KEY "IN: "
-
-/*!
- * This structure breaks apart the log line information
- * into the components address, instruction and data.
- */
-typedef struct {
- unsigned long address;
- char instruction[10];
- char data[20];
-} QEMU_LOG_IN_Block_t;
-
-
-#endif /* QEMU_LOG_H */
diff --git a/covoar/qemu-traces.h b/covoar/qemu-traces.h
deleted file mode 100644
index 7e37840..0000000
--- a/covoar/qemu-traces.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (C) 2009, AdaCore
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-/*
- * Qemu trace file format.
- * It requires proper definition for uintXX_t where XX is 8, 16, 32 and 64
- * and target_ulong (32 or 64 bits).
- */
-
-#ifndef QEMU_TRACE_H
-#define QEMU_TRACE_H
-
-/* XXX really not always right */
-/* XXX Added for covoar so this compiles */
-typedef uint32_t target_ulong;
-
-/* File header definition. */
-struct trace_header
-{
- char magic[12];
-#define QEMU_TRACE_MAGIC "#QEMU-Traces"
-
- uint8_t version;
-#define QEMU_TRACE_VERSION 1
-
- /* File kind. */
- uint8_t kind;
-#define QEMU_TRACE_KIND_RAW 0
-#define QEMU_TRACE_KIND_HISTORY 1
-#define QEMU_TRACE_KIND_INFO 2
-#define QEMU_TRACE_KIND_DECISION_MAP 3
-#define QEMU_TRACE_KIND_CONSOLIDATED 248
-
- /* Sizeof (target_pc). Indicates struct trace_entry length. */
- uint8_t sizeof_target_pc;
-
- /* True if host was big endian. All the trace data used the host
- endianness. */
- uint8_t big_endian;
-
- /* Target machine (use ELF number) - always in big endian. */
- uint8_t machine[2];
-
- uint16_t _pad;
-};
-
-/* Header is followed by trace entries. */
-struct trace_entry
-{
- target_ulong pc;
- uint16_t size;
- uint8_t op;
-};
-
-struct trace_entry32
-{
- uint32_t pc;
- uint16_t size;
- uint8_t op;
- uint8_t _pad[1];
-};
-
-struct trace_entry64
-{
- uint64_t pc;
- uint16_t size;
- uint8_t op;
- uint8_t _pad[5];
-};
-
-/*
- * Trace operations for RAW and HISTORY
- */
-
-/* _BLOCK means pc .. pc+size-1 was executed. */
-#define TRACE_OP_BLOCK 0x10 /* Block fully executed. */
-#define TRACE_OP_FAULT 0x20 /* Fault at pc. */
-#define TRACE_OP_DYN 0x40 /* Dynamic branch. */
-#define TRACE_OP_BR0 0x01 /* Branch taken "in direction 0". */
-#define TRACE_OP_BR1 0x02 /* Branch taken "in direction 1". */
-#define TRACE_OP_BR2 0x04
-#define TRACE_OP_BR3 0x08
-
-/*
- * Decision map operations
- */
-#define TRACE_OP_TRACE_CONDITIONAL 1
-/* Trace conditional jump instruction at address */
-
-extern struct trace_entry *trace_current;
-extern int tracefile_enabled;
-extern int tracefile_nobuf;
-extern int tracefile_history;
-
-void trace_init (const char *optarg);
-void trace_push_entry (void);
-
-#endif /* QEMU_TRACE_H */
diff --git a/covoar/rtemscov_header.h b/covoar/rtemscov_header.h
deleted file mode 100644
index 5b3e263..0000000
--- a/covoar/rtemscov_header.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*! @file rtemscov_header.h
- * @brief rtemscov_header Implementation
- *
- * This file contains the implementation of the functions supporting
- * RTEMS Common Coverage Map file format.
- *
- */
-
-#ifndef __RTEMS_Coverage_Header_h
-#define __RTEMS_Coverage_Header_h
-
-#define MAX_DESC_STR 32
-
-/*!
- *
- * This structure contains XXX
- */
-
-typedef struct prof_header_s{
- /** the version of header file */
- int ver;
- /** The length of header */
- int header_length;
- /** starting address */
- int start;
- /** ending address */
- int end;
- /** The description info for profiling file */
- char desc[MAX_DESC_STR];
-} rtems_coverage_map_header_t;
-
-#endif
diff --git a/covoar/skyeye_header.h b/covoar/skyeye_header.h
deleted file mode 100644
index d187239..0000000
--- a/covoar/skyeye_header.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*! @file skyeye_header.h
- * @brief skyeye_header Implementation
- *
- * This file contains the definition of the format
- * for coverage files written by the Skyeye simulator.
- */
-
-#ifndef __Skyeye_Header_h
-#define __Skyeye_Header_h
-
-#define MAX_DESC_STR 32
-
-typedef struct prof_header_s {
- int ver; /** the version of header file */
- int header_length; /** The length of header */
- int prof_start;
- int prof_end;
- char desc[MAX_DESC_STR]; /** The description info for profiling file */
-} prof_header_t;
-
-#endif
diff --git a/covoar/table.js b/covoar/table.js
deleted file mode 100644
index e1e5d5d..0000000
--- a/covoar/table.js
+++ /dev/null
@@ -1,1002 +0,0 @@
-/**
- * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
- *
- * Dual licensed under the MIT and GPL licenses.
- * This basically means you can use this code however you want for
- * free, but don't claim to have written it yourself!
- * Donations always accepted: http://www.JavascriptToolbox.com/donate/
- *
- * Please do not link to the .js files on javascripttoolbox.com from
- * your site. Copy the files locally to your server instead.
- *
- */
-/**
- * Table.js
- * Functions for interactive Tables
- *
- * Copyright (c) 2007 Matt Kruse (javascripttoolbox.com)
- * Dual licensed under the MIT and GPL licenses.
- *
- * @version 0.981
- *
- * @history 0.981 2007-03-19 Added Sort.numeric_comma, additional date parsing formats
- * @history 0.980 2007-03-18 Release new BETA release pending some testing. Todo: Additional docs, examples, plus jQuery plugin.
- * @history 0.959 2007-03-05 Added more "auto" functionality, couple bug fixes
- * @history 0.958 2007-02-28 Added auto functionality based on class names
- * @history 0.957 2007-02-21 Speed increases, more code cleanup, added Auto Sort functionality
- * @history 0.956 2007-02-16 Cleaned up the code and added Auto Filter functionality.
- * @history 0.950 2006-11-15 First BETA release.
- *
- * @todo Add more date format parsers
- * @todo Add style classes to colgroup tags after sorting/filtering in case the user wants to highlight the whole column
- * @todo Correct for colspans in data rows (this may slow it down)
- * @todo Fix for IE losing form control values after sort?
- */
-
-/**
- * Sort Functions
- */
-var Sort = (function(){
- var sort = {};
- // Default alpha-numeric sort
- // --------------------------
- sort.alphanumeric = function(a,b) {
- return (a==b)?0:(a<b)?-1:1;
- };
- sort['default'] = sort.alphanumeric; // IE chokes on sort.default
-
- // This conversion is generalized to work for either a decimal separator of , or .
- sort.numeric_converter = function(separator) {
- return function(val) {
- if (typeof(val)=="string") {
- val = parseFloat(val.replace(/^[^\d\.]*([\d., ]+).*/g,"$1").replace(new RegExp("[^\\\d"+separator+"]","g"),'').replace(/,/,'.')) || 0;
- }
- return val || 0;
- };
- };
-
- // Numeric Sort
- // ------------
- sort.numeric = function(a,b) {
- return sort.numeric.convert(a)-sort.numeric.convert(b);
- };
- sort.numeric.convert = sort.numeric_converter(".");
-
- // Numeric Sort - comma decimal separator
- // --------------------------------------
- sort.numeric_comma = function(a,b) {
- return sort.numeric_comma.convert(a)-sort.numeric_comma.convert(b);
- };
- sort.numeric_comma.convert = sort.numeric_converter(",");
-
- // Case-insensitive Sort
- // ---------------------
- sort.ignorecase = function(a,b) {
- return sort.alphanumeric(sort.ignorecase.convert(a),sort.ignorecase.convert(b));
- };
- sort.ignorecase.convert = function(val) {
- if (val==null) { return ""; }
- return (""+val).toLowerCase();
- };
-
- // Currency Sort
- // -------------
- sort.currency = sort.numeric; // Just treat it as numeric!
- sort.currency_comma = sort.numeric_comma;
-
- // Date sort
- // ---------
- sort.date = function(a,b) {
- return sort.numeric(sort.date.convert(a),sort.date.convert(b));
- };
- // Convert 2-digit years to 4
- sort.date.fixYear=function(yr) {
- yr = +yr;
- if (yr<50) { yr += 2000; }
- else if (yr<100) { yr += 1900; }
- return yr;
- };
- sort.date.formats = [
- // YY[YY]-MM-DD
- { re:/(\d{2,4})-(\d{1,2})-(\d{1,2})/ , f:function(x){ return (new Date(sort.date.fixYear(x[1]),+x[2],+x[3])).getTime(); } }
- // MM/DD/YY[YY] or MM-DD-YY[YY]
- ,{ re:/(\d{1,2})[\/-](\d{1,2})[\/-](\d{2,4})/ , f:function(x){ return (new Date(sort.date.fixYear(x[3]),+x[1],+x[2])).getTime(); } }
- // Any catch-all format that new Date() can handle. This is not reliable except for long formats, for example: 31 Jan 2000 01:23:45 GMT
- ,{ re:/(.*\d{4}.*\d+:\d+\d+.*)/, f:function(x){ var d=new Date(x[1]); if(d){return d.getTime();} } }
- ];
- sort.date.convert = function(val) {
- var m,v, f = sort.date.formats;
- for (var i=0,L=f.length; i<L; i++) {
- if (m=val.match(f[i].re)) {
- v=f[i].f(m);
- if (typeof(v)!="undefined") { return v; }
- }
- }
- return 9999999999999; // So non-parsed dates will be last, not first
- };
-
- return sort;
-})();
-
-/**
- * The main Table namespace
- */
-var Table = (function(){
-
- /**
- * Determine if a reference is defined
- */
- function def(o) {return (typeof o!="undefined");};
-
- /**
- * Determine if an object or class string contains a given class.
- */
- function hasClass(o,name) {
- return new RegExp("(^|\\s)"+name+"(\\s|$)").test(o.className);
- };
-
- /**
- * Add a class to an object
- */
- function addClass(o,name) {
- var c = o.className || "";
- if (def(c) && !hasClass(o,name)) {
- o.className += (c?" ":"") + name;
- }
- };
-
- /**
- * Remove a class from an object
- */
- function removeClass(o,name) {
- var c = o.className || "";
- o.className = c.replace(new RegExp("(^|\\s)"+name+"(\\s|$)"),"$1");
- };
-
- /**
- * For classes that match a given substring, return the rest
- */
- function classValue(o,prefix) {
- var c = o.className;
- if (c.match(new RegExp("(^|\\s)"+prefix+"([^ ]+)"))) {
- return RegExp.$2;
- }
- return null;
- };
-
- /**
- * Return true if an object is hidden.
- * This uses the "russian doll" technique to unwrap itself to the most efficient
- * function after the first pass. This avoids repeated feature detection that
- * would always fall into the same block of code.
- */
- function isHidden(o) {
- if (window.getComputedStyle) {
- var cs = window.getComputedStyle;
- return (isHidden = function(o) {
- return 'none'==cs(o,null).getPropertyValue('display');
- })(o);
- }
- else if (window.currentStyle) {
- return(isHidden = function(o) {
- return 'none'==o.currentStyle['display'];
- })(o);
- }
- return (isHidden = function(o) {
- return 'none'==o.style['display'];
- })(o);
- };
-
- /**
- * Get a parent element by tag name, or the original element if it is of the tag type
- */
- function getParent(o,a,b) {
- if (o!=null && o.nodeName) {
- if (o.nodeName==a || (b && o.nodeName==b)) {
- return o;
- }
- while (o=o.parentNode) {
- if (o.nodeName && (o.nodeName==a || (b && o.nodeName==b))) {
- return o;
- }
- }
- }
- return null;
- };
-
- /**
- * Utility function to copy properties from one object to another
- */
- function copy(o1,o2) {
- for (var i=2;i<arguments.length; i++) {
- var a = arguments[i];
- if (def(o1[a])) {
- o2[a] = o1[a];
- }
- }
- }
-
- // The table object itself
- var table = {
- //Class names used in the code
- AutoStripeClassName:"table-autostripe",
- StripeClassNamePrefix:"table-stripeclass:",
-
- AutoSortClassName:"table-autosort",
- AutoSortColumnPrefix:"table-autosort:",
- AutoSortTitle:"Click to sort",
- SortedAscendingClassName:"table-sorted-asc",
- SortedDescendingClassName:"table-sorted-desc",
- SortableClassName:"table-sortable",
- SortableColumnPrefix:"table-sortable:",
- NoSortClassName:"table-nosort",
-
- AutoFilterClassName:"table-autofilter",
- FilteredClassName:"table-filtered",
- FilterableClassName:"table-filterable",
- FilteredRowcountPrefix:"table-filtered-rowcount:",
- RowcountPrefix:"table-rowcount:",
- FilterAllLabel:"Filter: All",
-
- AutoPageSizePrefix:"table-autopage:",
- AutoPageJumpPrefix:"table-page:",
- PageNumberPrefix:"table-page-number:",
- PageCountPrefix:"table-page-count:"
- };
-
- /**
- * A place to store misc table information, rather than in the table objects themselves
- */
- table.tabledata = {};
-
- /**
- * Resolve a table given an element reference, and make sure it has a unique ID
- */
- table.uniqueId=1;
- table.resolve = function(o,args) {
- if (o!=null && o.nodeName && o.nodeName!="TABLE") {
- o = getParent(o,"TABLE");
- }
- if (o==null) { return null; }
- if (!o.id) {
- var id = null;
- do { var id = "TABLE_"+(table.uniqueId++); }
- while (document.getElementById(id)!=null);
- o.id = id;
- }
- this.tabledata[o.id] = this.tabledata[o.id] || {};
- if (args) {
- copy(args,this.tabledata[o.id],"stripeclass","ignorehiddenrows","useinnertext","sorttype","col","desc","page","pagesize");
- }
- return o;
- };
-
-
- /**
- * Run a function against each cell in a table header or footer, usually
- * to add or remove css classes based on sorting, filtering, etc.
- */
- table.processTableCells = function(t, type, func, arg) {
- t = this.resolve(t);
- if (t==null) { return; }
- if (type!="TFOOT") {
- this.processCells(t.tHead, func, arg);
- }
- if (type!="THEAD") {
- this.processCells(t.tFoot, func, arg);
- }
- };
-
- /**
- * Internal method used to process an arbitrary collection of cells.
- * Referenced by processTableCells.
- * It's done this way to avoid getElementsByTagName() which would also return nested table cells.
- */
- table.processCells = function(section,func,arg) {
- if (section!=null) {
- if (section.rows && section.rows.length && section.rows.length>0) {
- var rows = section.rows;
- for (var j=0,L2=rows.length; j<L2; j++) {
- var row = rows[j];
- if (row.cells && row.cells.length && row.cells.length>0) {
- var cells = row.cells;
- for (var k=0,L3=cells.length; k<L3; k++) {
- var cellsK = cells[k];
- func.call(this,cellsK,arg);
- }
- }
- }
- }
- }
- };
-
- /**
- * Get the cellIndex value for a cell. This is only needed because of a Safari
- * bug that causes cellIndex to exist but always be 0.
- * Rather than feature-detecting each time it is called, the function will
- * re-write itself the first time it is called.
- */
- table.getCellIndex = function(td) {
- var tr = td.parentNode;
- var cells = tr.cells;
- if (cells && cells.length) {
- if (cells.length>1 && cells[cells.length-1].cellIndex>0) {
- // Define the new function, overwrite the one we're running now, and then run the new one
- (this.getCellIndex = function(td) {
- return td.cellIndex;
- })(td);
- }
- // Safari will always go through this slower block every time. Oh well.
- for (var i=0,L=cells.length; i<L; i++) {
- if (tr.cells[i]==td) {
- return i;
- }
- }
- }
- return 0;
- };
-
- /**
- * A map of node names and how to convert them into their "value" for sorting, filtering, etc.
- * These are put here so it is extensible.
- */
- table.nodeValue = {
- 'INPUT':function(node) {
- if (def(node.value) && node.type && ((node.type!="checkbox" && node.type!="radio") || node.checked)) {
- return node.value;
- }
- return "";
- },
- 'SELECT':function(node) {
- if (node.selectedIndex>=0 && node.options) {
- // Sort select elements by the visible text
- return node.options[node.selectedIndex].text;
- }
- return "";
- },
- 'IMG':function(node) {
- return node.name || "";
- }
- };
-
- /**
- * Get the text value of a cell. Only use innerText if explicitly told to, because
- * otherwise we want to be able to handle sorting on inputs and other types
- */
- table.getCellValue = function(td,useInnerText) {
- if (useInnerText && def(td.innerText)) {
- return td.innerText;
- }
- if (!td.childNodes) {
- return "";
- }
- var childNodes=td.childNodes;
- var ret = "";
- for (var i=0,L=childNodes.length; i<L; i++) {
- var node = childNodes[i];
- var type = node.nodeType;
- // In order to get realistic sort results, we need to treat some elements in a special way.
- // These behaviors are defined in the nodeValue() object, keyed by node name
- if (type==1) {
- var nname = node.nodeName;
- if (this.nodeValue[nname]) {
- ret += this.nodeValue[nname](node);
- }
- else {
- ret += this.getCellValue(node);
- }
- }
- else if (type==3) {
- if (def(node.innerText)) {
- ret += node.innerText;
- }
- else if (def(node.nodeValue)) {
- ret += node.nodeValue;
- }
- }
- }
- return ret;
- };
-
- /**
- * Consider colspan and rowspan values in table header cells to calculate the actual cellIndex
- * of a given cell. This is necessary because if the first cell in row 0 has a rowspan of 2,
- * then the first cell in row 1 will have a cellIndex of 0 rather than 1, even though it really
- * starts in the second column rather than the first.
- * See: http://www.javascripttoolbox.com/temp/table_cellindex.html
- */
- table.tableHeaderIndexes = {};
- table.getActualCellIndex = function(tableCellObj) {
- if (!def(tableCellObj.cellIndex)) { return null; }
- var tableObj = getParent(tableCellObj,"TABLE");
- var cellCoordinates = tableCellObj.parentNode.rowIndex+"-"+this.getCellIndex(tableCellObj);
-
- // If it has already been computed, return the answer from the lookup table
- if (def(this.tableHeaderIndexes[tableObj.id])) {
- return this.tableHeaderIndexes[tableObj.id][cellCoordinates];
- }
-
- var matrix = [];
- this.tableHeaderIndexes[tableObj.id] = {};
- var thead = getParent(tableCellObj,"THEAD");
- var trs = thead.getElementsByTagName('TR');
-
- // Loop thru every tr and every cell in the tr, building up a 2-d array "grid" that gets
- // populated with an "x" for each space that a cell takes up. If the first cell is colspan
- // 2, it will fill in values [0] and [1] in the first array, so that the second cell will
- // find the first empty cell in the first row (which will be [2]) and know that this is
- // where it sits, rather than its internal .cellIndex value of [1].
- for (var i=0; i<trs.length; i++) {
- var cells = trs[i].cells;
- for (var j=0; j<cells.length; j++) {
- var c = cells[j];
- var rowIndex = c.parentNode.rowIndex;
- var cellId = rowIndex+"-"+this.getCellIndex(c);
- var rowSpan = c.rowSpan || 1;
- var colSpan = c.colSpan || 1;
- var firstAvailCol;
- if(!def(matrix[rowIndex])) {
- matrix[rowIndex] = [];
- }
- var m = matrix[rowIndex];
- // Find first available column in the first row
- for (var k=0; k<m.length+1; k++) {
- if (!def(m[k])) {
- firstAvailCol = k;
- break;
- }
- }
- this.tableHeaderIndexes[tableObj.id][cellId] = firstAvailCol;
- for (var k=rowIndex; k<rowIndex+rowSpan; k++) {
- if(!def(matrix[k])) {
- matrix[k] = [];
- }
- var matrixrow = matrix[k];
- for (var l=firstAvailCol; l<firstAvailCol+colSpan; l++) {
- matrixrow[l] = "x";
- }
- }
- }
- }
- // Store the map so future lookups are fast.
- return this.tableHeaderIndexes[tableObj.id][cellCoordinates];
- };
-
- /**
- * Sort all rows in each TBODY (tbodies are sorted independent of each other)
- */
- table.sort = function(o,args) {
- var t, tdata, sortconvert=null;
- // Allow for a simple passing of sort type as second parameter
- if (typeof(args)=="function") {
- args={sorttype:args};
- }
- args = args || {};
-
- // If no col is specified, deduce it from the object sent in
- if (!def(args.col)) {
- args.col = this.getActualCellIndex(o) || 0;
- }
- // If no sort type is specified, default to the default sort
- args.sorttype = args.sorttype || Sort['default'];
-
- // Resolve the table
- t = this.resolve(o,args);
- tdata = this.tabledata[t.id];
-
- // If we are sorting on the same column as last time, flip the sort direction
- if (def(tdata.lastcol) && tdata.lastcol==tdata.col && def(tdata.lastdesc)) {
- tdata.desc = !tdata.lastdesc;
- }
- else {
- tdata.desc = !!args.desc;
- }
-
- // Store the last sorted column so clicking again will reverse the sort order
- tdata.lastcol=tdata.col;
- tdata.lastdesc=!!tdata.desc;
-
- // If a sort conversion function exists, pre-convert cell values and then use a plain alphanumeric sort
- var sorttype = tdata.sorttype;
- if (typeof(sorttype.convert)=="function") {
- sortconvert=tdata.sorttype.convert;
- sorttype=Sort.alphanumeric;
- }
-
- // Loop through all THEADs and remove sorted class names, then re-add them for the col
- // that is being sorted
- this.processTableCells(t,"THEAD",
- function(cell) {
- if (hasClass(cell,this.SortableClassName)) {
- removeClass(cell,this.SortedAscendingClassName);
- removeClass(cell,this.SortedDescendingClassName);
- // If the computed colIndex of the cell equals the sorted colIndex, flag it as sorted
- if (tdata.col==table.getActualCellIndex(cell) && (classValue(cell,table.SortableClassName))) {
- addClass(cell,tdata.desc?this.SortedAscendingClassName:this.SortedDescendingClassName);
- }
- }
- }
- );
-
- // Sort each tbody independently
- var bodies = t.tBodies;
- if (bodies==null || bodies.length==0) { return; }
-
- // Define a new sort function to be called to consider descending or not
- var newSortFunc = (tdata.desc)?
- function(a,b){return sorttype(b[0],a[0]);}
- :function(a,b){return sorttype(a[0],b[0]);};
-
- var useinnertext=!!tdata.useinnertext;
- var col = tdata.col;
-
- for (var i=0,L=bodies.length; i<L; i++) {
- var tb = bodies[i], tbrows = tb.rows, rows = [];
-
- // Allow tbodies to request that they not be sorted
- if(!hasClass(tb,table.NoSortClassName)) {
- // Create a separate array which will store the converted values and refs to the
- // actual rows. This is the array that will be sorted.
- var cRow, cRowIndex=0;
- if (cRow=tbrows[cRowIndex]){
- // Funky loop style because it's considerably faster in IE
- do {
- if (rowCells = cRow.cells) {
- var cellValue = (col<rowCells.length)?this.getCellValue(rowCells[col],useinnertext):null;
- if (sortconvert) cellValue = sortconvert(cellValue);
- rows[cRowIndex] = [cellValue,tbrows[cRowIndex]];
- }
- } while (cRow=tbrows[++cRowIndex])
- }
-
- // Do the actual sorting
- rows.sort(newSortFunc);
-
- // Move the rows to the correctly sorted order. Appending an existing DOM object just moves it!
- cRowIndex=0;
- var displayedCount=0;
- var f=[removeClass,addClass];
- if (cRow=rows[cRowIndex]){
- do {
- tb.appendChild(cRow[1]);
- } while (cRow=rows[++cRowIndex])
- }
- }
- }
-
- // If paging is enabled on the table, then we need to re-page because the order of rows has changed!
- if (tdata.pagesize) {
- this.page(t); // This will internally do the striping
- }
- else {
- // Re-stripe if a class name was supplied
- if (tdata.stripeclass) {
- this.stripe(t,tdata.stripeclass,!!tdata.ignorehiddenrows);
- }
- }
- };
-
- /**
- * Apply a filter to rows in a table and hide those that do not match.
- */
- table.filter = function(o,filters,args) {
- var cell;
- args = args || {};
-
- var t = this.resolve(o,args);
- var tdata = this.tabledata[t.id];
-
- // If new filters were passed in, apply them to the table's list of filters
- if (!filters) {
- // If a null or blank value was sent in for 'filters' then that means reset the table to no filters
- tdata.filters = null;
- }
- else {
- // Allow for passing a select list in as the filter, since this is common design
- if (filters.nodeName=="SELECT" && filters.type=="select-one" && filters.selectedIndex>-1) {
- filters={ 'filter':filters.options[filters.selectedIndex].value };
- }
- // Also allow for a regular input
- if (filters.nodeName=="INPUT" && filters.type=="text") {
- filters={ 'filter':"/^"+filters.value+"/" };
- }
- // Force filters to be an array
- if (typeof(filters)=="object" && !filters.length) {
- filters = [filters];
- }
-
- // Convert regular expression strings to RegExp objects and function strings to function objects
- for (var i=0,L=filters.length; i<L; i++) {
- var filter = filters[i];
- if (typeof(filter.filter)=="string") {
- // If a filter string is like "/expr/" then turn it into a Regex
- if (filter.filter.match(/^\/(.*)\/$/)) {
- filter.filter = new RegExp(RegExp.$1);
- filter.filter.regex=true;
- }
- // If filter string is like "function (x) { ... }" then turn it into a function
- else if (filter.filter.match(/^function\s*\(([^\)]*)\)\s*\{(.*)}\s*$/)) {
- filter.filter = Function(RegExp.$1,RegExp.$2);
- }
- }
- // If some non-table object was passed in rather than a 'col' value, resolve it
- // and assign it's column index to the filter if it doesn't have one. This way,
- // passing in a cell reference or a select object etc instead of a table object
- // will automatically set the correct column to filter.
- if (filter && !def(filter.col) && (cell=getParent(o,"TD","TH"))) {
- filter.col = this.getCellIndex(cell);
- }
-
- // Apply the passed-in filters to the existing list of filters for the table, removing those that have a filter of null or ""
- if ((!filter || !filter.filter) && tdata.filters) {
- delete tdata.filters[filter.col];
- }
- else {
- tdata.filters = tdata.filters || {};
- tdata.filters[filter.col] = filter.filter;
- }
- }
- // If no more filters are left, then make sure to empty out the filters object
- for (var j in tdata.filters) { var keep = true; }
- if (!keep) {
- tdata.filters = null;
- }
- }
- // Everything's been setup, so now scrape the table rows
- return table.scrape(o);
- };
-
- /**
- * "Page" a table by showing only a subset of the rows
- */
- table.page = function(t,page,args) {
- args = args || {};
- if (def(page)) { args.page = page; }
- return table.scrape(t,args);
- };
-
- /**
- * Jump forward or back any number of pages
- */
- table.pageJump = function(t,count,args) {
- t = this.resolve(t,args);
- return this.page(t,(table.tabledata[t.id].page||0)+count,args);
- };
-
- /**
- * Go to the next page of a paged table
- */
- table.pageNext = function(t,args) {
- return this.pageJump(t,1,args);
- };
-
- /**
- * Go to the previous page of a paged table
- */
- table.pagePrevious = function(t,args) {
- return this.pageJump(t,-1,args);
- };
-
- /**
- * Scrape a table to either hide or show each row based on filters and paging
- */
- table.scrape = function(o,args) {
- var col,cell,filterList,filterReset=false,filter;
- var page,pagesize,pagestart,pageend;
- var unfilteredrows=[],unfilteredrowcount=0,totalrows=0;
- var t,tdata,row,hideRow;
- args = args || {};
-
- // Resolve the table object
- t = this.resolve(o,args);
- tdata = this.tabledata[t.id];
-
- // Setup for Paging
- var page = tdata.page;
- if (def(page)) {
- // Don't let the page go before the beginning
- if (page<0) { tdata.page=page=0; }
- pagesize = tdata.pagesize || 25; // 25=arbitrary default
- pagestart = page*pagesize+1;
- pageend = pagestart + pagesize - 1;
- }
-
- // Scrape each row of each tbody
- var bodies = t.tBodies;
- if (bodies==null || bodies.length==0) { return; }
- for (var i=0,L=bodies.length; i<L; i++) {
- var tb = bodies[i];
- for (var j=0,L2=tb.rows.length; j<L2; j++) {
- row = tb.rows[j];
- hideRow = false;
-
- // Test if filters will hide the row
- if (tdata.filters && row.cells) {
- var cells = row.cells;
- var cellsLength = cells.length;
- // Test each filter
- for (col in tdata.filters) {
- if (!hideRow) {
- filter = tdata.filters[col];
- if (filter && col<cellsLength) {
- var val = this.getCellValue(cells[col]);
- if (filter.regex && val.search) {
- hideRow=(val.search(filter)<0);
- }
- else if (typeof(filter)=="function") {
- hideRow=!filter(val,cells[col]);
- }
- else {
- hideRow = (val!=filter);
- }
- }
- }
- }
- }
-
- // Keep track of the total rows scanned and the total runs _not_ filtered out
- totalrows++;
- if (!hideRow) {
- unfilteredrowcount++;
- if (def(page)) {
- // Temporarily keep an array of unfiltered rows in case the page we're on goes past
- // the last page and we need to back up. Don't want to filter again!
- unfilteredrows.push(row);
- if (unfilteredrowcount<pagestart || unfilteredrowcount>pageend) {
- hideRow = true;
- }
- }
- }
-
- row.style.display = hideRow?"none":"";
- }
- }
-
- if (def(page)) {
- // Check to see if filtering has put us past the requested page index. If it has,
- // then go back to the last page and show it.
- if (pagestart>=unfilteredrowcount) {
- pagestart = unfilteredrowcount-(unfilteredrowcount%pagesize);
- tdata.page = page = pagestart/pagesize;
- for (var i=pagestart,L=unfilteredrows.length; i<L; i++) {
- unfilteredrows[i].style.display="";
- }
- }
- }
-
- // Loop through all THEADs and add/remove filtered class names
- this.processTableCells(t,"THEAD",
- function(c) {
- ((tdata.filters && def(tdata.filters[table.getCellIndex(c)]) && hasClass(c,table.FilterableClassName))?addClass:removeClass)(c,table.FilteredClassName);
- }
- );
-
- // Stripe the table if necessary
- if (tdata.stripeclass) {
- this.stripe(t);
- }
-
- // Calculate some values to be returned for info and updating purposes
- var pagecount = Math.floor(unfilteredrowcount/pagesize)+1;
- if (def(page)) {
- // Update the page number/total containers if they exist
- if (tdata.container_number) {
- tdata.container_number.innerHTML = page+1;
- }
- if (tdata.container_count) {
- tdata.container_count.innerHTML = pagecount;
- }
- }
-
- // Update the row count containers if they exist
- if (tdata.container_filtered_count) {
- tdata.container_filtered_count.innerHTML = unfilteredrowcount;
- }
- if (tdata.container_all_count) {
- tdata.container_all_count.innerHTML = totalrows;
- }
- return { 'data':tdata, 'unfilteredcount':unfilteredrowcount, 'total':totalrows, 'pagecount':pagecount, 'page':page, 'pagesize':pagesize };
- };
-
- /**
- * Shade alternate rows, aka Stripe the table.
- */
- table.stripe = function(t,className,args) {
- args = args || {};
- args.stripeclass = className;
-
- t = this.resolve(t,args);
- var tdata = this.tabledata[t.id];
-
- var bodies = t.tBodies;
- if (bodies==null || bodies.length==0) {
- return;
- }
-
- className = tdata.stripeclass;
- // Cache a shorter, quicker reference to either the remove or add class methods
- var f=[removeClass,addClass];
- for (var i=0,L=bodies.length; i<L; i++) {
- var tb = bodies[i], tbrows = tb.rows, cRowIndex=0, cRow, displayedCount=0;
- if (cRow=tbrows[cRowIndex]){
- // The ignorehiddenrows test is pulled out of the loop for a slight speed increase.
- // Makes a bigger difference in FF than in IE.
- // In this case, speed always wins over brevity!
- if (tdata.ignoreHiddenRows) {
- do {
- f[displayedCount++%2](cRow,className);
- } while (cRow=tbrows[++cRowIndex])
- }
- else {
- do {
- if (!isHidden(cRow)) {
- f[displayedCount++%2](cRow,className);
- }
- } while (cRow=tbrows[++cRowIndex])
- }
- }
- }
- };
-
- /**
- * Build up a list of unique values in a table column
- */
- table.getUniqueColValues = function(t,col) {
- var values={}, bodies = this.resolve(t).tBodies;
- for (var i=0,L=bodies.length; i<L; i++) {
- var tbody = bodies[i];
- for (var r=0,L2=tbody.rows.length; r<L2; r++) {
- values[this.getCellValue(tbody.rows[r].cells[col])] = true;
- }
- }
- var valArray = [];
- for (var val in values) {
- valArray.push(val);
- }
- return valArray.sort();
- };
-
- /**
- * Scan the document on load and add sorting, filtering, paging etc ability automatically
- * based on existence of class names on the table and cells.
- */
- table.auto = function(args) {
- var cells = [], tables = document.getElementsByTagName("TABLE");
- var val,tdata;
- if (tables!=null) {
- for (var i=0,L=tables.length; i<L; i++) {
- var t = table.resolve(tables[i]);
- tdata = table.tabledata[t.id];
- if (val=classValue(t,table.StripeClassNamePrefix)) {
- tdata.stripeclass=val;
- }
- // Do auto-filter if necessary
- if (hasClass(t,table.AutoFilterClassName)) {
- table.autofilter(t);
- }
- // Do auto-page if necessary
- if (val = classValue(t,table.AutoPageSizePrefix)) {
- table.autopage(t,{'pagesize':+val});
- }
- // Do auto-sort if necessary
- if ((val = classValue(t,table.AutoSortColumnPrefix)) || (hasClass(t,table.AutoSortClassName))) {
- table.autosort(t,{'col':(val==null)?null:+val});
- }
- // Do auto-stripe if necessary
- if (tdata.stripeclass && hasClass(t,table.AutoStripeClassName)) {
- table.stripe(t);
- }
- }
- }
- };
-
- /**
- * Add sorting functionality to a table header cell
- */
- table.autosort = function(t,args) {
- t = this.resolve(t,args);
- var tdata = this.tabledata[t.id];
- this.processTableCells(t, "THEAD", function(c) {
- var type = classValue(c,table.SortableColumnPrefix);
- if (type!=null) {
- type = type || "default";
- c.title =c.title || table.AutoSortTitle;
- addClass(c,table.SortableClassName);
- c.onclick = Function("","Table.sort(this,{'sorttype':Sort['"+type+"']})");
- // If we are going to auto sort on a column, we need to keep track of what kind of sort it will be
- if (args.col!=null) {
- if (args.col==table.getActualCellIndex(c)) {
- tdata.sorttype=Sort['"+type+"'];
- }
- }
- }
- } );
- if (args.col!=null) {
- table.sort(t,args);
- }
- };
-
- /**
- * Add paging functionality to a table
- */
- table.autopage = function(t,args) {
- t = this.resolve(t,args);
- var tdata = this.tabledata[t.id];
- if (tdata.pagesize) {
- this.processTableCells(t, "THEAD,TFOOT", function(c) {
- var type = classValue(c,table.AutoPageJumpPrefix);
- if (type=="next") { type = 1; }
- else if (type=="previous") { type = -1; }
- if (type!=null) {
- c.onclick = Function("","Table.pageJump(this,"+type+")");
- }
- } );
- if (val = classValue(t,table.PageNumberPrefix)) {
- tdata.container_number = document.getElementById(val);
- }
- if (val = classValue(t,table.PageCountPrefix)) {
- tdata.container_count = document.getElementById(val);
- }
- return table.page(t,0,args);
- }
- };
-
- /**
- * A util function to cancel bubbling of clicks on filter dropdowns
- */
- table.cancelBubble = function(e) {
- e = e || window.event;
- if (typeof(e.stopPropagation)=="function") { e.stopPropagation(); }
- if (def(e.cancelBubble)) { e.cancelBubble = true; }
- };
-
- /**
- * Auto-filter a table
- */
- table.autofilter = function(t,args) {
- args = args || {};
- t = this.resolve(t,args);
- var tdata = this.tabledata[t.id],val;
- table.processTableCells(t, "THEAD", function(cell) {
- if (hasClass(cell,table.FilterableClassName)) {
- var cellIndex = table.getCellIndex(cell);
- var colValues = table.getUniqueColValues(t,cellIndex);
- if (colValues.length>0) {
- if (typeof(args.insert)=="function") {
- func.insert(cell,colValues);
- }
- else {
- var sel = '<select onchange="Table.filter(this,this)" onclick="Table.cancelBubble(event)" class="'+table.AutoFilterClassName+'"><option value="">'+table.FilterAllLabel+'</option>';
- for (var i=0; i<colValues.length; i++) {
- sel += '<option value="'+colValues[i]+'">'+colValues[i]+'</option>';
- }
- sel += '</select>';
- cell.innerHTML += "<br>"+sel;
- }
- }
- }
- });
- if (val = classValue(t,table.FilteredRowcountPrefix)) {
- tdata.container_filtered_count = document.getElementById(val);
- }
- if (val = classValue(t,table.RowcountPrefix)) {
- tdata.container_all_count = document.getElementById(val);
- }
- };
-
- /**
- * Attach the auto event so it happens on load.
- * use jQuery's ready() function if available
- */
- if (typeof(jQuery)!="undefined") {
- jQuery(table.auto);
- }
- else if (window.addEventListener) {
- window.addEventListener( "load", table.auto, false );
- }
- else if (window.attachEvent) {
- window.attachEvent( "onload", table.auto );
- }
-
- return table;
-})();