Class PairedPcodeExecutorState<L,R>
- Type Parameters:
L- the type of values for the "left" stateR- the type of values for the "right" state
- All Implemented Interfaces:
PcodeExecutorState<org.apache.commons.lang3.tuple.Pair<L,,R>> PcodeExecutorStatePiece<org.apache.commons.lang3.tuple.Pair<L,R>, org.apache.commons.lang3.tuple.Pair<L, R>>
- Direct Known Subclasses:
TaintPcodeExecutorState
This composes a delegate state and piece "left" and "write" creating a single state which instead stores pairs of values, where the left component has the value type of the left state, and the right component has the value type of the right state. Note that both states are addressed using only the left "control" component. Otherwise, every operation on this state is decomposed into operations upon the delegate states, and the final result composed from the results of those operations.
Where a response cannot be composed of both states, the paired state defers to the left. In this way, the left state controls the machine, while the right is computed in tandem. The right never directly controls the machine
See PairedPcodeExecutorStatePiece regarding the composition of three or more pieces.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
PcodeExecutorStatePiece.Reason -
Constructor Summary
ConstructorsConstructorDescriptionPairedPcodeExecutorState(PcodeExecutorState<L> left, PcodeExecutorStatePiece<L, R> right) PairedPcodeExecutorState(PcodeExecutorState<L> left, PcodeExecutorStatePiece<L, R> right, PcodeArithmetic<org.apache.commons.lang3.tuple.Pair<L, R>> arithmetic) Compose a paired state from the given left and right states -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Erase the entire state or pieceCreate a deep copy of this statePcodeArithmetic<org.apache.commons.lang3.tuple.Pair<L, R>> Get 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 piecegetLeft()Get the delegate backing the left side of paired valuesGet all register values known to this stategetRight()Get the delegate backing the right side of paired valuesgetVar(AddressSpace space, long offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Get the value of a variablegetVar(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Get the value of a variablegetVarInternal(AddressSpace space, long offset, int size, PcodeExecutorStatePiece.Reason reason) Get the value of a variable without issuing callbacksgetVarInternal(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, PcodeExecutorStatePiece.Reason reason) Get the value of a variable without issuing callbacksvoidsetVar(AddressSpace space, long offset, int size, boolean quantize, org.apache.commons.lang3.tuple.Pair<L, R> val) Set the value of a variablevoidsetVar(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, boolean quantize, org.apache.commons.lang3.tuple.Pair<L, R> val) Set the value of a variablevoidsetVarInternal(AddressSpace space, long offset, int size, org.apache.commons.lang3.tuple.Pair<L, R> val) Set the value of a variable without issuing callbacksvoidsetVarInternal(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, org.apache.commons.lang3.tuple.Pair<L, R> val) Set the value of a variable without issuing callbacksStream over the pieces within.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pcode.exec.PcodeExecutorState
getAddressArithmetic, pairedMethods inherited from interface ghidra.pcode.exec.PcodeExecutorStatePiece
checkRange, getNextEntryInternal, getNextEntryInternal, getVar, getVar, getVar, inspectBigInteger, inspectByte, inspectConcrete, inspectInt, inspectLong, inspectRegisterValue, inspectShort, quantizeOffset, setBigInteger, setByte, setConcrete, setInt, setLong, setRegisterValue, setRegisterValue, setShort, setVar, setVar, setVar
-
Constructor Details
-
PairedPcodeExecutorState
-
PairedPcodeExecutorState
public PairedPcodeExecutorState(PcodeExecutorState<L> left, PcodeExecutorStatePiece<L, R> right, PcodeArithmetic<org.apache.commons.lang3.tuple.Pair<L, R>> arithmetic) Compose a paired state from the given left and right states- Parameters:
left- the state backing the left side of paired values ("control")right- the state backing the right side of paired values ("auxiliary")arithmetic- the arithmetic for the paired values of the state
-
PairedPcodeExecutorState
-
-
Method Details
-
getLanguage
Description copied from interface:PcodeExecutorStatePieceGet the language defining the address spaces of this state piece- Specified by:
getLanguagein interfacePcodeExecutorStatePiece<L,R> - Returns:
- the language
-
getArithmetic
Description copied from interface:PcodeExecutorStatePieceGet the arithmetic used to manipulate values of the type stored by this state- Specified by:
getArithmeticin interfacePcodeExecutorStatePiece<L,R> - Returns:
- the arithmetic
-
streamPieces
Description copied from interface:PcodeExecutorStatePieceStream over the pieces within.If this piece is not a composition of others, then simply stream this piece in a singleton. Otherwise, stream the component pieces. (Do not include the composition itself, just the component pieces.)
- Specified by:
streamPiecesin interfacePcodeExecutorStatePiece<L,R> - Returns:
- the stream
-
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<L,R> - Returns:
- a map of registers and their values
-
fork
Description copied from interface:PcodeExecutorStatePieceCreate a deep copy of this state- Specified by:
forkin interfacePcodeExecutorState<L>- Specified by:
forkin interfacePcodeExecutorStatePiece<L,R> - Parameters:
cb- callbacks to receive emulation events- Returns:
- the copy
-
getConcreteBuffer
Description copied from interface:PcodeExecutorStatePieceBind a buffer of concrete bytes at the given start address- Specified by:
getConcreteBufferin interfacePcodeExecutorStatePiece<L,R> - Parameters:
address- the start addresspurpose- the reason why the emulator needs a concrete value- Returns:
- a buffer
-
getLeft
Get the delegate backing the left side of paired values- Returns:
- the left state
-
getRight
Get the delegate backing the right side of paired values- Returns:
- the right state
-
setVar
public void setVar(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, boolean quantize, org.apache.commons.lang3.tuple.Pair<L, R> val) Description copied from interface:PcodeExecutorStatePieceSet the value of a variable- Specified by:
setVarin interfacePcodeExecutorStatePiece<L,R> - 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
-
setVarInternal
public void setVarInternal(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, org.apache.commons.lang3.tuple.Pair<L, R> val) Description copied from interface:PcodeExecutorStatePieceSet the value of a variable without issuing callbacks- Specified by:
setVarInternalin interfacePcodeExecutorStatePiece<L,R> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the size of the variableval- the value
-
setVar
public void setVar(AddressSpace space, long offset, int size, boolean quantize, org.apache.commons.lang3.tuple.Pair<L, R> val) Description copied from interface:PcodeExecutorStatePieceSet the value of a variable- Specified by:
setVarin interfacePcodeExecutorStatePiece<L,R> - 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
-
setVarInternal
public void setVarInternal(AddressSpace space, long offset, int size, org.apache.commons.lang3.tuple.Pair<L, R> val) Description copied from interface:PcodeExecutorStatePieceSet the value of a variable without issuing callbacks- Specified by:
setVarInternalin interfacePcodeExecutorStatePiece<L,R> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the size of the variableval- the value
-
getVar
public org.apache.commons.lang3.tuple.Pair<L,R> getVar(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Description copied from interface:PcodeExecutorStatePieceGet the value of a variable- Specified by:
getVarin interfacePcodeExecutorStatePiece<L,R> - 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
-
getVarInternal
public org.apache.commons.lang3.tuple.Pair<L,R> getVarInternal(AddressSpace space, org.apache.commons.lang3.tuple.Pair<L, R> offset, int size, PcodeExecutorStatePiece.Reason reason) Description copied from interface:PcodeExecutorStatePieceGet the value of a variable without issuing callbacks- Specified by:
getVarInternalin interfacePcodeExecutorStatePiece<L,R> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the size of the variablereason- the reason for reading the variable- Returns:
- the value
-
getVar
public org.apache.commons.lang3.tuple.Pair<L,R> getVar(AddressSpace space, long offset, int size, boolean quantize, PcodeExecutorStatePiece.Reason reason) Description copied from interface:PcodeExecutorStatePieceGet the value of a variableThis method is typically used for reading memory variables.
- Specified by:
getVarin interfacePcodeExecutorStatePiece<L,R> - 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
-
getVarInternal
public org.apache.commons.lang3.tuple.Pair<L,R> getVarInternal(AddressSpace space, long offset, int size, PcodeExecutorStatePiece.Reason reason) Description copied from interface:PcodeExecutorStatePieceGet the value of a variable without issuing callbacks- Specified by:
getVarInternalin interfacePcodeExecutorStatePiece<L,R> - Parameters:
space- the address spaceoffset- the offset within the spacesize- the size of the variablereason- the reason for reading the variable- Returns:
- the 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<L,R>
-