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
A p-code executor state space for storing and retrieving bytes as arrays
-
Field Summary
Modifier and TypeFieldDescriptionprotected final B
protected final SemisparseByteArray
protected static final byte[]
protected final Language
protected final AddressSpace
-
Constructor Summary
ModifierConstructorDescriptionBytesPcodeExecutorStateSpace
(Language language, AddressSpace space, B backing) Construct an internal space for the given address spaceprotected
BytesPcodeExecutorStateSpace
(Language language, AddressSpace space, B backing, SemisparseByteArray bytes) -
Method Summary
Modifier and TypeMethodDescriptionprotected AddressRange
protected AddressSet
void
clear()
fork()
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.ULongSpanSet
readUninitializedFromBacking
(ULongSpan.ULongSpanSet uninitialized) Extension point: Read from backing into this space, when acting as a cache.protected ULongSpan
spanRng
(AddressRange range) protected ULongSpan.ULongSpanSet
spanSet
(AddressSetView set) This assumes without assertion that the set is contained in this spaceprotected void
warnAddressSet
(String message, AddressSetView set) protected void
warnUninit
(ULongSpan.ULongSpanSet uninit) void
write
(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 value
-
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
-
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()
-