Changeset 2b9fbf4 in rtems-testing


Ignore:
Timestamp:
Apr 25, 2010, 12:33:45 AM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
f73e180
Parents:
b9077c6
Message:

2010-04-24 Joel Sherrill <joel.sherrilL@…>

  • CoverageReaderQEMU.cc: Fixed branches taken/not taken.
Location:
rtems-coverage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtems-coverage/ChangeLog

    rb9077c6 r2b9fbf4  
     12010-04-24      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * CoverageReaderQEMU.cc: Fixed branches taken/not taken.
     4
    152010-04-24      Joel Sherrill <joel.sherrilL@OARcorp.com>
    26
  • rtems-coverage/CoverageReaderQEMU.cc

    rb9077c6 r2b9fbf4  
    141141
    142142        // Determine if additional branch information is available. */
    143         if (entry->op & TRACE_OP_TAKEN) {
    144           aCoverageMap->setIsBranch( entry->pc + entry->size - 1);
    145           aCoverageMap->setWasTaken( entry->pc + entry->size - 1);
    146         } else if (entry->op & TRACE_OP_NOT_TAKEN) {
    147           aCoverageMap->setIsBranch( entry->pc + entry->size - 1);
    148           aCoverageMap->setWasNotTaken( entry->pc + entry->size -1 );
     143        if ( (entry->op & (TRACE_OP_TAKEN|TRACE_OP_NOT_TAKEN)) != 0 ) {
     144          unsigned int a = entry->pc + entry->size - 1;
     145          while (!aCoverageMap->isStartOfInstruction(a))
     146            a--;
     147          aCoverageMap->setIsBranch( a );
     148          if (entry->op & TRACE_OP_TAKEN) {
     149            aCoverageMap->setWasTaken( a );
     150          } else if (entry->op & TRACE_OP_NOT_TAKEN) {
     151            aCoverageMap->setWasNotTaken( a );
     152          }
    149153        }
    150154      }
Note: See TracChangeset for help on using the changeset viewer.