[Soot-list] Exception occures while running soot the generate call graph of dacapo benchmarks

anne wu annesh.love at gmail.com
Sun Jul 31 03:59:26 EDT 2011


Hi, every one:
I tried to use soot to generate callgraph of the avrora-small program
in *dacapo
benchmarks* but exception occures.
I first use the *TamiFlex* to Dumping classes and creating log files for
avrora-small:
*java -javaagent:poa.jar=out/avrora-small -jar dacapo-9.12-bach.jar avrora -
**s small
*then, I use soot to generate and output the call graph, my code is as
follows:
public class CallGraphExample
{
 public static void main(String[] args) {

   List<String> argsList = new ArrayList<String>();
   argsList.addAll(Arrays.asList(new String[]{
     "-w",
     "-app",
     "-p",
     "cg.spark",
     "enabled",
     "cg",
     "reflection-log:/root/Myfile/javadev/jdk1.6.0_26/lib/out/avrora-small/refl.log",
     "-include",
     "org.apache.",
     "-include",
     "org.w3c.",
     "-main-class",
     "Harness",
     "-d",
     "/root/Myfile/javadev/jdk1.6.0_26/lib/sootified/avrora-small",
     "Harness"
   }));
   PackManager.v().getPack("wjtp").add(new Transform("wjtp.myTrans", new
SceneTransformer() {
    @Override
    protected void internalTransform(String phaseName, Map options) {
     CHATransformer.v().transform();
     SootClass a = Scene.v().getSootClass("Harness");
     Scene.v().loadNecessaryClasses();
     SootMethod onCreate = Scene.v().getMainClass().getMethodByName("main");
     CallGraph cg = Scene.v().getCallGraph();
     Iterator<MethodOrMethodContext> targets = new
Targets(cg.edgesOutOf(onCreate));
     while (targets.hasNext()) {
      SootMethod tgt = (SootMethod)targets.next();
      System.out.println(onCreate + " may call " + tgt);
     }
    }
   }));
   String [] paras = new String[0];
   paras = argsList.toArray(new String[0]);
   System.out.print("before soot.Main.main\n");
   Scene.v().setSootClassPath(".:/root/Myfile/javadev/jdk1.6.0_26/jre/lib/rt.jar:/root/Myfile/javadev/jdk1.6.0_26/lib::/root/Myfile/javadev/jdk1.6.0_26/lib/out/avrora-small");
   soot.Main.main( paras);
  }
}
  when I run my program, I got the following exception:
  Exception in thread "main" java.lang.RuntimeException:Phase wjap.guards
already in pack

  would you please tell me the reason and what should I do to solve the
problem?

  Thank you very much.
  Anne.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110731/4a48f778/attachment.html 


More information about the Soot-list mailing list