|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.proc.live.Instruction
public class Instruction
An architecture independent way of representing an assembly level instruction which is used for stepping and breakpoint insertion. Possibly knows about displaced instruction execution and/or emultation. Constructed by archtecture Isas given a memory buffer and address of the instruction. Instruction objects are immutable.
Isa.getInstruction(Buffer, long)
Field Summary | |
---|---|
private boolean |
executeOutOfLine
|
private byte[] |
instr
|
private String |
name
|
private boolean |
simulate
|
Constructor Summary | |
---|---|
Instruction(byte[] instr)
|
|
Instruction(byte[] instr,
boolean executeOutOfLine)
|
|
Instruction(byte[] instr,
boolean executeOutOfLine,
boolean simulate)
|
|
Instruction(String name,
byte[] instr)
|
|
Instruction(String name,
byte[] instr,
boolean executeOutOfLine)
|
|
Instruction(String name,
byte[] instr,
boolean executeOutOfLine,
boolean simulate)
Package private constructor called by the Isa ito create an inmutable Instruction. |
Method Summary | |
---|---|
boolean |
canExecuteOutOfLine()
Whether or not this instruction can be executed out of line. |
boolean |
canSimulate()
Whether or not this instruction can be emulated. |
void |
fixupExecuteOutOfLine(Task task,
long pc,
long address)
After the instruction has been executed out of line fixes up the given Task as if the instruction was actually executed at the given pc instead of the given address. |
byte[] |
getBytes()
Returns the raw instruction bytes. |
String |
getName()
Returns a human readable string representation of the instruction. |
void |
setupExecuteOutOfLine(Task task,
long pc,
long address)
Prepares the given Task for executing this instruction at the given address. |
void |
simulate(Task task)
The default implementation just does a sanity check and throws an exception if simulation was requested on a instruction that cannot be emulated. |
String |
toString()
A human readable representation of the Instruction including the class name, the opcode name and the instruction bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final String name
private final byte[] instr
private final boolean executeOutOfLine
private final boolean simulate
Constructor Detail |
---|
Instruction(String name, byte[] instr, boolean executeOutOfLine, boolean simulate)
Instruction(byte[] instr)
Instruction(String name, byte[] instr)
Instruction(byte[] instr, boolean executeOutOfLine)
Instruction(byte[] instr, boolean executeOutOfLine, boolean simulate)
Instruction(String name, byte[] instr, boolean executeOutOfLine)
Method Detail |
---|
public String getName()
public byte[] getBytes()
public boolean canExecuteOutOfLine()
public void setupExecuteOutOfLine(Task task, long pc, long address)
The default implementation puts the bytes of the instruction at address and sets the pc of the Task to that address. Override when the instruction needs anything more.
public void fixupExecuteOutOfLine(Task task, long pc, long address)
The default implementation just sets the pc at the given pc plus the length of this instruction. Override when the instruction needs to do anything else.
public boolean canSimulate()
public void simulate(Task task)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |