ROSE  0.11.87.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc Class Reference

Description

Definition at line 27 of file DispatcherPowerpc.h.

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc:
Collaboration graph
[legend]

Public Types

using Super = BaseSemantics::Dispatcher
 Base type. More...
 
using Ptr = DispatcherPowerpcPtr
 Shared-ownership pointer. More...
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher
using Ptr = DispatcherPtr
 Shared-ownership pointer for a Dispatcher object. More...
 

Public Member Functions

virtual BaseSemantics::DispatcherPtr create (const BaseSemantics::RiscOperatorsPtr &ops, size_t addrWidth=0, const RegisterDictionary *regs=NULL) const override
 Virtual constructor. More...
 
virtual void set_register_dictionary (const RegisterDictionary *regdict) override
 
virtual RegisterDescriptor instructionPointerRegister () const override
 Returns the instruction pointer register. More...
 
virtual RegisterDescriptor stackPointerRegister () const override
 Returns the stack pointer register. More...
 
virtual RegisterDescriptor stackFrameRegister () const override
 Returns the stack call frame register. More...
 
virtual RegisterDescriptor callReturnRegister () const override
 Returns the function call return address register. More...
 
virtual int iprocKey (SgAsmInstruction *insn_) const override
 Given an instruction, return the InsnProcessor key that can be used as an index into the iproc_table. More...
 
void setXerOverflow (const BaseSemantics::SValuePtr &hadOverflow)
 Set the XER OV and SO bits as specified. More...
 
virtual void updateCr0 (const BaseSemantics::SValuePtr &result)
 Write status flags for result. More...
 
BaseSemantics::SValuePtr readAndUpdate (BaseSemantics::RiscOperators *, SgAsmExpression *, size_t valueNBits)
 Reads from a memory address and updates a register with the effective address that was read. More...
 
void writeAndUpdate (BaseSemantics::RiscOperators *, SgAsmExpression *destination, const BaseSemantics::SValuePtr &value)
 Writes a value to a memory address and updates a register with the effective address to which the value was written. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher
virtual void processInstruction (SgAsmInstruction *insn)
 Process a single instruction. More...
 
virtual InsnProcessoriprocLookup (SgAsmInstruction *insn)
 Lookup the processor for an instruction. More...
 
virtual void iprocReplace (SgAsmInstruction *insn, InsnProcessor *iproc)
 Replace an instruction processor with another. More...
 
virtual void iprocSet (int key, InsnProcessor *iproc)
 Set an iproc table entry to the specified value. More...
 
virtual InsnProcessoriprocGet (int key)
 Obtain an iproc table entry for the specified key. More...
 
virtual RiscOperatorsPtr get_operators () const ROSE_DEPRECATED("use \"operators\" instead")
 
virtual StatePtr currentState () const
 Get a pointer to the state object. More...
 
virtual SValuePtr protoval () const
 Return the prototypical value. More...
 
virtual SgAsmInstructioncurrentInstruction () const
 Returns the instruction that is being processed. More...
 
virtual SValuePtr number_ (size_t nbits, uint64_t number) const
 Return a semantic value representing a number. More...
 
virtual const RegisterDictionaryget_register_dictionary () const
 
virtual RegisterDescriptor findRegister (const std::string &regname, size_t nbits=0, bool allowMissing=false) const
 Lookup a register by name. More...
 
virtual void initializeState (const StatePtr &)
 Initialize the state. More...
 
virtual void advanceInstructionPointer (SgAsmInstruction *)
 Update the instruction pointer register. More...
 
virtual RegisterDescriptor segmentRegister (SgAsmMemoryReferenceExpression *)
 Returns a register descriptor for the segment part of a memory reference expression. More...
 
virtual void incrementRegisters (SgAsmExpression *)
 Increment all auto-increment registers in the expression. More...
 
virtual void decrementRegisters (SgAsmExpression *)
 Decrement all auto-decrement registers in the expression. More...
 
virtual void preUpdate (SgAsmExpression *, const BaseSemantics::SValuePtr &enabled)
 Update registers for pre-add expressions. More...
 
virtual void postUpdate (SgAsmExpression *, const BaseSemantics::SValuePtr &enabled)
 Update registers for post-add expressions. More...
 
virtual SValuePtr effectiveAddress (SgAsmExpression *, size_t nbits=0)
 Returns a memory address by evaluating the address expression. More...
 
virtual SValuePtr read (SgAsmExpression *, size_t value_nbits=0, size_t addr_nbits=0)
 Reads an R-value expression. More...
 
virtual void write (SgAsmExpression *, const SValuePtr &value, size_t addr_nbits=0)
 Writes to an L-value expression. More...
 
virtual RiscOperatorsPtr operators () const
 Property: RISC operators. More...
 
virtual void operators (const RiscOperatorsPtr &ops)
 Property: RISC operators. More...
 
virtual SValuePtr undefined_ (size_t nbits) const
 Return a new undefined semantic value.
 
virtual SValuePtr unspecified_ (size_t nbits) const
 Return a new undefined semantic value.
 
const RegisterDictionaryregisterDictionary () const
 Property: Register dictionary. More...
 
void registerDictionary (const RegisterDictionary *rd)
 Property: Register dictionary. More...
 
size_t addressWidth () const
 Property: Width of memory addresses. More...
 
void addressWidth (size_t nbits)
 Property: Width of memory addresses. More...
 
bool autoResetInstructionPointer () const
 Property: Reset instruction pointer register for each instruction. More...
 
void autoResetInstructionPointer (bool b)
 Property: Reset instruction pointer register for each instruction. More...
 

Static Public Member Functions

static DispatcherPowerpcPtr instance ()
 Construct a prototypical dispatcher. More...
 
static DispatcherPowerpcPtr instance (size_t addrWidth, const RegisterDictionary *regs=NULL)
 Constructor. More...
 
static DispatcherPowerpcPtr instance (const BaseSemantics::RiscOperatorsPtr &ops, size_t addrWidth, const RegisterDictionary *regs=NULL)
 Constructor. More...
 
static DispatcherPowerpcPtr promote (const BaseSemantics::DispatcherPtr &d)
 Dynamic cast to a DispatcherPowerpcPtr with assertion. More...
 

Public Attributes

RegisterDescriptor REG_IAR
 Cached register. More...
 
RegisterDescriptor REG_LR
 Cached register. More...
 
RegisterDescriptor REG_XER
 Cached register. More...
 
RegisterDescriptor REG_XER_CA
 Cached register. More...
 
RegisterDescriptor REG_XER_OV
 Cached register. More...
 
RegisterDescriptor REG_XER_SO
 Cached register. More...
 
RegisterDescriptor REG_CTR
 Cached register. More...
 
RegisterDescriptor REG_CR
 Cached register. More...
 
RegisterDescriptor REG_CR0
 Cached register. More...
 
RegisterDescriptor REG_CR0_LT
 Cached register. More...
 

Protected Member Functions

 DispatcherPowerpc (size_t addrWidth, const RegisterDictionary *regs)
 
 DispatcherPowerpc (const BaseSemantics::RiscOperatorsPtr &ops, size_t addrWidth, const RegisterDictionary *regs)
 
void iproc_init ()
 Loads the iproc table with instruction processing functors. More...
 
void regcache_init ()
 Load the cached register descriptors. More...
 
void memory_init ()
 Make sure memory is set up correctly. More...
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher
 Dispatcher (size_t addrWidth, const RegisterDictionary *regs)
 
 Dispatcher (const RiscOperatorsPtr &ops, size_t addrWidth, const RegisterDictionary *regs)
 

Additional Inherited Members

- Protected Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher
typedef std::vector< InsnProcessor * > InsnProcessors
 
- Protected Attributes inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher
const RegisterDictionaryregdict
 See registerDictionary property. More...
 
size_t addrWidth_
 Width of memory addresses in bits. More...
 
bool autoResetInstructionPointer_
 Reset instruction pointer register for each instruction. More...
 
InsnProcessors iproc_table
 

Member Typedef Documentation

Base type.

Definition at line 30 of file DispatcherPowerpc.h.

Shared-ownership pointer.

Definition at line 33 of file DispatcherPowerpc.h.

Member Function Documentation

void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::iproc_init ( )
protected

Loads the iproc table with instruction processing functors.

This normally happens from the constructor.

void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::regcache_init ( )
protected

Load the cached register descriptors.

This happens at construction and when the registerDictionary is changed.

void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::memory_init ( )
protected

Make sure memory is set up correctly.

For instance, byte order should be little endian.

static DispatcherPowerpcPtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::instance ( )
inlinestatic

Construct a prototypical dispatcher.

The only thing this dispatcher can be used for is to create another dispatcher with the virtual create method.

Definition at line 96 of file DispatcherPowerpc.h.

Referenced by create().

static DispatcherPowerpcPtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::instance ( size_t  addrWidth,
const RegisterDictionary regs = NULL 
)
inlinestatic

Constructor.

Definition at line 101 of file DispatcherPowerpc.h.

static DispatcherPowerpcPtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::instance ( const BaseSemantics::RiscOperatorsPtr ops,
size_t  addrWidth,
const RegisterDictionary regs = NULL 
)
inlinestatic

Constructor.

Definition at line 106 of file DispatcherPowerpc.h.

virtual BaseSemantics::DispatcherPtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::create ( const BaseSemantics::RiscOperatorsPtr ops,
size_t  addrWidth = 0,
const RegisterDictionary regs = NULL 
) const
inlineoverridevirtual
static DispatcherPowerpcPtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::promote ( const BaseSemantics::DispatcherPtr d)
inlinestatic

Dynamic cast to a DispatcherPowerpcPtr with assertion.

Definition at line 122 of file DispatcherPowerpc.h.

virtual RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::instructionPointerRegister ( ) const
overridevirtual

Returns the instruction pointer register.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher.

virtual RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::stackPointerRegister ( ) const
overridevirtual

Returns the stack pointer register.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher.

virtual RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::stackFrameRegister ( ) const
overridevirtual

Returns the stack call frame register.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher.

virtual RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::callReturnRegister ( ) const
overridevirtual

Returns the function call return address register.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher.

virtual int Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::iprocKey ( SgAsmInstruction ) const
inlineoverridevirtual

Given an instruction, return the InsnProcessor key that can be used as an index into the iproc_table.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::Dispatcher.

Definition at line 135 of file DispatcherPowerpc.h.

References SgAsmPowerpcInstruction::get_kind().

void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::setXerOverflow ( const BaseSemantics::SValuePtr hadOverflow)

Set the XER OV and SO bits as specified.

The XER OV bit is assigned the argument, and the XER SO bit is set only if the argument is set. This function should be called before updateCr0 since updateCr0 will copy some of the XER into the CR result.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::updateCr0 ( const BaseSemantics::SValuePtr result)
virtual

Write status flags for result.

BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::readAndUpdate ( BaseSemantics::RiscOperators ,
SgAsmExpression ,
size_t  valueNBits 
)

Reads from a memory address and updates a register with the effective address that was read.

The address expression must be a binary add operation whose first argument is a register, and it is this register that gets updated.

void Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::writeAndUpdate ( BaseSemantics::RiscOperators ,
SgAsmExpression destination,
const BaseSemantics::SValuePtr value 
)

Writes a value to a memory address and updates a register with the effective address to which the value was written.

The address expression must be a binary add operation whose first argument is a register, and it is this register that gets updated.

Member Data Documentation

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_IAR

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_LR

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_XER

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_XER_CA

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_XER_OV

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_XER_SO

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_CTR

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 41 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_CR

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 42 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_CR0

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 42 of file DispatcherPowerpc.h.

RegisterDescriptor Rose::BinaryAnalysis::InstructionSemantics2::DispatcherPowerpc::REG_CR0_LT

Cached register.

This register is cached so that there are not so many calls to Dispatcher::findRegister(). The register descriptor is updated only when the registerDictionary property is changed.

Definition at line 42 of file DispatcherPowerpc.h.


The documentation for this class was generated from the following file: