[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with BlockGraph Constructor




Hi,

I was trying to print the statements in terms of BasicBlocks, hence I
constructed CompleteBlockGraph. But it gives a ClassCastException on line
327 of BlockGraph.java in soot/toolkits/graph. I am using beta.5 version.
Here is the piece of code that I wrote:



       SootClass sClass = Scene.v().loadClassAndSupport(args[0]);


        while (methodIt.hasNext()) {
            SootMethod m = (SootMethod) methodIt.next();
            System.out.println("Printing Method: " + m + "\n");

            JimpleBody body = (JimpleBody) m.getActiveBody();

Fails Here 
	>>  CompleteBlockGraph blockGraph = new CompleteBlockGraph(body); 
	    ListIterator blockIt = blockGraph.getBlocks().listIterator();

            while (blockIt.hasNext()) {
                Block b = (Block) blockIt.next();
                Iterator stmtIt = b.iterator();
                while (stmtIt.hasNext()) {
                    Stmt stmt = (Stmt) stmtIt.next();
                    System.out.println(stmt);
                }
            }


Thanks
Girish