public class TrapUnitGraph extends UnitGraph
Represents a CFG for a Body instance where the nodes are Unit instances, and where, in additional to
unexceptional control flow edges, edges are added from every trapped Unit to the Trap's handler
Unit, regardless of whether the trapped Units may actually throw the exception caught by the
Trap.
There are three distinctions between the exceptional edges added in TrapUnitGraph and the exceptional edges
added in ExceptionalUnitGraph:
ExceptionalUnitGraph, the edges to Traps are associated with Units which may
actually throw an exception which the Trap catches (according to the
ThrowAnalysis used in the construction of the graph). In
TrapUnitGraph, there are edges from every trapped Unit to the Trap, regardless of
whether it can throw an exception caught by the Trap.ExceptionalUnitGraph, when a Unit may throw an exception that is caught by a
Trap there are edges from every predecessor of the excepting Unit to the Trap's
handler. In TrapUnitGraph, edges are not added from the predecessors of excepting Units.ExceptionalUnitGraph, when a Unit may throw an exception that is caught by a
Trap, there may be no edge from the excepting Unit itself to the Trap (depending on
the possibility of side effects and the setting of the omitExceptingUnitEdges parameter). In
TrapUnitGraph, there is always an edge from the excepting Unit to the Trap.body, heads, method, tails, unitChain, unitToPreds, unitToSuccs| Constructor and Description |
|---|
TrapUnitGraph(Body body)
Constructs the graph from a given Body instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildExceptionalEdges(Map<Unit,List<Unit>> unitToSuccs,
Map<Unit,List<Unit>> unitToPreds)
Method to compute the edges corresponding to exceptional control flow.
|
addEdge, buildHeadsAndTails, buildUnexceptionalEdges, combineMapValues, getBody, getExtendedBasicBlockPathBetween, getHeads, getPredsOf, getSuccsOf, getTails, iterator, size, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic TrapUnitGraph(Body body)
the - Body instance from which the graph is built.protected void buildExceptionalEdges(Map<Unit,List<Unit>> unitToSuccs, Map<Unit,List<Unit>> unitToPreds)
unitToSuccs - A Map from Units to Lists of Units. This is an “out
parameter”; buildExceptionalEdges will add a mapping for every Unit within the
scope of one or more Traps to a List of the handler units of those Traps.unitToPreds - A Map from Units to Lists of Units. This is an “out
parameter”; buildExceptionalEdges will add a mapping for every Trap handler to
all the Units within the scope of that Trap.Copyright © 2020 Soot OSS. All rights reserved.