Package boomerang.callgraph
Class ObservableStaticICFG
- java.lang.Object
-
- boomerang.callgraph.ObservableStaticICFG
-
- All Implemented Interfaces:
ObservableICFG<Statement,Method>
public class ObservableStaticICFG extends Object implements ObservableICFG<Statement,Method>
An interprocedural control-flow graph, for which caller-callee edges can be observed usingCalleeListenerandCallerListener. This call graph wraps a precomputed call graph and notifies listeners about all interprocedual edges for the requested relation at once.- Author:
- Melanie Bruns on 04.05.2018
-
-
Constructor Summary
Constructors Constructor Description ObservableStaticICFG(CallGraph icfg)
-
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.voidaddEdges(CallGraph.Edge e)voidcomputeFallback()Collection<Statement>getEndPointsOf(Method m)intgetNumberOfEdgesTakenFromPrecomputedGraph()Returns negative number to signify all edges are precomputed.Collection<Statement>getStartPointsOf(Method m)booleanisCallStmt(Statement stmt)Returnstrueif the given statement is a call site.booleanisExitStmt(Statement stmt)Returnstrueif the given statement leads to a method return (exceptional or not).booleanisStartPoint(Statement stmt)Returns true is this is a method's start statement.voidresetCallGraph()Resets the call graph.
-
-
-
Constructor Detail
-
ObservableStaticICFG
public ObservableStaticICFG(CallGraph icfg)
-
-
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>
-
getStartPointsOf
public Collection<Statement> getStartPointsOf(Method m)
- Specified by:
getStartPointsOfin interfaceObservableICFG<Statement,Method>
-
isCallStmt
public boolean isCallStmt(Statement stmt)
Description copied from interface:ObservableICFGReturnstrueif the given statement is a call site.- Specified by:
isCallStmtin interfaceObservableICFG<Statement,Method>
-
isExitStmt
public boolean isExitStmt(Statement stmt)
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 stmt)
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>
-
getEndPointsOf
public Collection<Statement> getEndPointsOf(Method m)
- Specified by:
getEndPointsOfin interfaceObservableICFG<Statement,Method>
-
getNumberOfEdgesTakenFromPrecomputedGraph
public int getNumberOfEdgesTakenFromPrecomputedGraph()
Returns negative number to signify all edges are precomputed. CallGraphDebugger will add the actual number in.- Specified by:
getNumberOfEdgesTakenFromPrecomputedGraphin interfaceObservableICFG<Statement,Method>- Returns:
- -1 as all edges are precomputed, but we don't have access to the actual number
-
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>
-
-