Package soot.toolkits.graph

Examples of soot.toolkits.graph.CompleteUnitGraph


            if (debug) {
                System.out.println("collecting constraints for " + method);
            }

            CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

            // this will help us figure out where locals are defined.
            SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);
            SimpleLocalUses localUses = new SimpleLocalUses(unitGraph,
                    localDefs);
View Full Code Here


                .hasNext();) {
            SootMethod method = (SootMethod) methods.next();

            JimpleBody body = (JimpleBody) method.retrieveActiveBody();

            CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

            // This will help us figure out where locals are defined.
            SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);

            for (Iterator units = body.getUnits().snapshotIterator(); units
View Full Code Here

            SootMethod method = (SootMethod) methods.next();

            //       System.out.println("replaceAttributeCalls in " + method);
            JimpleBody body = (JimpleBody) method.retrieveActiveBody();

            CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

            // this will help us figure out where locals are defined.
            SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);

            for (Iterator units = body.getUnits().snapshotIterator(); units
View Full Code Here

                System.out.println("Replacing entity calls in " + method);
            }

            JimpleBody body = (JimpleBody) method.retrieveActiveBody();

            CompleteUnitGraph unitGraph = new CompleteUnitGraph(body);

            // this will help us figure out where locals are defined.
            SimpleLocalDefs localDefs = new SimpleLocalDefs(unitGraph);

            for (Iterator units = body.getUnits().snapshotIterator(); units
View Full Code Here

      context.setCurrentClass(c);
      for (SootMethod m : c.getMethods()) {
        if (!m.isConcrete())
          continue;
        context.setCurrentSootMethod(m);
        CompleteUnitGraph unitgraph = new CompleteUnitGraph(m.retrieveActiveBody());
        context.setNullness(new NullnessAnalysis(unitgraph));
        context.setStringConstants(new StringConstantAnalysis(unitgraph));
        context.setArrayConstants(new ArrayConstantAnalysis(unitgraph));
        Method method = context.getMethod(m);
        Map<Unit,StatementPair> translated = new HashMap<Unit,StatementPair>();
        for (Unit stmt : m.getActiveBody().getUnits()) {
          context.setCurrentUnit(stmt);
          context.setCurrentLine(getLineNumber(stmt));
          translated.put(stmt, translator.translateStmt((Stmt)stmt));
        }
        for (Map.Entry<Unit, StatementPair> entry : translated.entrySet()) {
          Unit stmt = entry.getKey();
          StatementPair translation = entry.getValue();
          // add successors
          for (Unit next : unitgraph.getSuccsOf(stmt)) {
            StatementPair nextt = translated.get(next);
            graph.addEdge(translation.last, nextt.first, new VariableFilter());
          }
          // add (exceptional) return edge
          graph.addEdge(translation.last, method.getExit(), new VariableFilter());
        }
        // add entry edges
        for (Unit head : unitgraph.getHeads()) {
          graph.addEdge(method.getEntry(), translated.get(head).first, new VariableFilter(true, VariableFilter.Kind.ENTRY));
        }
      }
    }
   
View Full Code Here

    boolean hasNextCall(SootMethod method) {
        // TODO next() could be nested arbitrarily deep in delegates

        // check all implementations:
        for (SootMethod calledMethod : getPossibleTargets(method)) {
            CompleteUnitGraph cug = new CompleteUnitGraph(
                    calledMethod.retrieveActiveBody());
            // check every statement for a next() invocation
            for (Unit aCug : cug) {
                assert aCug instanceof Stmt;
                final Stmt stmt = (Stmt) aCug;
View Full Code Here

            SootClass ac = (SootClass) aci.next();
            Iterator mi = ac.getMethods().iterator();
            while (mi.hasNext()) {
                SootMethod sm = (SootMethod) mi.next();
                if (sm.isConcrete()) {
                    CompleteUnitGraph cug = new CompleteUnitGraph(sm.retrieveActiveBody());
                    Iterator si = cug.iterator();
                    while (si.hasNext()) {
                        Stmt stmt = (Stmt) si.next();
                        if (stmt.containsInvokeExpr()) {
                            InvokeExpr expr = stmt.getInvokeExpr();
                            if (expr.getMethodRef().getSignature().equals(sig)) {
View Full Code Here

        queue.add(initialMethod);
        while (!queue.isEmpty()) {
            log.debug("Methods-to-visit-queue has a size of " + queue.size());
            SootMethod method = queue.removeFirst();
            final Body body = method.retrieveActiveBody();
            CompleteUnitGraph cug = new CompleteUnitGraph(body);
            for (Unit aCug : cug) {
                assert aCug instanceof Stmt;
                Stmt st = (Stmt) aCug;
                if (st.containsInvokeExpr()) {
                    handlePlug(st, body, stateMachine);
View Full Code Here

            SootMethod enclosingMethod, Stmt enclosingStatement) {
        InvokeExpr expr = transition.getExpr();
        SootMethod webMethod = transition.getTarget().getMethod();
        Type[] varArgTypes = null;
        Type varArgBase = null;
        CompleteUnitGraph graph = new CompleteUnitGraph(
                enclosingMethod.retrieveActiveBody());

        Value varArgs = expr.getArg(expr.getArgs().size() - 1);
        int varArgSize = -1;
View Full Code Here

        // each class
        for (SootClass classs : Scene.v().getApplicationClasses()) {
            // each method in the class
            for (SootMethod method : classs.getMethods()) {
                if (method.isConcrete()) {
                    CompleteUnitGraph cug = new CompleteUnitGraph(
                            method.retrieveActiveBody());
                    // each statement in the unit in the class
                    for (Unit unit : cug) {
                        Stmt stmt = (Stmt) unit;
                        if (stmt.containsInvokeExpr()) {
View Full Code Here

TOP

Related Classes of soot.toolkits.graph.CompleteUnitGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.