NS_power::instruction Class Reference

#include <arch-power.h>

Public Member Functions

 instruction ()
 instruction (unsigned int raw)
 instruction (const void *ptr)
 instruction (const instruction &insn)
 instruction (instructUnion &insn)
instructioncopy () const
void clear ()
void setInstruction (codeBuf_t *ptr, Address=0)
void setBits (unsigned int pos, unsigned int len, unsigned int value)
unsigned int asInt () const
void setInstruction (unsigned char *ptr, Address=0)
Address getBranchOffset () const
void setBranchOffset (Address newOffset)
unsigned type () const
const unsigned char * ptr () const
unsigned opcode () const
bool isInsnType (const unsigned mask, const unsigned match) const
Address getTarget (Address insnAddr) const
unsigned spaceToRelocate () const
bool getUsedRegs (pdvector< int > &regs)
bool valid () const
bool isCall () const
bool isCondBranch () const
bool isUncondBranch () const
bool isThunk () const
bool isCleaningRet () const

Static Public Member Functions

static int signExtend (unsigned int i, unsigned int pos)
static instructUnionswapBytes (instructUnion &i)
static unsigned size ()
static unsigned jumpSize (Address from, Address to, unsigned addr_width)
static unsigned jumpSize (Address disp, unsigned addr_width)
static unsigned maxJumpSize (unsigned addr_width)
static unsigned maxInterFunctionJumpSize (unsigned addr_width)
static bool isAligned (Address addr)

Private Attributes

instructUnion insn_

Detailed Description

Definition at line 770 of file arch-power.h.


Constructor & Destructor Documentation

NS_power::instruction::instruction (  )  [inline]

Definition at line 775 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

Referenced by copy().

NS_power::instruction::instruction ( unsigned int  raw  )  [inline]

Definition at line 776 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

NS_power::instruction::instruction ( const void *  ptr  )  [inline]

Definition at line 781 of file arch-power.h.

References insn_.

NS_power::instruction::instruction ( const instruction insn  )  [inline]

Definition at line 785 of file arch-power.h.

NS_power::instruction::instruction ( instructUnion insn  )  [inline]

Definition at line 786 of file arch-power.h.


Member Function Documentation

unsigned int NS_power::instruction::asInt (  )  const [inline]

Definition at line 805 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

Referenced by Dyninst::SymtabAPI::emitElfStatic::createStub().

void NS_power::instruction::clear (  )  [inline]

Definition at line 791 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

instruction * instruction::copy (  )  const

Definition at line 74 of file arch-power.C.

References instruction().

Address instruction::getBranchOffset (  )  const

Definition at line 263 of file arch-power.C.

References BFORM_BD, IFORM_LI, isCondBranch(), and isUncondBranch().

Referenced by getTarget().

Address instruction::getTarget ( Address  insnAddr  )  const
bool instruction::getUsedRegs ( pdvector< int > &  regs  ) 

Definition at line 223 of file arch-power.C.

static bool NS_power::instruction::isAligned ( Address  addr  )  [inline, static]

Definition at line 869 of file arch-power.h.

bool instruction::isCall (  )  const
bool NS_power::instruction::isCleaningRet (  )  const [inline]

Definition at line 878 of file arch-power.h.

bool instruction::isCondBranch (  )  const

Definition at line 145 of file arch-power.C.

References BCmatch, Bmask, and isInsnType().

Referenced by getBranchOffset(), getTarget(), setBranchOffset(), and spaceToRelocate().

bool NS_power::instruction::isInsnType ( const unsigned  mask,
const unsigned  match 
) const [inline]

Definition at line 843 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

Referenced by getTarget(), isCall(), isCondBranch(), and isUncondBranch().

bool instruction::isThunk (  )  const

Definition at line 233 of file arch-power.C.

References BCop, BFORM_AA, BFORM_BD, BFORM_BO, BFORM_LK, BFORM_OP, and Bop.

Referenced by spaceToRelocate().

bool instruction::isUncondBranch (  )  const

Definition at line 141 of file arch-power.C.

References Bmask, Bmatch, and isInsnType().

Referenced by getBranchOffset(), getTarget(), setBranchOffset(), and spaceToRelocate().

unsigned instruction::jumpSize ( Address  disp,
unsigned  addr_width 
) [static]

Definition at line 155 of file arch-power.C.

References ABS, MAX_BRANCH, maxInterFunctionJumpSize(), and size().

unsigned instruction::jumpSize ( Address  from,
Address  to,
unsigned  addr_width 
) [static]

Definition at line 149 of file arch-power.C.

References ABS.

unsigned instruction::maxInterFunctionJumpSize ( unsigned  addr_width  )  [static]

Definition at line 172 of file arch-power.C.

References size().

Referenced by jumpSize().

unsigned instruction::maxJumpSize ( unsigned  addr_width  )  [static]

Definition at line 162 of file arch-power.C.

References size().

unsigned instruction::opcode (  )  const

Definition at line 274 of file arch-power.C.

References MDFORM_OP.

const unsigned char* NS_power::instruction::ptr (  )  const [inline]

Definition at line 831 of file arch-power.h.

References insn_.

void NS_power::instruction::setBits ( unsigned int  pos,
unsigned int  len,
unsigned int  value 
) [inline]

Definition at line 793 of file arch-power.h.

References insn_, and NS_power::instructUnion::raw.

void instruction::setBranchOffset ( Address  newOffset  ) 
void instruction::setInstruction ( unsigned char *  ptr,
Address  = 0 
)

Definition at line 135 of file arch-power.C.

References insn_.

void instruction::setInstruction ( codeBuf_t ptr,
Address  = 0 
)

Definition at line 123 of file arch-power.C.

References insn_, NS_power::instructUnion::raw, and NS_power::swapBytesIfNeeded().

int instruction::signExtend ( unsigned int  i,
unsigned int  pos 
) [static]

Definition at line 49 of file arch-power.C.

static unsigned NS_power::instruction::size (  )  [inline, static]

Definition at line 814 of file arch-power.h.

Referenced by jumpSize(), maxInterFunctionJumpSize(), maxJumpSize(), and spaceToRelocate().

unsigned instruction::spaceToRelocate (  )  const

Definition at line 193 of file arch-power.C.

References BALWAYScond, BALWAYSmask, BFORM_BO, isCondBranch(), isThunk(), isUncondBranch(), and size().

instructUnion & instruction::swapBytes ( instructUnion i  )  [static]

Definition at line 61 of file arch-power.C.

References NS_power::instructUnion::byte.

Referenced by NS_power::swapBytesIfNeeded().

unsigned NS_power::instruction::type (  )  const
bool NS_power::instruction::valid (  )  const [inline]

Definition at line 865 of file arch-power.h.

References IFORM_OP.


Field Documentation

Definition at line 772 of file arch-power.h.

Referenced by asInt(), clear(), instruction(), isInsnType(), ptr(), setBits(), and setInstruction().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1