Class PairedPcodeExecutorStatePiece<A,L,R>

java.lang.Object
ghidra.pcode.exec.PairedPcodeExecutorStatePiece<A,L,R>
Type Parameters:
A - the type of offset, usually the type of a controlling state
L - the type of the "left" state
R - the type of the "right" state
All Implemented Interfaces:
PcodeExecutorStatePiece<A,org.apache.commons.lang3.tuple.Pair<L,R>>

public class PairedPcodeExecutorStatePiece<A,L,R> extends Object implements PcodeExecutorStatePiece<A,org.apache.commons.lang3.tuple.Pair<L,R>>
A paired executor state piece

This composes two delegate pieces "left" and "right" creating a single piece which stores pairs of values, where the left component has the value type of the left piece, and the right component has the value type of the right piece. Both pieces must have the same address type. Every operation on this piece is decomposed into operations upon the delegate pieces, and the final result composed from the results of those operations.

To compose three or more states, first ask if it is really necessary. Second, consider implementing the PcodeExecutorStatePiece interface for a record type. Third, use the Church-style triple. In that third case, it is recommended to compose the nested pair on the right of the top pair: Compose the two right pieces into a single piece, then use PairedPcodeExecutorState to compose a concrete state with the composed piece, yielding a state of triples. This can be applied ad nauseam to compose arbitrarily large tuples; however, at a certain point clients should consider creating a record and implementing the state piece and/or state interface. It's helpful to use this implementation as a reference. Alternatively, the Debugger module has a WatchValuePcodeExecutorState which follows this recommendation.

See Also: