Package ghidra.pcode.exec
Class BytesPcodeExecutorStateSpace<B>
java.lang.Object
ghidra.pcode.exec.BytesPcodeExecutorStateSpace<B>
- Type Parameters:
B- if this space is a cache, the type of object backing this space
- Direct Known Subclasses:
JitBytesPcodeExecutorStatePiece.JitBytesPcodeExecutorStateSpace
A p-code executor state space for storing and retrieving bytes as arrays
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Bprotected final SemisparseByteArrayprotected static final byte[]protected final Languageprotected final AddressSpace -
Constructor Summary
ConstructorsModifierConstructorDescriptionBytesPcodeExecutorStateSpace(Language language, AddressSpace space, B backing) Construct an internal space for the given address spaceprotectedBytesPcodeExecutorStateSpace(Language language, AddressSpace space, B backing, SemisparseByteArray bytes) -
Method Summary
Modifier and TypeMethodDescriptionprotected AddressRangeprotected AddressSetvoidclear()protected ULongSpan.ULongSpanSetcomputeUninitialized(long offset, int size) Compute the uninitialized span set, considering possible wrap-aroundfork()getRegisterValues(List<Register> registers) getRegs(AddressSetView set) byte[]read(long offset, int size, PcodeExecutorStatePiece.Reason reason) Read a value from the space at the given offsetprotected byte[]readBytes(long offset, int size, PcodeExecutorStatePiece.Reason reason) Read a value from cache (or raw space if not acting as a cache) at the given offsetprotected ULongSpan.ULongSpanSetreadUninitializedFromBacking(ULongSpan.ULongSpanSet uninitialized) Extension point: Read from backing into this space, when acting as a cache.protected ULongSpanspanRng(AddressRange range) protected ULongSpan.ULongSpanSetspanSet(AddressSetView set) This assumes without assertion that the set is contained in this spaceprotected voidwarnAddressSet(String message, AddressSetView set) protected voidwarnUninit(ULongSpan.ULongSpanSet uninit) voidwrite(long offset, byte[] val, int srcOffset, int length) Write a value at the given offset
-
Field Details
-
EMPTY
protected static final byte[] EMPTY -
bytes
-
language
-
space
-
backing
-
-
Constructor Details
-
BytesPcodeExecutorStateSpace
Construct an internal space for the given address space- Parameters:
language- the language, for logging diagnosticsspace- the address spacebacking- the backing object, possiblynull
-
BytesPcodeExecutorStateSpace
protected BytesPcodeExecutorStateSpace(Language language, AddressSpace space, B backing, SemisparseByteArray bytes)
-
-
Method Details
-
fork
-
write
public void write(long offset, byte[] val, int srcOffset, int length) Write a value at the given offset- Parameters:
offset- the offsetval- the valuesrcOffset- offset within val to startlength- the number of bytes to write
-
readUninitializedFromBacking
Extension point: Read from backing into this space, when acting as a cache.- Parameters:
uninitialized- the ranges which need to be read.- Returns:
- the ranges which remain uninitialized
-
readBytes
Read a value from cache (or raw space if not acting as a cache) at the given offset- Parameters:
offset- the offsetsize- the number of bytes to read (the size of the value)- Returns:
- the bytes read
-
addrRng
-
spanRng
-
addrSet
-
spanSet
This assumes without assertion that the set is contained in this space- Parameters:
set- the address set- Returns:
- the unsigned long span set
-
getRegs
-
warnAddressSet
-
warnUninit
-
computeUninitialized
Compute the uninitialized span set, considering possible wrap-around- Parameters:
offset- the offsetsize- the number of bytes- Returns:
- the uninitialized offset ranges
-
read
Read a value from the space at the given offsetIf this space is not acting as a cache, this simply delegates to
readBytes(long, int, Reason). Otherwise, it will first ensure the cache covers the requested value.- Parameters:
offset- the offsetsize- the number of bytes to read (the size of the value)reason- the reason for reading state- Returns:
- the bytes read
-
getRegisterValues
-
clear
public void clear()
-