change log for rtems-testing (2011-01-17)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Jan 17 23:10:02 UTC 2011
*joel*:
2011-01-17 Joel Sherrill <joel.sherrilL at OARcorp.com>
* CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc: Improve NOP
detection and processing.
M 1.15 covoar/ChangeLog
M 1.2 covoar/CoverageMapBase.h
M 1.2 covoar/CoverageMapBase.cc
M 1.5 covoar/DesiredSymbols.cc
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
@@ -1,3 +1,8 @@
+2011-01-17 Joel Sherrill <joel.sherrilL at OARcorp.com>
+
+ * CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc: Improve NOP
+ detection and processing.
+
2010-10-04 Joel Sherrill <joel.sherrill at oarcorp.com>
* qemu-dump-trace.c: Fix issues identified by clang-analyzer.
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
@@ -125,6 +125,25 @@
/*!
* 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
@@ -215,6 +234,10 @@
*/
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.
*/
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
@@ -149,6 +149,22 @@
Info[ address - lowAddress ].isBranch = true;
}
+ 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;
+ }
+
bool CoverageMapBase::isBranch( uint32_t address ) const
{
if ((address < lowAddress) || (address > highAddress))
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
@@ -102,6 +102,7 @@
void DesiredSymbols::preprocess( void )
{
ObjdumpProcessor::objdumpLines_t::iterator fitr;
+ ObjdumpProcessor::objdumpLines_t::iterator n, p;
DesiredSymbols::symbolSet_t::iterator sitr;
CoverageMapBase* theCoverageMap;
@@ -116,7 +117,7 @@
if (!theCoverageMap)
continue;
- // Mark any branch instructions.
+ // Mark any branch and NOP instructions.
for (fitr = sitr->second.instructions.begin();
fitr != sitr->second.instructions.end();
fitr++) {
@@ -125,7 +126,13 @@
fitr->address - sitr->second.baseAddress
);
}
+ if (fitr->isNop) {
+ theCoverageMap->setIsNop(
+ fitr->address - sitr->second.baseAddress
+ );
+ }
}
+
}
}
@@ -176,7 +183,6 @@
}
}
-
if (!theCoverageMap->wasExecuted( a )) {
stats.uncoveredBytes++;
@@ -216,6 +222,27 @@
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 ))
+ theCoverageMap->setWasExecuted( ha );
+ a = ha;
+ }
+
// Now scan through the coverage map of this symbol.
endAddress = sitr->second.stats.sizeInBytes - 1;
a = 0;
--
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/20110117/f27d42b4/attachment-0001.html>
More information about the vc
mailing list