com.pnfsoftware.jeb.core.units.code.IDFA<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
![]() |
Data flow analysis objects for control flow graphs.
DFA objects can be configured and performed using CFG.doDataFlowAnalysis()
methods.
Current implementations:
- DFA1
: legacy object, computes everything ahead-of-time
- DFA2
: lean analyzer, provides on-demand computations
Implementations must limit DFA to graphs whose entry-point basic block is the lowest-address block, i.e., block at index 0.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | STANDARD_CLEAN_COPIES | ||||||||||
int | STANDARD_COLLECTION_FLAGS | ||||||||||
boolean | STANDARD_INTEGRATE_INPUTS |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean | checkNoUse(long addr, int varid) | ||||||||||
abstract boolean | checkSingleDef(long addr, int varid, long expectedDefAddress) | ||||||||||
abstract Long | checkSingleDef(long addr, int varid) | ||||||||||
abstract Long | checkSingleSource(long addr, int varid) | ||||||||||
abstract boolean | checkSingleSource(long addr, int varid, long expectedSourceAddress) | ||||||||||
abstract Long | checkSingleUse(long addr, int varid) | ||||||||||
abstract boolean | checkSingleUse(long addr, int varid, long expectedUseAddress) | ||||||||||
abstract CFG<InsnType> |
getCfg()
Retrieve a reference to the CFG object that will be accessed and modified when performing an
analysis.
| ||||||||||
abstract Map<Integer, Collection<Long>> | getDefUseChains(long addr) | ||||||||||
abstract Collection<Long> | getDefUses(long addr, int varid, int stopCount) | ||||||||||
abstract Collection<Long> | getDefUses(long addr, int varid) | ||||||||||
abstract Collection<Long> | getInputMap(int varid) | ||||||||||
abstract Map<Integer, Collection<Long>> | getInputMap() | ||||||||||
abstract Collection<Integer> | getInputs() | ||||||||||
abstract Collection<Integer> | getInstructionAllDefs(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionAllUses(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionDefs(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionPotentialDefs(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionPotentialUses(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionSpoiledDefs(long addr) | ||||||||||
abstract Collection<Integer> | getInstructionUses(long addr) | ||||||||||
abstract Map<Integer, Collection<Long>> | getLiveChains(BasicBlock<InsnType> b, int idx) | ||||||||||
abstract Collection<Long> | getLiveChains(BasicBlock<InsnType> b, int idx, int varid) | ||||||||||
abstract Map<Integer, Collection<Long>> | getOutputMap() | ||||||||||
abstract Map<Integer, Collection<Long>> | getOutputMap(BasicBlock<InsnType> blk) | ||||||||||
abstract Collection<Long> | getOutputMap(BasicBlock<InsnType> blk, int varid) | ||||||||||
abstract Collection<Long> | getOutputMap(int varid) | ||||||||||
abstract Collection<Integer> | getOutputs(BasicBlock<InsnType> blk) | ||||||||||
abstract Collection<Integer> | getOutputs() | ||||||||||
abstract Map<Integer, Collection<Long>> | getReachChains(BasicBlock<InsnType> b, int idx) | ||||||||||
abstract Collection<Long> | getReachChains(BasicBlock<InsnType> b, int idx, int varid) | ||||||||||
abstract Map<Integer, Collection<Long>> | getUseDefChains(long addr) | ||||||||||
abstract Collection<Long> | getUseDefs(long addr, int varid, int stopCount) | ||||||||||
abstract Collection<Long> | getUseDefs(long addr, int varid) | ||||||||||
abstract Collection<Integer> |
getUseDiscrepancies(long addr)
Retrieve the list of use-discrepancies at the provided instruction address.
| ||||||||||
abstract int |
getVariableCollectionFlags()
Retrieve the variable collection flags.
| ||||||||||
abstract IVariableInformationProvider | getVariableInformationProvider() | ||||||||||
abstract void |
invalidate()
Invalidate the analysis.
| ||||||||||
abstract boolean | isCleanCopies() | ||||||||||
abstract boolean |
isConservative()
Convenience method used to determine whether the variable collection flags are
CONSERVATIVE . | ||||||||||
abstract boolean | isIntegrateCalculatedInputRegisters() | ||||||||||
abstract boolean |
isNotRedefined(int varid, long addr0, long addr1)
Determine if a variable reaching a start instruction has not been redefined when it reaches a
final instruction.
| ||||||||||
abstract boolean |
isNotRedefined(int varid, BasicBlock<InsnType> b0, int i0, BasicBlock<InsnType> b1, int i1)
Determine if a variable reaching a start instruction has not been redefined when it reaches a
final instruction.
| ||||||||||
abstract boolean | isUseDiscrepancy(long addr, int varid) | ||||||||||
abstract boolean |
isValid()
Determine whether the current analysis was performed and is valid.
| ||||||||||
abstract Boolean |
isVarReachingFromTo(int varid, BasicBlock<InsnType> b0, int i0, BasicBlock<InsnType> b1, int i1)
Determine if a variable used by the start instruction reaches the final instruction with the
same value.
| ||||||||||
abstract Boolean |
isVarReachingFromTo(int varid, long addr0, long addr1)
Determine if a variable used by the start instruction reaches the final instruction with the
same value.
| ||||||||||
abstract void | notifyInstructionUpdate(long addr) | ||||||||||
abstract void |
perform()
Perform data flow analysis on the CFG.
| ||||||||||
abstract void | setCleanCopies(boolean cleanCopies) | ||||||||||
abstract void |
setConservative()
Convenience method used to set or remove
CONSERVATIVE variable collection
flags. | ||||||||||
abstract void | setIntegrateCalculatedInputRegisters(boolean integrateCalculatedInputRegisters) | ||||||||||
abstract void |
setVariableCollectionFlags(int varCollectionFlags)
Set the variable collection flags.
| ||||||||||
abstract void | setVariableInformationProvider(IVariableInformationProvider varInfoProvider) |
Retrieve a reference to the CFG object that will be accessed and modified when performing an analysis.
addr | instruction address |
---|---|
varid | a variable, which must be defined by the provided instruction |
addr | instruction address |
---|---|
varid | a variable, which must be defined by the provided instruction |
addr | instruction address |
---|---|
varid | a variable, which must be used by the provided instruction |
addr | instruction address |
---|---|
varid | a variable, which must be used by the provided instruction |
Retrieve the list of use-discrepancies at the provided instruction address.
addr | instruction address |
---|
Retrieve the variable collection flags.
DefUseInfo
Invalidate the analysis. Clients have the responsibility to invalidate an analysis if the CFG was modified in such a way that data flow should be recalculated.
Convenience method used to determine whether the variable collection flags are
CONSERVATIVE
.
Determine if a variable reaching a start instruction has not been redefined when it reaches a final instruction. (Note that this method does not verify that varid actually has definitions reaching the start or final instruction; it is up to the caller to verify that.)
varid | variable id |
---|---|
addr0 | start address, exclusive |
addr1 | final address, also exclusive |
Determine if a variable reaching a start instruction has not been redefined when it reaches a final instruction. (Note that this method does not verify that varid actually has definitions reaching the start or final instruction; it is up to the caller to verify that.)
varid | variable id |
---|---|
b0 | start block |
i0 | final block |
b1 | index of the start instruction in the start block, exclusive |
i1 | index of the final instruction in the final block, also exclusive |
Determine whether the current analysis was performed and is valid.
Determine if a variable used by the start instruction reaches the final instruction with the same value.
varid | variable id |
---|---|
b0 | start block |
i0 | final block |
b1 | index of the start instruction in the start block, exclusive |
i1 | index of the final instruction in the final block, also exclusive |
Determine if a variable used by the start instruction reaches the final instruction with the same value.
varid | variable id |
---|---|
addr0 | start address, exclusive |
addr1 | final address, also exclusive |
Perform data flow analysis on the CFG. Upon return, basic blocks will have their data chains (ud and du, full and simple) set up and accessible.
Convenience method used to set or remove CONSERVATIVE
variable collection
flags.
Set the variable collection flags.
varCollectionFlags | flags, see DefUseInfo
|
---|