[Soot-list] How to redirect Soot output to Eclipse console?

Yepang Liu yepangliu at gmail.com
Thu Jun 9 01:26:45 EDT 2011


Hi all,

I am a Soot beginner. I tried the following example in Eclipse to print out the call graph in textual format.

public class CGDumper extends SceneTransformer {

	protected void internalTransform(String phaseName,Map options){
		CallGraph cg=Scene.v().getCallGraph();
		Iterator<Edge> it=cg.listener();
		while(it.hasNext()){
			Edge e=(Edge) it.next();
			G.v().out.println(e.src().toString()+e.srcStmt().toString()+" ="+e.kind().toString()+" =>"+e.tgt().toString());
		}
	}
	
	public static void main(String[] args) {
		PackManager.v().getPack("wjtp").add(new Transform("wjtp.cgdumper",new CGDumper()));
		soot.Main.main(args);
	}

}

And my test class is as follows.
public class Test {

	public static void foo(){
		bar();
	}
	public static void bar(){
	}
	public static void func(){
	}
	public static void main(String[] args) {
		foo();
		func();
	}
}

Using G.v().out.println() method, I expect the output from Soot will be redirected to the Eclipse console. But in fact, I see nothing except the following information.

Starting from project BodyTransformer:
CGDumper --d /Users/andrew/java_workspace/BodyTransformer/sootOutput --cp /Library/Java/JavaVirtualMachines/1.6.0_24-b07......
Soot started on Thu Jun 09 13:13:56 HKT 2011
Transforming Test... 
Writing to /Users/andrew/java_workspace/BodyTransformer/sootOutput/Test.class
Soot finished on Thu Jun 09 13:13:57 HKT 2011
Soot has run for 0 min. 1 sec.

Can anyone help me? Thank you very much!

Best Regards,
Yepang




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110609/f5560e4e/attachment-0001.html 


More information about the Soot-list mailing list