Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Function Class Reference

#include <Function.h>

List of all members.

Public Member Functions

 Function (uint32_t idx, uint32_t symCount, Symbol **symbols, RawSection *sect)
 ~Function ()
void updateSize (uint64_t size)
void updateInstructionSize ()
AddressIterator getAddressIterator ()
AddressIterator getInstructionIterator ()
uint32_t getIndex ()
RawSectiongetRawSection ()
FlowGraphgetFlowGraph ()
void generateCFG ()
uint32_t getSize ()
uint32_t getInstructionSize ()
bool instructionInRange (uint64_t addr)
uint64_t getBaseAddress ()
uint32_t getInstructionCount ()
uint32_t getInstructionIndex (uint64_t addr)
void print ()
void parseJumpTable (AddressIterator ait, BasicBlock **allBlocks, BasicBlock *currBlock=NULL, LinkedList< uint32_t > *tgtEdgeBags=NULL, LinkedList< uint32_t > *srcEdgeBags=NULL)
bool getJumpTableInformation (uint64_t *jumpTableAddr, uint32_t *jumpTableEntryCount, AddressIterator ait)
XCoffFilegetXCoffFile ()
void findMemoryFloatOps ()
HashCode getHashCode ()
BasicBlockgetBlock (uint32_t idx)
bool isAnySymbolA (char *name)
uint32_t getNumOfAllSymbols ()
uint32_t getAllSymbolNames (char *buffer, uint32_t len, bool onlyFirst)
void buildLoops ()

Protected Attributes

RawSectionrawSection
uint32_t index
uint32_t numOfAllSymbols
Symbol ** allSymbols
uint64_t baseAddress
uint32_t sizeInBytes
uint32_t insnSizeInBytes
FlowGraphflowGraph
HashCode hashCode


Constructor & Destructor Documentation

Function::Function uint32_t  idx,
uint32_t  symCount,
Symbol **  symbols,
RawSection sect
 

Definition at line 399 of file Function.C.

References allSymbols, ASSERT, baseAddress, GET, RawSection::getIndex(), SymbolTable::getSymbolLength(), RawSection::getSymbolTable(), hashCode, index, HashCode::isFunction(), numOfAllSymbols, rawSection, and sizeInBytes.

Function::~Function  )  [inline]
 

Definition at line 211 of file Function.h.

References allSymbols.


Member Function Documentation

void Function::buildLoops  )  [inline]
 

Definition at line 260 of file Function.h.

References FlowGraph::buildLoops(), and flowGraph.

Referenced by TextSection::buildLoops().

void Function::findMemoryFloatOps  ) 
 

Definition at line 948 of file Function.C.

References FlowGraph::findMemoryFloatOps(), and flowGraph.

Referenced by TextSection::findMemoryFloatOps().

void Function::generateCFG  ) 
 

Definition at line 653 of file Function.C.

References ASSERT, BitSet< T >::clear(), DEBUG_MORE, Instruction::definesLeaders(), FlowGraph::depthFirstSearch(), BitSet< T >::duplicateMembers(), LinkedList< T >::empty(), flowGraph, BasicBlock::getBaseAddress(), getBaseAddress(), FlowGraph::getBlock(), getIndex(), BasicBlock::getIndex(), getInstructionCount(), getInstructionIndex(), getInstructionIterator(), getInstructionSize(), getSize(), BasicBlock::getSizeInBytes(), Instruction::getTargetAddress(), AddressIterator::hasMore(), Instruction::hasTargetAddress(), index, FlowGraph::initializeAllBlocks(), BitSet< T >::insert(), instructionInRange(), Instruction::isCall(), Instruction::isCondBranch(), Instruction::isCondReturn(), Instruction::isIndirectJump(), BasicBlock::isJumpTable(), Instruction::isOtherBranch(), Instruction::isReturn(), Instruction::isZero(), FlowGraph::newBitSet(), parseJumpTable(), print(), PRINT_DEBUG, PRINT_ERROR, PRINT_INFOR, rawSection, RawSection::readInstruction(), AddressIterator::reset(), BitSet< T >::setall(), BasicBlock::setEntry(), BasicBlock::setExit(), FlowGraph::setImmDominatorBlocks(), BasicBlock::setNoPath(), BasicBlock::setSizeInBytes(), BasicBlock::setSources(), BasicBlock::setTargets(), BasicBlock::setTrace(), LinkedList< T >::shift(), BitSet< T >::size(), timer(), and TIMER.

Referenced by TextSection::generateCFGs().

AddressIterator Function::getAddressIterator  ) 
 

Definition at line 954 of file Function.C.

References baseAddress, AddressIterator::newAddressIteratorWord(), and sizeInBytes.

Referenced by updateInstructionSize().

uint32_t Function::getAllSymbolNames char *  buffer,
uint32_t  len,
bool  onlyFirst
 

Definition at line 425 of file Function.C.

References allSymbols, SymbolTable::getSymbolName(), RawSection::getSymbolTable(), numOfAllSymbols, and rawSection.

Referenced by CountAllBlocks::printInstrumentationPoints(), and CommonMethods::printInstrumentationPoints().

uint64_t Function::getBaseAddress  )  [inline]
 

Definition at line 232 of file Function.h.

References baseAddress.

Referenced by generateCFG(), and CountAllBlocks::printInstrumentationPoints().

BasicBlock* Function::getBlock uint32_t  idx  )  [inline]
 

Definition at line 253 of file Function.h.

References flowGraph, and FlowGraph::getBlock().

Referenced by XCoffFile::findBasicBlock().

FlowGraph * Function::getFlowGraph  ) 
 

Definition at line 649 of file Function.C.

References flowGraph.

Referenced by TextSection::getAllBlocks(), TextSection::getNumberOfBlocks(), TextSection::getNumberOfFloatPOps(), and TextSection::getNumberOfMemoryOps().

HashCode Function::getHashCode  )  [inline]
 

Definition at line 251 of file Function.h.

References hashCode.

Referenced by print(), and FlowGraph::print().

uint32_t Function::getIndex  )  [inline]
 

Definition at line 219 of file Function.h.

References index.

Referenced by FlowGraph::buildLoops(), generateCFG(), FlowGraph::getIndex(), MemoryOperation::MemoryOperation(), and BasicBlock::setIndex().

uint32_t Function::getInstructionCount  )  [inline]
 

Definition at line 234 of file Function.h.

References insnSizeInBytes.

Referenced by generateCFG(), and CountAllBlocks::printInstrumentationPoints().

uint32_t Function::getInstructionIndex uint64_t  addr  )  [inline]
 

Definition at line 235 of file Function.h.

References baseAddress.

Referenced by generateCFG(), and parseJumpTable().

AddressIterator Function::getInstructionIterator  ) 
 

Definition at line 958 of file Function.C.

References baseAddress, insnSizeInBytes, and AddressIterator::newAddressIteratorWord().

Referenced by generateCFG().

uint32_t Function::getInstructionSize  )  [inline]
 

Definition at line 226 of file Function.h.

References insnSizeInBytes.

Referenced by generateCFG().

bool Function::getJumpTableInformation uint64_t *  jumpTableAddr,
uint32_t *  jumpTableEntryCount,
AddressIterator  ait
 

Definition at line 506 of file Function.C.

References ASSERT, Instruction::definesJTBaseAddress(), Instruction::definesJTBaseAddrIndir(), Instruction::definesJTEntryCount(), Instruction::getJTBaseAddrIndirOffset(), Instruction::getJTBaseAddrIndirSrc(), Instruction::getJTBaseAddrTarget(), Instruction::getJTBaseOffsetTOC(), Instruction::getJTEntryCount(), Instruction::getLoadBeforeJumpSrc1(), getXCoffFile(), AddressIterator::hasMore(), AddressIterator::hasPrev(), INVALID_REGISTER, Instruction::isAddBeforeJump(), Instruction::isIndirectJumpCtr(), Instruction::isIndirectJumpLnk(), Instruction::isLoadBeforeJump(), PRINT_DEBUG, rawSection, RawSection::readInstruction(), and XCoffFile::readTOC().

Referenced by parseJumpTable().

uint32_t Function::getNumOfAllSymbols  )  [inline]
 

Definition at line 257 of file Function.h.

References numOfAllSymbols.

RawSection* Function::getRawSection  )  [inline]
 

Definition at line 221 of file Function.h.

References rawSection.

Referenced by FlowGraph::getRawSection().

uint32_t Function::getSize  )  [inline]
 

Definition at line 225 of file Function.h.

References sizeInBytes.

Referenced by generateCFG().

XCoffFile * Function::getXCoffFile  ) 
 

Definition at line 962 of file Function.C.

References RawSection::getXCoffFile(), and rawSection.

Referenced by getJumpTableInformation(), FlowGraph::getXCoffFile(), and parseJumpTable().

bool Function::instructionInRange uint64_t  addr  )  [inline]
 

Definition at line 228 of file Function.h.

References baseAddress, and insnSizeInBytes.

Referenced by generateCFG(), and parseJumpTable().

bool Function::isAnySymbolA char *  name  ) 
 

Definition at line 966 of file Function.C.

References allSymbols, SymbolTable::getSymbolName(), RawSection::getSymbolTable(), numOfAllSymbols, and rawSection.

Referenced by CountAllBlocks::findTerminationBlock(), and CommonMethods::findTerminationBlock().

void Function::parseJumpTable AddressIterator  ait,
BasicBlock **  allBlocks,
BasicBlock currBlock = NULL,
LinkedList< uint32_t > *  tgtEdgeBags = NULL,
LinkedList< uint32_t > *  srcEdgeBags = NULL
 

Definition at line 587 of file Function.C.

References XCoffFile::findRawSection(), flowGraph, RawSection::getAddressIterator(), BasicBlock::getIndex(), getInstructionIndex(), getJumpTableInformation(), getXCoffFile(), instructionInRange(), Instruction::isIndirectJumpCtr(), PRINT_DEBUG, rawSection, RawSection::readBytes(), RawSection::readInstruction(), BasicBlock::setJumpTable(), BasicBlock::setNoPath(), BasicBlock::setSizeInBytes(), AddressIterator::skipTo(), and AddressIterator::unit().

Referenced by generateCFG().

void Function::print  ) 
 

Definition at line 460 of file Function.C.

References allSymbols, baseAddress, DemangleWrapper::demangle_combined(), flowGraph, getHashCode(), SymbolTable::getStorageMapping(), SymbolTable::getSymbolLength(), SymbolTable::getSymbolName(), RawSection::getSymbolTable(), index, insnSizeInBytes, numOfAllSymbols, FlowGraph::print(), PRINT_INFOR, rawSection, and sizeInBytes.

Referenced by generateCFG(), and TextSection::print().

void Function::updateInstructionSize  ) 
 

Definition at line 487 of file Function.C.

References getAddressIterator(), AddressIterator::getOffset(), AddressIterator::hasMore(), insnSizeInBytes, Instruction::isZero(), rawSection, RawSection::readInstruction(), and sizeInBytes.

Referenced by TextSection::findFunctions().

void Function::updateSize uint64_t  size  )  [inline]
 

Definition at line 213 of file Function.h.

References sizeInBytes.

Referenced by TextSection::findFunctions().


Member Data Documentation

Symbol** Function::allSymbols [protected]
 

Definition at line 197 of file Function.h.

Referenced by Function(), getAllSymbolNames(), isAnySymbolA(), print(), and ~Function().

uint64_t Function::baseAddress [protected]
 

Definition at line 199 of file Function.h.

Referenced by Function(), getAddressIterator(), getBaseAddress(), getInstructionIndex(), getInstructionIterator(), instructionInRange(), and print().

FlowGraph* Function::flowGraph [protected]
 

Definition at line 204 of file Function.h.

Referenced by buildLoops(), findMemoryFloatOps(), generateCFG(), getBlock(), getFlowGraph(), parseJumpTable(), and print().

HashCode Function::hashCode [protected]
 

Definition at line 206 of file Function.h.

Referenced by Function(), and getHashCode().

uint32_t Function::index [protected]
 

Definition at line 194 of file Function.h.

Referenced by Function(), generateCFG(), getIndex(), and print().

uint32_t Function::insnSizeInBytes [protected]
 

Definition at line 202 of file Function.h.

Referenced by getInstructionCount(), getInstructionIterator(), getInstructionSize(), instructionInRange(), print(), and updateInstructionSize().

uint32_t Function::numOfAllSymbols [protected]
 

Definition at line 196 of file Function.h.

Referenced by Function(), getAllSymbolNames(), getNumOfAllSymbols(), isAnySymbolA(), and print().

RawSection* Function::rawSection [protected]
 

Definition at line 193 of file Function.h.

Referenced by Function(), generateCFG(), getAllSymbolNames(), getJumpTableInformation(), getRawSection(), getXCoffFile(), isAnySymbolA(), parseJumpTable(), print(), and updateInstructionSize().

uint32_t Function::sizeInBytes [protected]
 

Definition at line 200 of file Function.h.

Referenced by Function(), getAddressIterator(), getSize(), print(), updateInstructionSize(), and updateSize().


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 11:08:39 2008 for PMaCInstrumentor by doxygen 1.3.5