[Soot-list] soot.SootResolver$SootClassNotFoundException

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Thu Jan 30 14:07:35 EST 2014


Hello,

I think you should

a) Use the Soot main and make printPossibleCallers a Transformer in the
wjtp phase
b) Make sure you have a sane classpath and process path - I don't see it
set right now

Let me know if that helps.

Regards,

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 01/28/2014 08:59 PM, qpj wrote:
> Hi Everyone,
> When I use this stmt,
> SootClass sc = Scene.v().loadClassAndSupport("day28.HelloWorld");
> the following exception came:
> Exception in thread "main" soot.SootResolver$SootClassNotFoundException:
> couldn't find class: day28.HelloWorld (is your soot-class-path set
> properly?)
> at soot.SootResolver.bringToHierarchy(SootResolver.java:216)
> at soot.SootResolver.bringToSignatures(SootResolver.java:250)
> at soot.SootResolver.bringToBodies(SootResolver.java:291)
> at soot.SootResolver.processResolveWorklist(SootResolver.java:161)
> at soot.SootResolver.resolveClass(SootResolver.java:127)
> at soot.Scene.loadClass(Scene.java:608)
> at soot.Scene.loadClassAndSupport(Scene.java:594)
> at day28.CallGraphTest.main(CallGraphTest.java:22)
> 
> 
> my code:
> package day28;
> 
> import java.util.Iterator;
> import java.util.List;
> 
> import soot.PackManager;
> import soot.Scene;
> import soot.SootClass;
> import soot.SootMethod;
> import soot.Transform;
> import soot.jimple.toolkits.callgraph.CHATransformer;
> import soot.jimple.toolkits.callgraph.CallGraph;
> import soot.jimple.toolkits.callgraph.Sources;
> import soot.options.Options;
> import study.GrimpInstrumentor;
> 
> public class CallGraphTest {
> public static void main(String[] args) {
> Options.v().set_whole_program(true);
> Scene.v().addBasicClass("java.io.PrintStream",SootClass.SIGNATURES);
>         Scene.v().addBasicClass("java.lang.System",SootClass.SIGNATURES);
>         SootClass sc = Scene.v().loadClassAndSupport("day28.HelloWorld");
>         sc.setApplicationClass();  
>         List<SootMethod> list = sc.getMethods();
>         for(SootMethod sm:list){
>         printPossibleCallers(sm);
>         }
> }
> public static void printPossibleCallers(SootMethod target) {
> CHATransformer.v().transform();
> CallGraph cg = Scene.v().getCallGraph();
> Iterator sources = new Sources(cg.edgesInto(target));
> while (sources.hasNext()) {
> SootMethod src = (SootMethod)sources.next();
> System.out.println(target + " might be called by " + src);
> }
> }
> }
> 
> The day28.HelloWorld is in the same package with CallGraphTest. This
> troubles me a lot, I hope you can help me.
> Xiangxing
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list