[Soot-list] Interprocedural analysis with custom entry points
Marc-Andre Laverdiere-Papineau
marc-andre.laverdiere-papineau at polymtl.ca
Fri Jun 1 15:25:44 EDT 2012
Hello,
I tried doing an interprocedural analysis with a list of pre-defined
entry points. I keep on getting this error:
No call graph present in Scene. Maybe you want Whole Program mode (-w).
I have this gut feeling that having custom-defined entry points doesn't
sit well with the rest of the code that expects a main class.
Here is a code snippet of what I'm doing:
Scene.v().setSootClassPath(Scene.v().defaultClassPath()+ ":" +
jceClassPath+ ":" + libCP()+ path);
//Java parsing options
Options.v().set_src_prec(Options.src_prec_java);
Options.v().set_keep_line_number(true);
Options.v().set_polyglot(false); // Force Java 5
Options.v().set_process_dir(Arrays.asList(path));
Options.v().set_output_format(Options.output_format_jimple);
//Work in whole-program mode
Options.v().set_whole_program(true); //Doesn't really turn it on
properly somehow
Options.v().set_exclude(Arrays.asList("java", "javax", "org.hibernate"));
// General Options
Options.v().set_time(true);
Options.v().set_verbose(true);
//Set entry points
Scene.v().loadBasicClasses();
Scene.v().loadNecessaryClasses();
final String className = "guest.GuestServlet";
SootClass cl = Scene.v().loadClassAndSupport(className); //TODO make
that detected
Scene.v().setEntryPoints(Arrays.asList(cl.getMethodByName("doGet"),
cl.getMethodByName("doPost")));
//Call graph options
PhaseOptions.v().setPhaseOption("cg", "enabled:true");
PhaseOptions.v().setPhaseOption("cg", "implicit-entry:false");
PhaseOptions.v().setPhaseOption("cg", "verbose:true");
PhaseOptions.v().setPhaseOption("cg.cha", "verbose:true");
PhaseOptions.v().setPhaseOption("cg.spark", "enabled:true");
PhaseOptions.v().setPhaseOption("cg.spark", "verbose");
CallGraph cg = Scene.v().getCallGraph();
So, what am I doing wrong?
--
Marc-André Laverdière-Papineau
Étudiant au doctorat - PhD Student
More information about the Soot-list
mailing list