Class ConstructorPcodeTemplate
- java.lang.Object
-
- ghidra.app.plugin.processors.generic.ConstructorPcodeTemplate
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
UnimplementedConstructor
public class ConstructorPcodeTemplate extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConstructorPcodeTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPcodeOpTemplate(java.lang.Object opT)
int
delaySlotDepth()
int
getFlowFlags()
Handle
getPcode(java.util.ArrayList<PcodeOp> pcode, Position position, int off, java.util.ArrayList<PcodeOp> delayPcode)
Method getPcode.void
optimize()
The default pcode generated for a constructor is typically not very efficient.HandleTemplate
result()
void
trimToSize()
-
-
-
Method Detail
-
addPcodeOpTemplate
public void addPcodeOpTemplate(java.lang.Object opT) throws SledException
- Throws:
SledException
-
trimToSize
public void trimToSize()
-
optimize
public void optimize()
The default pcode generated for a constructor is typically not very efficient. For example, for an add instruction, we might generate something like tmp1 = LOAD register_space register1 tmp2 = LOAD register_space register2 tmp3 = ADD tmp1 tmp2 STORE register_space register3 tmp3 This routine marks opcodes and varnodes as potentially omitable, which allows us to generate much simpler pcode whenever there are no dynamic references involved. In the case above we would replace the 4 pcode ops above with a single pcode op: register3 = ADD register1 register2
-
getFlowFlags
public int getFlowFlags()
-
getPcode
public Handle getPcode(java.util.ArrayList<PcodeOp> pcode, Position position, int off, java.util.ArrayList<PcodeOp> delayPcode) throws java.lang.Exception
Method getPcode. Recursive pcode generation method.- Parameters:
pcode
- - current list of pcode instructions to which we will append new instructionsposition
-off
-delayPcode
- - pcode for instruction(s) in delay slot- Returns:
- HandleTemplate - handle for the result of this constructors pcode
- Throws:
java.lang.Exception
-
delaySlotDepth
public int delaySlotDepth()
-
result
public HandleTemplate result()
-
-