[Soot-list] Problem building callgraph

Marcos Chicote totochicote at gmail.com
Wed Sep 16 17:13:34 EDT 2009


Hi
I'm new in Soot, so this might be a really stupid problem. I have read the
documentation but couldn't make this work.
I'm trying to build a callgraph. I'm using Guillaume Salagnac's launcher
with this options:

        addDefaultOpt("-w");
        addDefaultOpt("-f","J");
        addDefaultOpt("-app");

        //addDefaultOpt("-i","java"); Original
        addDefaultOpt("-x","java"); // Marcos
        addDefaultOpt("-x","sun"); // Marcos
        //addDefaultOpt("-include-all");

        addDefaultOpt("-allow-phantom-refs");

        addDefaultOpt("-keep-line-number");
        addDefaultOpt("-keep-bytecode-offset");
        addDefaultOpt("-src-prec","class");

        addDefaultOpt("-p","cg","enabled:true"); //Marcos
        //addDefaultOpt("-p","cg.spark","enabled:true");Original
        addDefaultOpt("-p","cg","all-reachable:true");
        //addDefaultOpt("-p","cg","verbose:true");
        addDefaultOpt("-p","jb","use-original-names:true");

After creating the callgraph, when I try to execute this:

        SootClass sootClass2 =
Scene.v().getSootClass("ar.uba.dc.salcian.ListItr");
        SootMethod sootMethod2 = sootClass2.getMethodByName("hasNext");
        sootMethod2.retrieveActiveBody();
        sootMethod2.getActiveBody();

I get a NPE in getBodyFromMethodSource in SootMethod class. Method source
seems to be null.

This is the definition of the method whos body I'm trying to access:

    public boolean hasNext() {
        boolean hasNext = (cell != null);
        return hasNext;
    }

Can someone help me with this? If more information is needed please ask me!

Thanks a lot!
Marcos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090916/0e27be75/attachment.html 


More information about the Soot-list mailing list