public String toString() { QueueReader<Edge> reader = listener(); StringBuffer out = new StringBuffer(); while (reader.hasNext()) { Edge e = (Edge) reader.next(); out.append(e.toString() + "\n"); } return out.toString(); }
public ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints, Filter filter) { this.filter = filter; this.cg = graph; addMethods(entryPoints); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if (filter != null) { this.edgeSource = filter.wrap(this.edgeSource); } }
/** * Removes all outgoing edges that start at the given unit * * @param u * The unit from which to remove all outgoing edges * @return True if at least one edge has been removed, otherwise false */ public boolean removeAllEdgesOutOf(Unit u) { boolean hasRemoved = false; for (QueueReader<Edge> edgeRdr = listener(); edgeRdr.hasNext();) { Edge e = edgeRdr.next(); if (e.srcUnit() == u) { removeEdge(e); hasRemoved = true; } } return hasRemoved; }
public OnFlyCallGraph(PAG pag, boolean appOnly) { this.pag = pag; callGraph = Scene.v().internalMakeCallGraph(); Scene.v().setCallGraph(callGraph); ContextManager cm = CallGraphBuilder.makeContextManager(callGraph); reachableMethods = Scene.v().getReachableMethods(); ofcgb = new OnFlyCallGraphBuilder(cm, reachableMethods, appOnly); reachablesReader = reachableMethods.listener(); callEdges = cm.callGraph().listener(); }
/** * Swaps an invocation statement. All edges that previously went from the given statement to some callee now go from the * new statement to the same callee. This method is intended to be used when a Jimple statement is replaced, but the * replacement does not semantically affect the edges. * * @param out * The old statement * @param in * The new statement * @return True if at least one edge was affected by this operation */ public boolean swapEdgesOutOf(Stmt out, Stmt in) { boolean hasSwapped = false; for (QueueReader<Edge> edgeRdr = listener(); edgeRdr.hasNext();) { Edge e = edgeRdr.next(); if (e.srcUnit() == out) { removeEdge(e); addEdge(new Edge(e.getSrc(), in, e.getTgt())); hasSwapped = true; } } return hasSwapped; }
QueueReader<Edge> edgeList = Scene.v().getCallGraph().listener(); while (edgeList.hasNext()) { Edge edge = edgeList.next();
public String toString() { QueueReader<Edge> reader = listener(); StringBuffer out = new StringBuffer(); while(reader.hasNext()) { Edge e = (Edge) reader.next(); out.append( e.toString() + "\n" ); } return out.toString(); } /** Returns the number of edges in the call graph. */
public String toString() { QueueReader<Edge> reader = listener(); StringBuffer out = new StringBuffer(); while(reader.hasNext()) { Edge e = (Edge) reader.next(); out.append( e.toString() + "\n" ); } return out.toString(); } /** Returns the number of edges in the call graph. */
public ReachableMethods( CallGraph graph, Iterator<MethodOrMethodContext> entryPoints, Filter filter ) { this.filter = filter; this.cg = graph; addMethods( entryPoints ); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if( filter != null ) this.edgeSource = filter.wrap( this.edgeSource ); } public ReachableMethods( CallGraph graph, Collection<MethodOrMethodContext> entryPoints ) {
public ReachableMethods( CallGraph graph, Iterator<MethodOrMethodContext> entryPoints, Filter filter ) { this.filter = filter; this.cg = graph; addMethods( entryPoints ); unprocessedMethods = reachables.reader(); this.edgeSource = graph.listener(); if( filter != null ) this.edgeSource = filter.wrap( this.edgeSource ); } public ReachableMethods( CallGraph graph, Collection<MethodOrMethodContext> entryPoints ) {
CallGraph cg = Scene.v().getCallGraph(); Iterator<Edge> it = cg.listener(); while (it.hasNext()) { soot.jimple.toolkits.callgraph.Edge e = (soot.jimple.toolkits.callgraph.Edge) it.next();