First create a custom main class in one of your Java projects. An
example would be the following class, that injects a new
BodyTransformer to run an instance of MyAnalysis and print the name of
the method associated with each
body that is visited:
public class MyMain {
public static void main(String[] args) {
PackManager.v().getPack("jtp").add(new Transform("jtp.myTransform",new BodyTransformer(){
protected void internalTransform(Body body, String arg1, Map arg2) {
new MyAnalysis(new ExceptionalUnitGraph(body));
//use G.v().out instead of System.out so that Soot can
//redirect this output to the Eclipse console
G.v().out.println(body.getMethod());
}
});
soot.Main.main(args);
}
}