java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.emulator.CFG |
Control-Flow Graph (CFG) representing the control-flow of an ICMethod
.
This class is a minimal implementation to be used by SimpleCEmulator
. The computed
graph only provides the reachable statements from each statement (through
getFallThroughTarget(ICStatement)
and getConditionalTarget(ICStatement, int)
).
Known limitations/simplifications:
ICCompound
), the embedded ICBlock
are kept in
the CFG and transfer control to their first statement
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CFG() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static CFG |
buildCFG(ICMethod method)
Process method's AST and build the corresponding CFG.
| ||||||||||
ICStatement |
getConditionalTarget(ICStatement from)
Get the statement reachable from the given statement, when its predicate is true.
| ||||||||||
ICStatement |
getConditionalTarget(ICStatement from, int n)
Get the statement reachable from the given statement, when its n-th predicate is true.
| ||||||||||
ICStatement |
getEntryPoint()
Get CFG entry point.
| ||||||||||
ICStatement |
getFallThroughTarget(ICStatement from)
Get the fallthrough statement reachable from the given statement.
| ||||||||||
void | setEntryPoint(ICStatement entryPoint) | ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Process method's AST and build the corresponding CFG.
Get the statement reachable from the given statement, when its predicate is true. For
multi-predicates statement, see getConditionalTarget(ICStatement, int)
.
Get the statement reachable from the given statement, when its n-th predicate is true. This method is the preferred one for multi-predicate statements (if-elseif-..), and the reachable statements are ordered as they are in their container statement.
Get the fallthrough statement reachable from the given statement.
The fallthrough statement is either the unique reachable statement for an unconditional statement, or the statement reachable when the predicate(s) are false for conditional statements.