Class AddressesReadTracePcodeExecutorStatePiece
- All Implemented Interfaces:
PcodeExecutorStatePiece<byte[],AddressSetView>
Except for unique spaces, sets are ignored, and gets simply echo back the range of addresses of
the requested read. In unique spaces, the "addresses read" is treated as the value, so that
values transiting unique space can correct have their source address ranges reported. Use this
with AddressesReadPcodeArithmetic to compute the union of these ranges during Sleigh
expression evaluation. The ranges are translated from the guest platform, if applicable, to the
trace address. In the case of registers, the addresses are also translated to the appropriate
overlay space, if applicable.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
PcodeExecutorStatePiece.Reason -
Field Summary
FieldsFields inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece
addressArithmetic, arithmetic, cb, language, uniqueSpace -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstruct the state pieceprotectedAddressesReadTracePcodeExecutorStatePiece(PcodeTraceDataAccess data, Map<Long, AddressSetView> unique) -
Method Summary
Modifier and TypeMethodDescriptionprotected AddressSetViewcheckSize(int size, AddressSetView val) Check that the size of the value matches that givenvoidclear()Erase the entire state or pieceCreate a deep copy of this stategetConcreteBuffer(Address address, PcodeArithmetic.Purpose purpose) Bind a buffer of concrete bytes at the given start addressprotected AddressSpacegetForSpace(AddressSpace space, boolean toWrite) Get the internal space for the given address spaceprotected AddressSetViewgetFromSpace(AddressSpace space, long offset, int size, PcodeExecutorStatePiece.Reason reason, PcodeStateCallbacks cb) Get a value from the given spaceGet all register values known to this stateprotected Map<Register, AddressSetView> getRegisterValuesFromSpace(AddressSpace s, List<Register> registers) Can the given space for register values, as inAbstractLongOffsetPcodeExecutorStatePiece.getRegisterValues()protected voidsetInSpace(AddressSpace space, long offset, int size, AddressSetView val, PcodeStateCallbacks cb) Set a value in the given spaceMethods inherited from class ghidra.pcode.exec.AbstractLongOffsetPcodeExecutorStatePiece
forkMap, getAddressArithmetic, getArithmetic, getFromNullSpace, getLanguage, getUnique, getVar, getVar, getVarInternal, getVarInternal, getVarInternal, setUnique, setVar, setVar, setVarInternal, setVarInternal, setVarInternal, streamPiecesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
checkRange, getAddressArithmetic, getArithmetic, getLanguage, getNextEntryInternal, getNextEntryInternal, getVar, getVar, getVar, getVar, getVar, getVarInternal, getVarInternal, inspectBigInteger, inspectByte, inspectConcrete, inspectInt, inspectLong, inspectRegisterValue, inspectShort, quantizeOffset, setBigInteger, setByte, setConcrete, setInt, setLong, setRegisterValue, setRegisterValue, setShort, setVar, setVar, setVar, setVar, setVar, setVarInternal, setVarInternal, streamPieces
-
Field Details
-
data
-
-
Constructor Details
-
AddressesReadTracePcodeExecutorStatePiece
protected AddressesReadTracePcodeExecutorStatePiece(PcodeTraceDataAccess data, Map<Long, AddressSetView> unique) -
AddressesReadTracePcodeExecutorStatePiece
Construct the state piece- Parameters:
data- the trace data access shim
-
-
Method Details
-
checkSize
Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceCheck that the size of the value matches that givenExtensions may override this and do nothing when the abstract type has no defined size
- Overrides:
checkSizein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Parameters:
size- the size in bytesval- the value- Returns:
- the value, possibly adjusted
-
getConcreteBuffer
Description copied from interface:PcodeExecutorStatePieceBind a buffer of concrete bytes at the given start address- Specified by:
getConcreteBufferin interfacePcodeExecutorStatePiece<byte[],AddressSetView> - Parameters:
address- the start addresspurpose- the reason why the emulator needs a concrete value- Returns:
- a buffer
-
fork
Description copied from interface:PcodeExecutorStatePieceCreate a deep copy of this state- Specified by:
forkin interfacePcodeExecutorStatePiece<byte[],AddressSetView> - Parameters:
cb- callbacks to receive emulation events- Returns:
- the copy
-
getRegisterValuesFromSpace
protected Map<Register,AddressSetView> getRegisterValuesFromSpace(AddressSpace s, List<Register> registers) Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceCan the given space for register values, as inAbstractLongOffsetPcodeExecutorStatePiece.getRegisterValues()- Specified by:
getRegisterValuesFromSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Parameters:
s- the space to scanregisters- the registers known to be in the corresponding address space- Returns:
- the map of registers to values
-
getRegisterValues
Description copied from interface:PcodeExecutorStatePieceGet all register values known to this stateWhen the state acts as a cache, it should only return those cached.
- Specified by:
getRegisterValuesin interfacePcodeExecutorStatePiece<byte[],AddressSetView> - Overrides:
getRegisterValuesin classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Returns:
- a map of registers and their values
-
getForSpace
Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceGet the internal space for the given address space- Specified by:
getForSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Parameters:
space- the address spacetoWrite- in case internal spaces are generated lazily, this indicates the space must be present, because it is going to be written to.- Returns:
- the space, or
null
-
setInSpace
protected void setInSpace(AddressSpace space, long offset, int size, AddressSetView val, PcodeStateCallbacks cb) Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceSet a value in the given space- Specified by:
setInSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the number of bytes to write (the size of the value)val- the value to storecb- callbacks to receive emulation events
-
getFromSpace
protected AddressSetView getFromSpace(AddressSpace space, long offset, int size, PcodeExecutorStatePiece.Reason reason, PcodeStateCallbacks cb) Description copied from class:AbstractLongOffsetPcodeExecutorStatePieceGet a value from the given space- Specified by:
getFromSpacein classAbstractLongOffsetPcodeExecutorStatePiece<byte[],AddressSetView, AddressSpace> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the number of bytes to read (the size of the value)reason- the reason for reading statecb- callbacks to receive emulation events- Returns:
- the read value
-
clear
public void clear()Description copied from interface:PcodeExecutorStatePieceErase the entire state or pieceThis is generally only useful when the state is itself a cache to another object. This will ensure the state is reading from that object rather than a stale cache. If this is not a cache, this could in fact clear the whole state, and the machine using it will be left in the dark.
- Specified by:
clearin interfacePcodeExecutorStatePiece<byte[],AddressSetView>
-