Package ghidra.pcode.exec
Class LocationPcodeExecutorStatePiece
java.lang.Object
ghidra.pcode.exec.LocationPcodeExecutorStatePiece
- All Implemented Interfaces:
PcodeExecutorStatePiece<byte[],
ValueLocation>
public class LocationPcodeExecutorStatePiece
extends Object
implements PcodeExecutorStatePiece<byte[],ValueLocation>
An auxiliary state piece that reports the location of the control value
This is intended for use as the right side of a PairedPcodeExecutorState
or
PairedPcodeExecutorStatePiece
. Except for unique spaces, sets are ignored, and gets
simply echo back the location of the requested read. In unique spaces, the "location" is treated
as the value, so that values transiting unique space can correctly have their source locations
reported.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
PcodeExecutorStatePiece.Reason
-
Constructor Summary
ModifierConstructorDescriptionLocationPcodeExecutorStatePiece
(Language language) Construct a "location" state pieceprotected
LocationPcodeExecutorStatePiece
(Language language, BytesPcodeArithmetic addressArithmetic, Map<Long, ValueLocation> unique) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Erase the entire state or piecefork()
Create a deep copy of this statePcodeArithmetic
<byte[]> Get the arithmetic used to manipulate addresses of the type used by this stateGet the arithmetic used to manipulate values of the type stored by this stategetConcreteBuffer
(Address address, PcodeArithmetic.Purpose purpose) Bind a buffer of concrete bytes at the given start addressGet the language defining the address spaces of this state pieceGet all register values known to this stategetVar
(AddressSpace space, byte[] offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Get the value of a variablevoid
setVar
(AddressSpace space, byte[] offset, int size, boolean quantize, ValueLocation val) Set the value of a variableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
checkRange, getVar, getVar, getVar, getVar, quantizeOffset, setVar, setVar, setVar, setVar
-
Constructor Details
-
LocationPcodeExecutorStatePiece
Construct a "location" state piece- Parameters:
language
- the language of the machine
-
LocationPcodeExecutorStatePiece
protected LocationPcodeExecutorStatePiece(Language language, BytesPcodeArithmetic addressArithmetic, Map<Long, ValueLocation> unique)
-
-
Method Details
-
getLanguage
Description copied from interface:PcodeExecutorStatePiece
Get the language defining the address spaces of this state piece- Specified by:
getLanguage
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Returns:
- the language
-
getAddressArithmetic
Description copied from interface:PcodeExecutorStatePiece
Get the arithmetic used to manipulate addresses of the type used by this state- Specified by:
getAddressArithmetic
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Returns:
- the address (or offset) arithmetic
-
getArithmetic
Description copied from interface:PcodeExecutorStatePiece
Get the arithmetic used to manipulate values of the type stored by this state- Specified by:
getArithmetic
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Returns:
- the arithmetic
-
fork
Description copied from interface:PcodeExecutorStatePiece
Create a deep copy of this state- Specified by:
fork
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Returns:
- the copy
-
setVar
public void setVar(AddressSpace space, byte[] offset, int size, boolean quantize, ValueLocation val) Description copied from interface:PcodeExecutorStatePiece
Set the value of a variable- Specified by:
setVar
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Parameters:
space
- the address spaceoffset
- the offset within the spacesize
- the size of the variablequantize
- true to quantize to the language's "addressable unit"val
- the value
-
getVar
public ValueLocation getVar(AddressSpace space, byte[] offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Description copied from interface:PcodeExecutorStatePiece
Get the value of a variable- Specified by:
getVar
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Parameters:
space
- the address spaceoffset
- the offset within the spacesize
- the size of the variablequantize
- true to quantize to the language's "addressable unit"reason
- the reason for reading the variable- Returns:
- the value
-
getRegisterValues
Description copied from interface:PcodeExecutorStatePiece
Get all register values known to this stateWhen the state acts as a cache, it should only return those cached.
- Specified by:
getRegisterValues
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Returns:
- a map of registers and their values
-
getConcreteBuffer
Description copied from interface:PcodeExecutorStatePiece
Bind a buffer of concrete bytes at the given start address- Specified by:
getConcreteBuffer
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation> - Parameters:
address
- the start addresspurpose
- the reason why the emulator needs a concrete value- Returns:
- a buffer
-
clear
public void clear()Description copied from interface:PcodeExecutorStatePiece
Erase 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:
clear
in interfacePcodeExecutorStatePiece<byte[],
ValueLocation>
-