[Soot-list] Problem building callgraph

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Thu Sep 17 03:10:13 EDT 2009


Hi Marcos.

It's hard to say because it's likely that your mistake is not in the
code snippet you sent us. Can you post your whole code? Or even
better, first cut it down into a minimal failing example.

Eric

2009/9/16 Marcos Chicote <totochicote at gmail.com>:
> 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
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list