Package ghidra.pcode.emulate
Class EmulateInstructionStateModifier
- java.lang.Object
-
- ghidra.pcode.emulate.EmulateInstructionStateModifier
-
public abstract class EmulateInstructionStateModifier extends java.lang.ObjectEmulateInstructionStateModifierdefines a language specific handler to assist emulation with adjusting the current execution state, providing support for custom pcodeop's (i.e., CALLOTHER). The implementation of this interface must provide a public constructor which takes a single Emulate argument.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEmulateInstructionStateModifier(Emulate emu)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecuteCallOther(PcodeOp op)Execute a CALLOTHER opvoidinitialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue)Emulation callback immediately before the first instruction is executed.voidpostExecuteCallback(Emulate emulate, Address lastExecuteAddress, PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress)Emulation callback immediately following execution of the lastExecuteAddress.protected voidregisterPcodeOpBehavior(java.lang.String opName, OpBehaviorOther pcodeOpBehavior)Register a pcodeop behavior corresponding to a CALLOTHER opcode.
-
-
-
Constructor Detail
-
EmulateInstructionStateModifier
protected EmulateInstructionStateModifier(Emulate emu)
-
-
Method Detail
-
registerPcodeOpBehavior
protected final void registerPcodeOpBehavior(java.lang.String opName, OpBehaviorOther pcodeOpBehavior)Register a pcodeop behavior corresponding to a CALLOTHER opcode.- Parameters:
opName- name as defined within language via "define pcodeop"pcodeOpBehavior-
-
executeCallOther
public final boolean executeCallOther(PcodeOp op) throws LowlevelError
Execute a CALLOTHER op- Parameters:
op-- Returns:
- true if corresponding pcodeop was registered and emulation support is performed, or false if corresponding pcodeop is not supported by this class.
- Throws:
LowlevelError
-
initialExecuteCallback
public void initialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) throws LowlevelError
Emulation callback immediately before the first instruction is executed. This callback permits any language specific initializations to be performed.- Parameters:
emulate-current_address- intial execute addresscontextRegisterValue- initial context value or null if not applicable or unknown- Throws:
LowlevelError
-
postExecuteCallback
public void postExecuteCallback(Emulate emulate, Address lastExecuteAddress, PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress) throws LowlevelError
Emulation callback immediately following execution of the lastExecuteAddress. One use of this callback is to modify the flowing/future context state.- Parameters:
emulate-lastExecuteAddress-lastExecutePcode-lastPcodeIndex- pcode index of last op or -1 if no pcode or fall-through occurred.currentAddress-- Throws:
LowlevelError
-
-