[Soot-list] Using Soot without using soot.Main

Kin Keung Ma archicat at gmail.com
Mon Mar 7 20:15:29 EST 2005


Hi, I skimmed through the topics of recent months and couldn't find a
topic related to this. Sorry if it's a repost.

It seems to me that most Soot users either use Soot as a command line
tool, or as an API + framework (write modules and throw into
soot.Main()). But what if I don't want to use soot.Main? I find no
resources about that.

However, I tried the following and it works with Soot 2.1.0:

//beginning of my main
Set bag = new HashSet();
for(int i=0;i<args.length;i++)
    bag.add(Scene.v().loadClassAndSupport(args[i]));

Then I have a bag of SootClasses to work with (e.g. to run flow
analysis on every method of every class). I don't know if it's the
correct way to write . But it works, and I'm very happy with that.

But this fails to work with Soot 2.2.1. The exceptions show that some
methods of some classes outside the "bag" are missing. I guess it's
due to the fact that Soot 2.2.1 does not resolve all classes
completely:

http://svn.sable.mcgill.ca/wiki/index.php/ClassResolver

While -full-resolver causes all classes to be resolved at Bodies, what
can I do if I don't use soot.Main at all? Thanks.

Kin


More information about the Soot-list mailing list