decompiler  1.0.0
Public Member Functions | List of all members
TypeOpCallother Class Reference

Information about the CALLOTHER op-code (user defined p-code operations) More...

#include <typeop.hh>

Inheritance diagram for TypeOpCallother:
TypeOp

Public Member Functions

 TypeOpCallother (TypeFactory *t)
 Constructor.
 
virtual void push (PrintLanguage *lng, const PcodeOp *op, const PcodeOp *readOp) const
 Push the specific PcodeOp to the emitter's RPN stack. More...
 
virtual void printRaw (ostream &s, const PcodeOp *op)
 Print (for debugging purposes) this specific PcodeOp to the stream. More...
 
virtual string getOperatorName (const PcodeOp *op) const
 Get the name of the op-code as it should be displayed in context. More...
 
virtual DatatypegetInputLocal (const PcodeOp *op, int4 slot) const
 Find the minimal (or suggested) data-type of an input to this op-code. More...
 
virtual DatatypegetOutputLocal (const PcodeOp *op) const
 Find the minimal (or suggested) data-type of an output to this op-code. More...
 
- Public Member Functions inherited from TypeOp
 TypeOp (TypeFactory *t, OpCode opc, const string &n)
 Constructor. More...
 
virtual ~TypeOp (void)
 Destructor.
 
const string & getName (void) const
 Get the display name of the op-code.
 
OpCode getOpcode (void) const
 Get the op-code value.
 
uint4 getFlags (void) const
 Get the properties associated with the op-code.
 
OpBehaviorgetBehavior (void) const
 Get the behavior associated with the op-code.
 
bool markExplicitUnsigned (PcodeOp *op, int4 slot) const
 Check if a constant input should be explicitly labeled as unsigned. More...
 
uintb evaluateUnary (int4 sizeout, int4 sizein, uintb in1) const
 Emulate the unary op-code on an input value. More...
 
uintb evaluateBinary (int4 sizeout, int4 sizein, uintb in1, uintb in2) const
 Emulate the binary op-code on an input value. More...
 
uintb recoverInputBinary (int4 slot, int4 sizeout, uintb out, int4 sizein, uintb in) const
 Reverse the binary op-code operation, recovering a constant input value. More...
 
uintb recoverInputUnary (int4 sizeout, uintb out, int4 sizein) const
 Reverse the unary op-code operation, recovering a constant input value. More...
 
bool isCommutative (void) const
 Return true if this op-code is commutative. More...
 
bool inheritsSign (void) const
 Return true if the op-code inherits it signedness from its inputs.
 
virtual DatatypegetOutputToken (const PcodeOp *op, CastStrategy *castStrategy) const
 Find the data-type of the output that would be assigned by a compiler. More...
 
virtual DatatypegetInputCast (const PcodeOp *op, int4 slot, const CastStrategy *castStrategy) const
 Find the data-type of the input to a specific PcodeOp. More...
 

Additional Inherited Members

- Public Types inherited from TypeOp
enum  { inherits_sign = 1, inherits_sign_zero = 2 }
 
- Static Public Member Functions inherited from TypeOp
static void registerInstructions (vector< TypeOp * > &inst, TypeFactory *tlst, const Translate *trans)
 Build a map from op-code value to the TypeOp information objects. More...
 
static void selectJavaOperators (vector< TypeOp * > &inst, bool val)
 Toggle Java specific aspects of the op-code information. More...
 
- Protected Member Functions inherited from TypeOp
virtual void setMetatypeIn (type_metatype val)
 Set the data-type associated with inputs to this opcode.
 
virtual void setMetatypeOut (type_metatype val)
 Set the data-type associated with outputs of this opcode.
 
virtual void setSymbol (const string &nm)
 Set the display symbol associated with the op-code.
 
- Protected Attributes inherited from TypeOp
TypeFactorytlst
 Pointer to data-type factory.
 
OpCode opcode
 The op-code value.
 
uint4 opflags
 Cached pcode-op properties for this op-code.
 
uint4 addlflags
 Additional properties.
 
string name
 Symbol denoting this operation.
 
OpBehaviorbehave
 Object for emulating the behavior of the op-code.
 

Detailed Description

Information about the CALLOTHER op-code (user defined p-code operations)

Member Function Documentation

Datatype * TypeOpCallother::getInputLocal ( const PcodeOp op,
int4  slot 
) const
virtual

Find the minimal (or suggested) data-type of an input to this op-code.

The result should depend only on the op-code itself (and the size of the input)

Parameters
opis the PcodeOp being considered
slotis the input being considered
Returns
the data-type

Reimplemented from TypeOp.

References PcodeOp::doesSpecialPropagation(), PcodeOp::getAddr(), Varnode::getAddr(), TypeFactory::getArch(), Database::getGlobalScope(), PcodeOp::getIn(), UserPcodeOp::getIndex(), TypeOp::getInputLocal(), Varnode::getOffset(), Varnode::getSize(), SymbolEntry::getSizedType(), UserOpManage::getVolatileWrite(), Scope::queryProperties(), Architecture::symboltab, TypeOp::tlst, and Architecture::userops.

string TypeOpCallother::getOperatorName ( const PcodeOp op) const
virtual

Get the name of the op-code as it should be displayed in context.

Depending on the context, the same op-code may get displayed in different ways.

Parameters
opis the PcodeOp context
Returns
the display token

Reimplemented from TypeOp.

References Funcdata::getArch(), BlockBasic::getFuncdata(), PcodeOp::getIn(), Varnode::getOffset(), UserOpManage::getOp(), UserPcodeOp::getOperatorName(), TypeOp::getOperatorName(), PcodeOp::getParent(), Varnode::printRaw(), and Architecture::userops.

Referenced by printRaw().

Datatype * TypeOpCallother::getOutputLocal ( const PcodeOp op) const
virtual

Find the minimal (or suggested) data-type of an output to this op-code.

The result should depend only on the op-code itself (and the size of the output)

Parameters
opis the PcodeOp being considered
Returns
the data-type

Reimplemented from TypeOp.

References PcodeOp::doesSpecialPropagation(), PcodeOp::getAddr(), Varnode::getAddr(), TypeFactory::getArch(), Database::getGlobalScope(), PcodeOp::getIn(), UserPcodeOp::getIndex(), Varnode::getOffset(), PcodeOp::getOut(), TypeOp::getOutputLocal(), Varnode::getSize(), SymbolEntry::getSizedType(), UserOpManage::getVolatileRead(), Scope::queryProperties(), Architecture::symboltab, TypeOp::tlst, and Architecture::userops.

void TypeOpCallother::printRaw ( ostream &  s,
const PcodeOp op 
)
virtual

Print (for debugging purposes) this specific PcodeOp to the stream.

Parameters
sis the output stream
opis the specific PcodeOp to print

Implements TypeOp.

References PcodeOp::getIn(), getOperatorName(), PcodeOp::getOut(), PcodeOp::numInput(), and Varnode::printRaw().

virtual void TypeOpCallother::push ( PrintLanguage lng,
const PcodeOp op,
const PcodeOp readOp 
) const
inlinevirtual

Push the specific PcodeOp to the emitter's RPN stack.

Given a specific language and PcodeOp, emit the expression rooted at the operation.

Parameters
lngis the PrintLanguage to emit
opis the specific PcodeOp

Implements TypeOp.

References TypeOp::getInputLocal(), TypeOp::getOperatorName(), TypeOp::getOutputLocal(), PrintLanguage::opCallother(), and TypeOp::printRaw().


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