[Soot-list] No Method Source Set for Method <{method signature here}>

Jason Ott jott002 at ucr.edu
Fri Jul 24 12:45:44 EDT 2015


This is the "inner workings"?  I thought retrieving method bodies was one
of the basic functionalities of Soot.  I was looking through the source on
Github, and I don't fully understand why Soot can properly retrieve the
class, but the method bodies aren't being built properly; while both are
concrete.  I don't think I'm misusing Soot by using it in this way.  Is
there something more concrete or a more direct path you could direct me to
help me understand this problem more fully.

On Fri, Jul 24, 2015 at 9:39 AM, Steven Arzt <Steven.Arzt at cased.de> wrote:

> Hi Jason,
>
>
>
> You are really accessing internals of Soot. This is something I would
> generally avoid unless you have a very thorough understanding of Soot’s
> inner workings. If you for instance try to load the body of a non-concrete
> method (which by definition cannot have a body), this will fail. Since you
> are accessing the loader directly, you have to take care of all of that
> stuff on your own.
>
>
>
> Best regards,
>
>   Steven
>
>
>
> *Von:* soot-list-bounces at CS.McGill.CA [mailto:
> soot-list-bounces at CS.McGill.CA] *Im Auf**trag von *Jason Ott
> *Gesendet:* Freitag, 24. Juli 2015 02:22
> *An:* soot-list at cs.mcgill.ca
> *Betreff:* [Soot-list] No Method Source Set for Method <{method signature
> here}>
>
>
>
> I have a thread that identifies a class to bring into the Soot Scene.  I
> do so through the following method:
>
> protected synchronized SootClass bringClassToScene(String className) {
>     SootClass sootClass;
>     sootClass = Scene.*v*().forceResolve(className, SootClass.*BODIES*);
>     sootClass.setApplicationClass();
>     return sootClass;
> }
>
> Which is invoked by means of: SootClass sootClass = bringClassToScene(
> className);
>
>
>
> className is simply a string in the format: "path.to.package.ClassName".
>
>
>
> I then try to get the active bodies of a method in the class by means of:
>
> for(SootMethod m : sootClass.getMethods()) {
>
> Body body = m.retrieveActiveBody();
>
> // do other work here
>
> }
>
>
>
> At which point I get the following error:
>
>
>
> java.lang.RuntimeException: No method source set for method <com.android.server.power.PowerManagerService$BinderService:
> void <init>(com.android.server.power.PowerManagerService)>
>
> Error retrieving active body of:
> <com.android.server.power.PowerManagerService$BinderService: void
> <init>(com.android.server.power.PowerManagerService)>
>
>
>
> I am using Soot with the following arguments:
>
> -cp /path/to/classes/:/path/to/other/classes/:. -f J -w -allow-phantom-refs
>
>
> I do not understand why Soot cannot fetch the active body of a given
> method.  This doesn't happen with every method, but I have not been able to
> discern any pattern.
>
>
>
> Thanks,
>
> Jason
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150724/e556032e/attachment-0001.html 


More information about the Soot-list mailing list