Class JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace
- Enclosing class:
JitBytesPcodeExecutorStatePiece
AddressSpace-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionJitBytesPcodeExecutorStateSpace(Language language, AddressSpace space, AbstractBytesPcodeExecutorStatePiece<?> piece) Construct a state space -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getDirect(long offset) Pre-fetch the byte array for the block (page) containing the given offsetbyte[]read(long offset, int size) Read a variable from this (pre-fetched) state spacevoidwrite(long offset, byte[] val, int srcOffset, int length) Write a variable to this (pre-fetched) state spaceMethods inherited from class ghidra.pcode.exec.BytesPcodeExecutorStateSpace
addInPlace, addrRng, addrSet, clear, computeUninitialized, fork, getRegisterValues, getRegs, read, readBytes, readUninitializedFromBacking, spanRng, spanSet, warnAddressSet, warnUninit, write
-
Constructor Details
-
JitBytesPcodeExecutorStateSpace
public JitBytesPcodeExecutorStateSpace(Language language, AddressSpace space, AbstractBytesPcodeExecutorStatePiece<?> piece) Construct a state space- Parameters:
language- the emulation target languagespace- the address spacepiece- the owning piece
-
-
Method Details
-
getDirect
public byte[] getDirect(long offset) Pre-fetch the byte array for the block (page) containing the given offsetA translated passage is likely to call this several times in its constructor to pre-fetch the byte arrays for variables (ram, register, and unique) that it accesses directly, i.e., with a fixed offset. The generated code will then access the byte array directly to read and write the variable values in the emulator's state.
- Parameters:
offset- theoffsetwithin this address space.- Returns:
- the byte array for the containing block
-
read
public byte[] read(long offset, int size) Read a variable from this (pre-fetched) state spaceA translated passage is likely to call
JitBytesPcodeExecutorStatePiece.getForSpace(AddressSpace, boolean)once or twice in its constructor to pre-fetch the per-space backing of any indirect memory variables that it accesses, i.e., variables with a dynamic offset. These are usually required forPcodeOp.LOADandPcodeOp.STOREops. The generated code will then invoke this method (andwrite) passing in the offset to access variables in the emulator's state at runtime.- Parameters:
offset- the offset (known at runtime)size- the size of the variable- Returns:
- the value of the variable as a byte array
-
write
public void write(long offset, byte[] val, int srcOffset, int length) Write a variable to this (pre-fetched) state space- Parameters:
offset- the offsetval- the valuesrcOffset- offset within val to startlength- the number of bytes to write- See Also:
-