[Soot-list] No active body

Ondrej Lhotak olhotak at uwaterloo.ca
Thu Jan 19 16:24:05 EST 2006


The loadClassAndSupport() method only "resolves" the class, in that it
only creates the skeleton for the class, listing its fields and methods,
but it does not load the code of the actual methods. To read the code of
a method and build the Jimple body for it, use the retrieveActiveBody()
method on each SootMethod.

Ondrej

On Thu, Jan 19, 2006 at 03:00:46PM -0200, Eduardo S. Cordeiro wrote:
> Hello there,
> 
> I have followed the "createclass" example with no difficulties and read 
> on the "On the Soot menagerie" tutorial. In my program, I was trying to 
> remove some methods from a class loaded by Soot, via the 
> SootClass.removeMethod(SootMethod) method. When I tried to write the 
> class to Jimple format (using the code provided as part of the 
> "createclass" example), I got a RuntimeException on method 
> Printer.printTo saying that there is "no active body for method <init>". 
> Using Jasmin to write a class file also produces this error.
> 
> I thought this might have been something wrong in my method-deletion 
> code, so I removed it. The program thus simply loads a given class and 
> tries to write that class back to file with no changes, but I still get 
> the same error. Further investigation shows that apparently ALL methods 
> have no active body after the class is loaded by Soot (via 
> Scene.v().loadClassAndSupport(String)).
> 
> What am I doing wrong?
> 
> Regards,
> Eduardo Cordeiro
> 
> PS.: I am using the Soot, Jasmin and Polyglot classes provided on the 
> Soot Eclipse plugin version 2.2.2 in my classpath
> _______________________________________________
> 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