Changeset 8d8ac52 in rtems-testing


Ignore:
Timestamp:
Jan 17, 2011, 10:19:16 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
0534b40
Parents:
454a3d8
Message:

2011-01-17 Joel Sherrill <joel.sherrilL@…>

Location:
covoar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • covoar/ChangeLog

    r454a3d8 r8d8ac52  
     12011-01-17      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * CoverageMapBase.cc, CoverageMapBase.h, DesiredSymbols.cc: Improve NOP
     4        detection and processing.
     5
    162010-10-04      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • covoar/CoverageMapBase.cc

    r454a3d8 r8d8ac52  
    150150  }
    151151
     152  bool CoverageMapBase::isNop( uint32_t address ) const
     153  {
     154    if ((address < lowAddress) || (address > highAddress))
     155      return false;
     156    return Info[ address - lowAddress ].isNop;
     157  }
     158
     159  void CoverageMapBase::setIsNop(
     160    uint32_t    address
     161  )
     162  {
     163    if ((address < lowAddress) || (address > highAddress))
     164      return;
     165    Info[ address - lowAddress ].isNop = true;
     166  }
     167
    152168  bool CoverageMapBase::isBranch( uint32_t address ) const
    153169  {
  • covoar/CoverageMapBase.h

    r454a3d8 r8d8ac52  
    126126    /*!
    127127     *  This method returns a boolean which indicates if the specified
     128     *  address is the starting address of a NOP instruction.
     129     *
     130     *  @param[in] address specifies the address to check
     131     *
     132     *  @return Returns TRUE if a NOP instruction is at the
     133     *   specified address and FALSE otherwise.
     134     */
     135    bool isNop( uint32_t address ) const;
     136
     137    /*!
     138     *  This method sets the boolean which indicates if the specified
     139     *  address is the starting address of a NOP instruction.
     140     *
     141     *  @param[in] address specifies the address of the NOP instruction
     142     */
     143    void setIsNop( uint32_t address );
     144
     145    /*!
     146     *  This method returns a boolean which indicates if the specified
    128147     *  address is the starting address of a branch instruction.
    129148     *
     
    216235      bool isBranch;
    217236      /*!
     237       *  This member indicates that the address is a NOP instruction.
     238       */
     239      bool isNop;
     240      /*!
    218241       *  When isBranch is TRUE, this member indicates that the branch
    219242       *  instruction at the address was taken.
  • covoar/DesiredSymbols.cc

    r454a3d8 r8d8ac52  
    103103  {
    104104    ObjdumpProcessor::objdumpLines_t::iterator fitr;
     105    ObjdumpProcessor::objdumpLines_t::iterator n, p;
    105106    DesiredSymbols::symbolSet_t::iterator      sitr;
    106107    CoverageMapBase*                           theCoverageMap;
     
    117118        continue;
    118119
    119       // Mark any branch instructions.
     120      // Mark any branch and NOP instructions.
    120121      for (fitr = sitr->second.instructions.begin();
    121122           fitr != sitr->second.instructions.end();
     
    126127           );
    127128        }
    128       }
     129        if (fitr->isNop) {
     130           theCoverageMap->setIsNop(
     131             fitr->address - sitr->second.baseAddress
     132           );
     133        }
     134      }
     135
    129136    }
    130137  }
     
    177184 
    178185        }
    179 
    180186 
    181187        if (!theCoverageMap->wasExecuted( a )) {
     
    216222      theBranches = new CoverageRanges();
    217223      sitr->second.uncoveredBranches = theBranches;
     224
     225      // Mark NOPs as executed
     226      endAddress = sitr->second.stats.sizeInBytes - 1;
     227      a = 0;
     228      while (a < endAddress) {
     229        if (!theCoverageMap->wasExecuted( a )) {
     230          a++;
     231          continue;
     232        }
     233
     234        for (ha=a+1;
     235             ha<=endAddress && !theCoverageMap->isStartOfInstruction( ha );
     236             ha++)
     237          ;
     238        if ( ha >= endAddress )
     239          break;
     240
     241        if (theCoverageMap->isNop( ha ))
     242          theCoverageMap->setWasExecuted( ha );
     243        a = ha;
     244      }
    218245
    219246      // Now scan through the coverage map of this symbol.
Note: See TracChangeset for help on using the changeset viewer.