Package boomerang.callgraph
Class ObservableDynamicICFG
- java.lang.Object
-
- boomerang.callgraph.ObservableDynamicICFG
-
- All Implemented Interfaces:
ObservableICFG<Statement,Method>
public class ObservableDynamicICFG extends Object implements ObservableICFG<Statement,Method>
An interprocedural control-flow graph, for which caller-callee edges can be observed usingCalleeListenerandCallerListener. Used for demand-driven call graph generation.Starts with an graph only containing intraprocedual edges and uses a precomputed call graph to derive callers.
- Author:
- Melanie Bruns on 04.05.2018
-
-
Constructor Summary
Constructors Constructor Description ObservableDynamicICFG(ObservableControlFlowGraph cfg, ICallerCalleeResolutionStrategy resolutionStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCalleeListener(CalleeListener<Statement,Method> listener)Registers a listener that will be notified whenever a callee is addedvoidaddCallerListener(CallerListener<Statement,Method> listener)Registers a listener that will be notified whenever a caller is added.protected booleanaddCallIfNotInGraph(Statement caller, Method callee)Returns true if the call was added to the call graph, false if it was already present and the call graph did not changevoidaddEdges(CallGraph.Edge e)voidcomputeFallback()Collection<Statement>getEndPointsOf(Method m)intgetNumberOfEdgesTakenFromPrecomputedGraph()Collection<Statement>getStartPointsOf(Method m)booleanisCallStmt(Statement unit)Returnstrueif the given statement is a call site.booleanisExitStmt(Statement unit)Returnstrueif the given statement leads to a method return (exceptional or not).booleanisStartPoint(Statement unit)Returns true is this is a method's start statement.protected voidnotifyNoCalleeFound(Statement s)voidresetCallGraph()Resets the call graph.
-
-
-
Constructor Detail
-
ObservableDynamicICFG
public ObservableDynamicICFG(ObservableControlFlowGraph cfg, ICallerCalleeResolutionStrategy resolutionStrategy)
-
-
Method Detail
-
addCalleeListener
public void addCalleeListener(CalleeListener<Statement,Method> listener)
Description copied from interface:ObservableICFGRegisters a listener that will be notified whenever a callee is added- Specified by:
addCalleeListenerin interfaceObservableICFG<Statement,Method>
-
addCallerListener
public void addCallerListener(CallerListener<Statement,Method> listener)
Description copied from interface:ObservableICFGRegisters a listener that will be notified whenever a caller is added.- Specified by:
addCallerListenerin interfaceObservableICFG<Statement,Method>
-
addCallIfNotInGraph
protected boolean addCallIfNotInGraph(Statement caller, Method callee)
Returns true if the call was added to the call graph, false if it was already present and the call graph did not change
-
notifyNoCalleeFound
protected void notifyNoCalleeFound(Statement s)
-
isCallStmt
public boolean isCallStmt(Statement unit)
Description copied from interface:ObservableICFGReturnstrueif the given statement is a call site.- Specified by:
isCallStmtin interfaceObservableICFG<Statement,Method>
-
isExitStmt
public boolean isExitStmt(Statement unit)
Description copied from interface:ObservableICFGReturnstrueif the given statement leads to a method return (exceptional or not). For backward analyses may also be start statements.- Specified by:
isExitStmtin interfaceObservableICFG<Statement,Method>
-
isStartPoint
public boolean isStartPoint(Statement unit)
Description copied from interface:ObservableICFGReturns true is this is a method's start statement. For backward analyses those may also be return or throws statements.- Specified by:
isStartPointin interfaceObservableICFG<Statement,Method>
-
getStartPointsOf
public Collection<Statement> getStartPointsOf(Method m)
- Specified by:
getStartPointsOfin interfaceObservableICFG<Statement,Method>
-
getEndPointsOf
public Collection<Statement> getEndPointsOf(Method m)
- Specified by:
getEndPointsOfin interfaceObservableICFG<Statement,Method>
-
getNumberOfEdgesTakenFromPrecomputedGraph
public int getNumberOfEdgesTakenFromPrecomputedGraph()
- Specified by:
getNumberOfEdgesTakenFromPrecomputedGraphin interfaceObservableICFG<Statement,Method>
-
resetCallGraph
public void resetCallGraph()
Description copied from interface:ObservableICFGResets the call graph. Only affects the call graph if it was built demand-driven, otherwise graph will remain unchanged. Demand-driven call graph will keep intraprocedual information, but reset start with an empty call graph again.- Specified by:
resetCallGraphin interfaceObservableICFG<Statement,Method>
-
computeFallback
public void computeFallback()
- Specified by:
computeFallbackin interfaceObservableICFG<Statement,Method>
-
addEdges
public void addEdges(CallGraph.Edge e)
- Specified by:
addEdgesin interfaceObservableICFG<Statement,Method>
-
-