change log for gcc-testing (2010-05-13)

rtems-vc at rtems.org rtems-vc at rtems.org
Thu May 13 18:10:02 UTC 2010


 *jennifer*:
2010-05-13	Jennifer Averett <Jennifer.Averett at OARcorp.com

	* DesiredSymbols.cc, DesiredSymbols.h, covoar.cc: Added a statistics
	class to consilidate statistical information. Note, that all new
	values are still 0 and are not yet calculated.

M  1.249  rtems-coverage/ChangeLog
M    1.5  rtems-coverage/DesiredSymbols.h
M   1.11  rtems-coverage/DesiredSymbols.cc
M   1.24  rtems-coverage/covoar.cc

diff -u gcc-testing/rtems-coverage/ChangeLog:1.248 gcc-testing/rtems-coverage/ChangeLog:1.249
--- gcc-testing/rtems-coverage/ChangeLog:1.248	Thu May 13 10:57:42 2010
+++ gcc-testing/rtems-coverage/ChangeLog	Thu May 13 12:36:16 2010
@@ -1,3 +1,9 @@
+2010-05-13	Jennifer Averett <Jennifer.Averett at OARcorp.com
+
+	* DesiredSymbols.cc, DesiredSymbols.h, covoar.cc: Added a statistics
+	class to consilidate statistical information. Note, that all new
+	values are still 0 and are not yet calculated.
+
 2010-05-13	Joel Sherrill <joel.sherrilL at OARcorp.com>
 
 	* do_coverage: Provide capability to only analyze one configuration.

diff -u gcc-testing/rtems-coverage/DesiredSymbols.h:1.4 gcc-testing/rtems-coverage/DesiredSymbols.h:1.5
--- gcc-testing/rtems-coverage/DesiredSymbols.h:1.4	Thu May 13 10:01:07 2010
+++ gcc-testing/rtems-coverage/DesiredSymbols.h	Thu May 13 12:36:17 2010
@@ -22,6 +22,90 @@
 
 namespace Coverage {
 
+
+  /*! @class Stats
+   * 
+   *  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 found.
+     */
+    int branchesFound;
+
+    /*!
+     *  This member variable contains the total number of branches never
+     *  taken.
+     */
+    int branchesNeverTaken;
+
+    /*!
+     *  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),
+       branchesFound(0),
+       branchesNeverTaken(0),
+       sizeInBytes(0),
+       sizeInInstructions(0),
+       uncoveredBytes(0),
+       uncoveredInstructions(0),
+       uncoveredRanges(0)
+     {
+     }
+
+
+      
+  };
+
   /*! @class SymbolInformation
    *
    *  This class defines the information kept for each symbol that is
@@ -36,10 +120,6 @@
      */
     uint32_t baseAddress;
 
-    /*!
-     *  This member contains the size of the symbol.
-     */
-    uint32_t sizeInBytes;
 
     /*!
      *  This member contains the disassembly associated with a symbol.
@@ -53,6 +133,11 @@
     std::string 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).
      */
@@ -75,7 +160,6 @@
      */
     SymbolInformation() :
       baseAddress( 0 ),
-      sizeInBytes( 0 ),
       uncoveredBranches( NULL ),
       uncoveredRanges( NULL ),
       unifiedCoverageMap( NULL )
@@ -215,31 +299,12 @@
      */
     void preprocess( void );
 
-  private:
-
     /*!
-     *  This member variable contains the total number of branches always
-     *  taken for all analyzed symbols.
-     */
-    int branchesAlwaysTaken;
+     *  This member contains the statistics kept on each symbol.
+     */    
+    Statistics stats;
 
-    /*!
-     *  This member variable contains the total number of branches found
-     *  for all analyzed symbols.
-     */
-    int branchesFound;
-
-    /*!
-     *  This member variable contains the total number of branches never
-     *  taken for all analyzed symbols.
-     */
-    int branchesNeverTaken;
-
-    /*
-     *  This member variable contains the total number of uncovered ranges
-     *  for all analyzed symbols.
-     */
-    int uncoveredRanges;
+  private:
 
     /*!
      *  This method uses the specified executable file to determine the

diff -u gcc-testing/rtems-coverage/DesiredSymbols.cc:1.10 gcc-testing/rtems-coverage/DesiredSymbols.cc:1.11
--- gcc-testing/rtems-coverage/DesiredSymbols.cc:1.10	Thu May 13 10:01:07 2010
+++ gcc-testing/rtems-coverage/DesiredSymbols.cc	Thu May 13 12:36:16 2010
@@ -24,10 +24,6 @@
 
   DesiredSymbols::DesiredSymbols()
   {
-    branchesAlwaysTaken = 0;
-    branchesFound = 0;
-    branchesNeverTaken = 0;
-    uncoveredRanges = 0;
   }
 
   DesiredSymbols::~DesiredSymbols()
@@ -163,7 +159,7 @@
       sitr->second.uncoveredBranches = theBranches;
 
       // Now scan through the coverage map of this symbol.
-      endAddress = sitr->second.sizeInBytes - 1;
+      endAddress = sitr->second.stats.sizeInBytes - 1;
       a = 0;
       while (a <= endAddress) {
 
@@ -177,7 +173,7 @@
             ;
           ha--;
 
-          uncoveredRanges++;
+          stats.uncoveredRanges++;
           theRanges->add(
             sitr->second.baseAddress + la,
             sitr->second.baseAddress + ha,
@@ -189,7 +185,7 @@
         // If an address is a branch instruction, add any uncovered branches
         // to the uncoverd branches.
         else if (theCoverageMap->isBranch( a )) {
-          branchesFound++;
+          stats.branchesFound++;
           la = a;
           for (ha=a+1;
                ha<=endAddress && !theCoverageMap->isStartOfInstruction( ha );
@@ -198,7 +194,7 @@
           ha--;
 
           if (theCoverageMap->wasAlwaysTaken( la )) {
-            branchesAlwaysTaken++;
+            stats.branchesAlwaysTaken++;
             theBranches->add(
               sitr->second.baseAddress + la,
               sitr->second.baseAddress + ha,
@@ -215,7 +211,7 @@
           }
 
           else if (theCoverageMap->wasNeverTaken( la )) {
-            branchesNeverTaken++;
+            stats.branchesNeverTaken++;
             theBranches->add(
               sitr->second.baseAddress + la,
               sitr->second.baseAddress + ha,
@@ -265,7 +261,7 @@
     if (itr->second.unifiedCoverageMap) {
 
       // ensure that the specified size matches the existing size.
-      if (itr->second.sizeInBytes != size) {
+      if (itr->second.stats.sizeInBytes != size) {
 
         fprintf(
           stderr,
@@ -301,7 +297,7 @@
           symbolName.c_str(), 0, highAddress
         );
       itr->second.unifiedCoverageMap = aCoverageMap;
-      itr->second.sizeInBytes = size;
+      itr->second.stats.sizeInBytes = size;
     }
   }
 
@@ -480,19 +476,19 @@
   }
 
   uint32_t DesiredSymbols::getNumberBranchesAlwaysTaken( void ) const {
-    return branchesAlwaysTaken;
+    return stats.branchesAlwaysTaken;
   };
 
   uint32_t DesiredSymbols::getNumberBranchesFound( void ) const {
-    return branchesFound;
+    return stats.branchesFound;
   };
 
   uint32_t DesiredSymbols::getNumberBranchesNeverTaken( void ) const {
-    return branchesNeverTaken;
+    return stats.branchesNeverTaken;
   };
 
   uint32_t DesiredSymbols::getNumberUncoveredRanges( void ) const {
-    return uncoveredRanges;
+    return stats.uncoveredRanges;
   };
 
   bool DesiredSymbols::isDesired (
@@ -540,7 +536,7 @@
 
     // Ensure that the source and destination coverage maps
     // are the same size.
-    dMapSize = itr->second.sizeInBytes;
+    dMapSize = itr->second.stats.sizeInBytes;
     sBaseAddress = sourceCoverageMap->getLowAddress();
     sMapSize = sourceCoverageMap->getHighAddress() - sBaseAddress + 1;
     if (dMapSize != sMapSize) {

diff -u gcc-testing/rtems-coverage/covoar.cc:1.23 gcc-testing/rtems-coverage/covoar.cc:1.24
--- gcc-testing/rtems-coverage/covoar.cc:1.23	Thu May 13 10:01:07 2010
+++ gcc-testing/rtems-coverage/covoar.cc	Thu May 13 12:36:17 2010
@@ -395,7 +395,7 @@
       theCoverageMap = itr->second.unifiedCoverageMap;
       if (theCoverageMap) {
 
-        endAddress = itr->second.sizeInBytes - 1;
+        endAddress = itr->second.stats.sizeInBytes - 1;
 
         for (a = 0; a <= endAddress; a++) {
           totalBytes++;



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100513/e2b3b225/attachment.html>


More information about the vc mailing list