Class TraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T,P>

java.lang.Object
ghidra.pcode.exec.trace.TraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T,P>
Type Parameters:
A - the address domain
T - the value domain
P - the type of values in the property map, often String
All Implemented Interfaces:
TraceEmulationIntegration.PieceHandler<A,T>
Direct Known Subclasses:
TaintPieceHandler, TraceEmulationIntegration.AbstractSimplePropertyBasedPieceHandler
Enclosing class:
TraceEmulationIntegration

public abstract static class TraceEmulationIntegration.AbstractPropertyBasedPieceHandler<A,T,P> extends Object implements TraceEmulationIntegration.PieceHandler<A,T>
An abstract implementation of TraceEmulationIntegration.PieceHandler that seeks to simplify integration of abstract domains where the state is serialized into a trace's property map.

Generally, such abstract domains should follow a byte-wise access pattern. That is, it should be capable of reading and writing to overlapping variables. This implementation is aimed at that pattern. The state piece will need to implement at least PcodeExecutorStatePiece.getNextEntryInternal(AddressSpace, long). Each state entry should be serialized as an entry at the same address and size in the property map. Uninitialized reads should search the full range for any applicable entries. Entries may need to be subpieced, depending on what part of the state is already initialized.

If the address domain is also abstract, the recommended pattern is to attempt to concretize it (see PcodeArithmetic.toAddress(Object, AddressSpace, Purpose)) and delegate to the concrete callback. Failing that, you must choose some other means of storing the state. Our current recommendation is to use Address.NO_ADDRESS in a string map, where you can serialize any number of (address, value) pairs. This will not work for thread-local states, but it is unlikely you should encounter non-concretizable addresses in a thread-local state.