[Soot-list] How to have whole-program analysis run from non-main() methods
eric.bodden at ec-spride.de
Fri Dec 16 03:54:21 EST 2011
> How does Soot decide which classes to load and resolve?
In whole-program mode I believe it will load the entire transitive
closure of the entry points (plus any application classes you may have
given, see here: http://www.sable.mcgill.ca/soot/tutorial/usage/).
> All of my
> classes are in one JAR file. Currently I have a set of classes with
> known entry-points with static main() functions, but I also have
> another set of classes which I suspect are reachable only via
> reflection. Assuming that the reflection calls are not reflected due
> to the unsoundness introduced, then my call-graph should consist of
> unconnected components, with one set reachable from the static main()
> functions, and the other reachable through other methods, e.g. the
> functions registered with the reflection API.
Well, classes/methods that are only accessed through reflection will
not be taken into account at all unless you use TamiFlex in
combination with Soot.
> But if I use addBasicClass() on the classes with the main() functions,
> then will the other classes not reachable without reflection be added
> to the worklist of classes to resolve?
Yes, they should be resolved but nothing else, really. They will still
not be reachable in your call graph and hence a whole-program analysis
will likely not be doing anything with those classes.
> Because if the other classes
> which are in the JAR but are not reachable are not added to the
> worklist, then even the suggested wjpp transform() would not add the
> methods in those classes as entry points?
In this case it would make sense to just add all classes in the JAR as
application classes, for instance using the process-dir option. That
way, they will be resolved for sure.
> Second (unrelated) question: Is wjpp a new pack not available in 2.4.0?
Probably not. It also is a recent addition. We should really do a new release...
More information about the Soot-list