InstructionCountAnnotator::PTracer Class Reference

Execution Count annotation based on ptrace(). More...

#include <PTracer.h>

List of all members.

Public Types

typedef std::map< address,
BreakpointInfo >::iterator 
BpIter
typedef std::map< address,
BreakpointInfo >::const_iterator 
const_BpIter

Public Member Functions

 PTracer ()
void loadProcess (const std::vector< std::string > &args)
bool addStatementForTracing (SgAsmStatement *node)
void run ()
const std::map< address, BreakpointInfo > & getBreakpointInfoMap () const
void printMem (long startAddr, int byteCount)

Protected Member Functions

void insertBreakpoint (address position)
void removeBreakpoint (address position)
void execProcess (const std::vector< std::string > &args)
bool atBreakpointHit ()
 Handler function for breakpoint hits.
bool enableBreakpoint (BreakpointInfo &info)
 Enables breakpoint (writes int3 at the right position).
bool disableBreakpoint (BreakpointInfo &info)
 Disables breakpoint (removes int3) but does not delete info structure.
long getInstructionPointer ()
void setInstructionPointer (long addr)
Registers getRegisters ()
void setRegisters (const Registers &data)

Protected Attributes

std::map< address, BreakpointInfobreakPoints
pid_t curPid
 pid of the child process

Classes

class  BreakpointInfo


Detailed Description

Execution Count annotation based on ptrace().

This module is only built when ROSEQT_EXPERIMENTAL is set, because it's UNIX specific (problems when building on MAC) If you want to use this functionality in a architecture independent way use the IntelPIN mechanism: InstructionCountAnnotator::annotate()

This Module operates on a Binary AST - it traverses all SgAsmInstructions, and inserts a breakpoint at the corresponding addresses Therefore the ptrace() system-call is used. Then the binary is executed and the execution count for each instruction is logged and annotated

Definition at line 42 of file PTracer.h.


Member Typedef Documentation

typedef std::map<address,BreakpointInfo>::iterator InstructionCountAnnotator::PTracer::BpIter

Definition at line 85 of file PTracer.h.

typedef std::map<address,BreakpointInfo>::const_iterator InstructionCountAnnotator::PTracer::const_BpIter

Definition at line 86 of file PTracer.h.


Constructor & Destructor Documentation

InstructionCountAnnotator::PTracer::PTracer (  ) 


Member Function Documentation

bool InstructionCountAnnotator::PTracer::addStatementForTracing ( SgAsmStatement *  node  ) 

Referenced by InstructionCountAnnotator::annotate().

Here is the caller graph for this function:

bool InstructionCountAnnotator::PTracer::atBreakpointHit (  )  [protected]

Handler function for breakpoint hits.

bool InstructionCountAnnotator::PTracer::disableBreakpoint ( BreakpointInfo info  )  [protected]

Disables breakpoint (removes int3) but does not delete info structure.

bool InstructionCountAnnotator::PTracer::enableBreakpoint ( BreakpointInfo info  )  [protected]

Enables breakpoint (writes int3 at the right position).

void InstructionCountAnnotator::PTracer::execProcess ( const std::vector< std::string > &  args  )  [protected]

calls exec (does not return), in args[0] the path of the executable file is expected

const std::map<address,BreakpointInfo>& InstructionCountAnnotator::PTracer::getBreakpointInfoMap (  )  const [inline]

Definition at line 83 of file PTracer.h.

Referenced by InstructionCountAnnotator::annotate().

Here is the caller graph for this function:

long InstructionCountAnnotator::PTracer::getInstructionPointer (  )  [protected]

Registers InstructionCountAnnotator::PTracer::getRegisters (  )  [protected]

void InstructionCountAnnotator::PTracer::insertBreakpoint ( address  position  )  [protected]

void InstructionCountAnnotator::PTracer::loadProcess ( const std::vector< std::string > &  args  ) 

Referenced by InstructionCountAnnotator::annotate().

Here is the caller graph for this function:

void InstructionCountAnnotator::PTracer::printMem ( long  startAddr,
int  byteCount 
)

void InstructionCountAnnotator::PTracer::removeBreakpoint ( address  position  )  [protected]

void InstructionCountAnnotator::PTracer::run (  ) 

Referenced by InstructionCountAnnotator::annotate().

Here is the caller graph for this function:

void InstructionCountAnnotator::PTracer::setInstructionPointer ( long  addr  )  [protected]

void InstructionCountAnnotator::PTracer::setRegisters ( const Registers data  )  [protected]


Member Data Documentation

std::map<address,BreakpointInfo> InstructionCountAnnotator::PTracer::breakPoints [protected]

Definition at line 122 of file PTracer.h.

Referenced by getBreakpointInfoMap().

pid_t InstructionCountAnnotator::PTracer::curPid [protected]

pid of the child process

Definition at line 126 of file PTracer.h.


The documentation for this class was generated from the following file:
Generated on Tue Sep 15 14:48:50 2009 for RoseQtWidgets by  doxygen 1.4.7