<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems-testing (2011-01-17)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-01-17 Joel Sherrill <joel.sherrilL@OARcorp.com>

        * CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc: Improve NOP
        detection and processing.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/covoar/ChangeLog.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>covoar/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/covoar/CoverageMapBase.h.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>covoar/CoverageMapBase.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/covoar/CoverageMapBase.cc.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>covoar/CoverageMapBase.cc</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems-testing/covoar/DesiredSymbols.cc.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>covoar/DesiredSymbols.cc</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems-testing/covoar/ChangeLog:1.14 rtems-testing/covoar/ChangeLog:1.15
--- rtems-testing/covoar/ChangeLog:1.14 Mon Oct  4 11:59:43 2010
+++ rtems-testing/covoar/ChangeLog      Mon Jan 17 16:19:16 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-01-17    Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+       * CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc: Improve NOP
+       detection and processing.
+
</font> 2010-10-04        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * qemu-dump-trace.c: Fix issues identified by clang-analyzer.

<font color='#006600'>diff -u rtems-testing/covoar/CoverageMapBase.h:1.1 rtems-testing/covoar/CoverageMapBase.h:1.2
--- rtems-testing/covoar/CoverageMapBase.h:1.1  Mon May 24 15:07:07 2010
+++ rtems-testing/covoar/CoverageMapBase.h      Mon Jan 17 16:19:16 2011
</font><font color='#997700'>@@ -125,6 +125,25 @@
</font> 
     /*!
      *  This method returns a boolean which indicates if the specified
<font color='#000088'>+     *  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
</font>      *  address is the starting address of a branch instruction.
      *
      *  @param[in] address specifies the address to check
<font color='#997700'>@@ -215,6 +234,10 @@
</font>        */
       bool isBranch;
       /*!
<font color='#000088'>+       *  This member indicates that the address is a NOP instruction.
+       */
+      bool isNop;
+      /*!
</font>        *  When isBranch is TRUE, this member indicates that the branch
        *  instruction at the address was taken.
        */

<font color='#006600'>diff -u rtems-testing/covoar/CoverageMapBase.cc:1.1 rtems-testing/covoar/CoverageMapBase.cc:1.2
--- rtems-testing/covoar/CoverageMapBase.cc:1.1 Mon May 24 15:07:07 2010
+++ rtems-testing/covoar/CoverageMapBase.cc     Mon Jan 17 16:19:16 2011
</font><font color='#997700'>@@ -149,6 +149,22 @@
</font>     Info[ address - lowAddress ].isBranch = true;
   }
 
<font color='#000088'>+  bool CoverageMapBase::isNop( uint32_t address ) const
+  {
+    if ((address < lowAddress) || (address > highAddress))
+      return false;
+    return Info[ address - lowAddress ].isNop;
+  }
+
+  void CoverageMapBase::setIsNop(
+    uint32_t    address
+  )
+  {
+    if ((address < lowAddress) || (address > highAddress))
+      return;
+    Info[ address - lowAddress ].isNop = true;
+  }
+
</font>   bool CoverageMapBase::isBranch( uint32_t address ) const
   {
     if ((address < lowAddress) || (address > highAddress))

<font color='#006600'>diff -u rtems-testing/covoar/DesiredSymbols.cc:1.4 rtems-testing/covoar/DesiredSymbols.cc:1.5
--- rtems-testing/covoar/DesiredSymbols.cc:1.4  Wed May 26 18:19:52 2010
+++ rtems-testing/covoar/DesiredSymbols.cc      Mon Jan 17 16:19:16 2011
</font><font color='#997700'>@@ -102,6 +102,7 @@
</font>   void DesiredSymbols::preprocess( void )
   {
     ObjdumpProcessor::objdumpLines_t::iterator fitr;
<font color='#000088'>+    ObjdumpProcessor::objdumpLines_t::iterator n, p;
</font>     DesiredSymbols::symbolSet_t::iterator      sitr;
     CoverageMapBase*                           theCoverageMap;
 
<font color='#997700'>@@ -116,7 +117,7 @@
</font>       if (!theCoverageMap)
         continue;
 
<font color='#880000'>-      // Mark any branch instructions.
</font><font color='#000088'>+      // Mark any branch and NOP instructions.
</font>       for (fitr = sitr->second.instructions.begin();
            fitr != sitr->second.instructions.end();
            fitr++) {
<font color='#997700'>@@ -125,7 +126,13 @@
</font>              fitr->address - sitr->second.baseAddress
            );
         }
<font color='#000088'>+        if (fitr->isNop) {
+           theCoverageMap->setIsNop(
+             fitr->address - sitr->second.baseAddress
+           );
+        }
</font>       }
<font color='#000088'>+
</font>     }
   }
 
<font color='#997700'>@@ -176,7 +183,6 @@
</font>           }
  
         }
<font color='#880000'>-
</font>  
         if (!theCoverageMap->wasExecuted( a )) {
           stats.uncoveredBytes++;
<font color='#997700'>@@ -216,6 +222,27 @@
</font>       theBranches = new CoverageRanges();
       sitr->second.uncoveredBranches = theBranches;
 
<font color='#000088'>+      // 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 ))
+          theCoverageMap->setWasExecuted( ha );
+        a = ha;
+      }
+
</font>       // Now scan through the coverage map of this symbol.
       endAddress = sitr->second.stats.sizeInBytes - 1;
       a = 0;
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>