RCS file: /usr1/CVS/rtems-testing/covoar/CoverageMapBase.cc,v
retrieving revision 1.4
diff -u -8 -p -r1.4 CoverageMapBase.cc
|
|
namespace Coverage { |
35 | 35 | |
36 | 36 | Info = new perAddressInfo_t[ Size ]; |
37 | 37 | |
38 | 38 | for (a=0; a<Size; a++) { |
39 | 39 | |
40 | 40 | perAddressInfo_t *i = &Info[ a ]; |
41 | 41 | |
42 | 42 | i->isStartOfInstruction = false; |
43 | | i->wasExecuted = false; |
| 43 | i->wasExecuted = 0; |
44 | 44 | i->isBranch = false; |
45 | 45 | i->isNop = false; |
46 | 46 | i->wasTaken = false; |
47 | 47 | i->wasNotTaken = false; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | 51 | CoverageMapBase::~CoverageMapBase() |
… |
… |
namespace Coverage { |
195 | 195 | |
196 | 196 | void CoverageMapBase::setWasExecuted( uint32_t address ) |
197 | 197 | { |
198 | 198 | uint32_t offset; |
199 | 199 | |
200 | 200 | if (determineOffset( address, &offset ) != true) |
201 | 201 | return; |
202 | 202 | |
203 | | Info[ offset ].wasExecuted = true; |
| 203 | Info[ offset ].wasExecuted += 1; |
204 | 204 | } |
205 | 205 | |
| 206 | void CoverageMapBase::sumWasExecuted( uint32_t address, uint32_t addition) |
| 207 | { |
| 208 | uint32_t offset; |
| 209 | |
| 210 | if (determineOffset( address, &offset ) != true) |
| 211 | return; |
| 212 | |
| 213 | Info[ offset ].wasExecuted += addition; |
| 214 | } |
| 215 | |
206 | 216 | bool CoverageMapBase::wasExecuted( uint32_t address ) const |
207 | 217 | { |
208 | 218 | uint32_t offset; |
| 219 | bool result; |
209 | 220 | |
| 221 | result = true; |
| 222 | |
210 | 223 | if (determineOffset( address, &offset ) != true) |
211 | | return false; |
| 224 | result = false; |
| 225 | |
| 226 | if (Info[ offset ].wasExecuted <= 0) |
| 227 | result = false; |
| 228 | |
| 229 | return result; |
| 230 | } |
| 231 | |
| 232 | uint32_t CoverageMapBase::getWasExecuted( uint32_t address ) const |
| 233 | { |
| 234 | uint32_t offset; |
| 235 | |
| 236 | if (determineOffset( address, &offset ) != true) |
| 237 | return 0; |
212 | 238 | |
213 | | return Info[ offset ].wasExecuted; |
| 239 | return Info[ offset ].wasExecuted; |
214 | 240 | } |
215 | 241 | |
216 | 242 | void CoverageMapBase::setIsBranch( |
217 | 243 | uint32_t address |
218 | 244 | ) |
219 | 245 | { |
220 | 246 | uint32_t offset; |
221 | 247 | |
RCS file: /usr1/CVS/rtems-testing/covoar/CoverageMapBase.h,v
retrieving revision 1.3
diff -u -8 -p -r1.3 CoverageMapBase.h
|
|
namespace Coverage { |
170 | 170 | * @param[in] address specifies the address to check |
171 | 171 | * |
172 | 172 | * @return Returns TRUE if the specified address is the start |
173 | 173 | * of an instruction and FALSE otherwise. |
174 | 174 | */ |
175 | 175 | bool isStartOfInstruction( uint32_t address ) const; |
176 | 176 | |
177 | 177 | /*! |
178 | | * This method sets the boolean which indicates that the instruction |
179 | | * at the specified address was executed. |
| 178 | * This method iterates the counter which indicates how many times |
| 179 | * the instruction at the specified address was executed. |
180 | 180 | * |
181 | 181 | * @param[in] address specifies the address which was executed |
182 | 182 | */ |
183 | 183 | virtual void setWasExecuted( uint32_t address ); |
184 | 184 | |
185 | 185 | /*! |
186 | 186 | * This method returns a boolean which indicates if the instruction |
187 | 187 | * at the specified address was executed. |
… |
… |
namespace Coverage { |
189 | 189 | * @param[in] address specifies the address to check |
190 | 190 | * |
191 | 191 | * @return Returns TRUE if the instruction at the specified |
192 | 192 | * address was executed and FALSE otherwise. |
193 | 193 | */ |
194 | 194 | bool wasExecuted( uint32_t address ) const; |
195 | 195 | |
196 | 196 | /*! |
| 197 | * This method increases the counter which indicates how many times |
| 198 | * the instruction at the specified address was executed. It is used |
| 199 | * for merging coverage maps. |
| 200 | * |
| 201 | * @param[in] address specifies the address which was executed |
| 202 | * @param[in] address specifies the execution count that should be |
| 203 | * added |
| 204 | */ |
| 205 | virtual void sumWasExecuted( uint32_t address, uint32_t addition); |
| 206 | |
| 207 | /*! |
| 208 | * This method returns an unsigned integer which indicates how often |
| 209 | * the instruction at the specified address was executed. |
| 210 | * |
| 211 | * @param[in] address specifies the address to check |
| 212 | * |
| 213 | * @return Returns number of executins |
| 214 | */ |
| 215 | uint32_t getWasExecuted( uint32_t address ) const; |
| 216 | |
| 217 | /*! |
197 | 218 | * This method sets the boolean which indicates if the specified |
198 | 219 | * address is the starting address of a branch instruction. |
199 | 220 | * |
200 | 221 | * @param[in] address specifies the address of the branch instruction |
201 | 222 | */ |
202 | 223 | void setIsBranch( uint32_t address ); |
203 | 224 | |
204 | 225 | /*! |
… |
… |
namespace Coverage { |
299 | 320 | */ |
300 | 321 | typedef struct { |
301 | 322 | /*! |
302 | 323 | * This member indicates that the address is the start of |
303 | 324 | * an instruction. |
304 | 325 | */ |
305 | 326 | bool isStartOfInstruction; |
306 | 327 | /*! |
307 | | * This member indicates that the address was executed. |
| 328 | * This member indicates how many times the address was executed. |
308 | 329 | */ |
309 | | bool wasExecuted; |
| 330 | uint32_t wasExecuted; |
310 | 331 | /*! |
311 | 332 | * This member indicates that the address is a branch instruction. |
312 | 333 | */ |
313 | 334 | bool isBranch; |
314 | 335 | /*! |
315 | 336 | * This member indicates that the address is a NOP instruction. |
316 | 337 | */ |
317 | 338 | bool isNop; |
RCS file: /usr1/CVS/rtems-testing/covoar/DesiredSymbols.cc,v
retrieving revision 1.7
diff -u -8 -p -r1.7 DesiredSymbols.cc
|
|
namespace Coverage { |
624 | 624 | { |
625 | 625 | uint32_t dAddress; |
626 | 626 | CoverageMapBase* destinationCoverageMap; |
627 | 627 | uint32_t dMapSize; |
628 | 628 | symbolSet_t::iterator itr; |
629 | 629 | uint32_t sAddress; |
630 | 630 | uint32_t sBaseAddress; |
631 | 631 | uint32_t sMapSize; |
| 632 | uint32_t executionCount; |
632 | 633 | |
633 | 634 | // Ensure that the symbol is a desired symbol. |
634 | 635 | itr = set.find( symbolName ); |
635 | 636 | |
636 | 637 | if (itr == set.end()) { |
637 | 638 | |
638 | 639 | fprintf( |
639 | 640 | stderr, |
… |
… |
namespace Coverage { |
668 | 669 | |
669 | 670 | sAddress = dAddress + sBaseAddress; |
670 | 671 | |
671 | 672 | // Merge start of instruction indication. |
672 | 673 | if (sourceCoverageMap->isStartOfInstruction( sAddress )) |
673 | 674 | destinationCoverageMap->setIsStartOfInstruction( dAddress ); |
674 | 675 | |
675 | 676 | // Merge the execution data. |
676 | | if (sourceCoverageMap->wasExecuted( sAddress )) |
677 | | destinationCoverageMap->setWasExecuted( dAddress ); |
| 677 | executionCount = sourceCoverageMap->getWasExecuted( sAddress ); |
| 678 | destinationCoverageMap->sumWasExecuted( dAddress, executionCount ); |
678 | 679 | |
679 | 680 | // Merge the branch data. |
680 | 681 | if (sourceCoverageMap->wasTaken( sAddress )) |
681 | 682 | destinationCoverageMap->setWasTaken( dAddress ); |
682 | 683 | |
683 | 684 | if (sourceCoverageMap->wasNotTaken( sAddress )) |
684 | 685 | destinationCoverageMap->setWasNotTaken( dAddress ); |
685 | 686 | } |
RCS file: /usr1/CVS/rtems-testing/covoar/covoar.cc,v
retrieving revision 1.3
diff -u -8 -p -r1.3 covoar.cc
|
|
void usage() |
76 | 76 | #define PrintableString(_s) \ |
77 | 77 | ((!(_s)) ? "NOT SET" : (_s)) |
78 | 78 | |
79 | 79 | /* |
80 | 80 | * Configuration File Support |
81 | 81 | */ |
82 | 82 | #include "ConfigFile.h" |
83 | 83 | Configuration::FileReader *CoverageConfiguration; |
84 | | |
85 | 84 | Configuration::Options_t Options[] = { |
86 | 85 | { "explanations", NULL }, |
87 | 86 | { "format", NULL }, |
88 | 87 | { "symbolsFile", NULL }, |
89 | 88 | { "outputDirectory", NULL }, |
90 | 89 | { "executableExtension", NULL }, |
91 | 90 | { "coverageExtension", NULL }, |
92 | 91 | { "target", NULL }, |