[Soot-list] Error when retrieving the body of a method in abc

Eric Bodden eric.bodden at mail.mcgill.ca
Sun Apr 23 11:38:45 EDT 2006


Hello.

This was explained more or less in this thread already:
http://www.sable.mcgill.ca/pipermail/soot-list/2006-February/000513.html

In a nutshell: At this stage you have to make sure manually, that Soot
loads the class to the right level. At the moment it seems to be at
"signature" level only, which does not expose any code information.

Eric

> -----Original Message-----
> From: soot-list-bounces at sable.mcgill.ca 
> [mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of Joe Chien
> Sent: Sunday, April 23, 2006 9:54 AM
> To: soot-list at sable.mcgill.ca
> Subject: [Soot-list] Error when retrieving the body of a method in abc
> 
> Hi,
>    I just use abc and soot to perform my analysis. When 
> runing the following code, a NullPointerException occurred.
>    
>    for (Iterator cIt = new 
> ArrayList(Scene.v().getClasses()).iterator(); cIt.hasNext();) {
>        final SootClass c = (SootClass) cIt.next();
>        for (Iterator mIt = c.methodIterator(); mIt.hasNext();){
>              final SootMethod m = (SootMethod) mIt.next();
>              if (!m.isConcrete())     continue;
>              if (m.isNative())        continue;
>              if (m.isPhantom())       continue;
>              if (!m.hasActiveBody()) {
>                   change = true;
>                   m.retrieveActiveBody();
>              }    
>        }
>    }
>   
> The exception was thrown from m.retrieveActiveBody() when m 
> is a method 
>       <test.cases.ptsto.Dump: void 
> before$0(test.cases.ptsto.Main$Point)>
> corresponding to an before advice. I checked the SootMethod 
> instance and found m.ms=null.
> 
> The code is running is a SceneTransformer called like this:
> abc.main.Main.main(abcArgs);
> Transform transform=new 
> Transform("wjtp.mytransform",MyTransformer.v());
> PackManager.v().getPack("wjtp").add(transform);
> transform.apply();
> 
> 
> Could any body give me some suggestions? Thank you very much!
> 
> 
> 
> 
> -- 
> Sincerely,
> Joe Chien
> owqian at gmail.com
> 



More information about the Soot-list mailing list