[Soot-list] Couple of (mostly) minor things

Hal Hildebrand hal.hildebrand at gmail.com
Wed Aug 18 13:09:55 EDT 2010


In testing, I've found that it's far more useful to set the options used by Soot via the methods on soot.options.Options.  The problem with relying strictly on this mechanism is that Main.main() will simply print out the license and version info if the arguments passed to it are empty (via the CompilationDeathException).  Thus, you have to put in at least one dummy argument when invoking main(), even if you have set all the options programatically.  As I'm now working on Ant and Maven tools, this becomes a bit more acute because it is far more reliable and flexible to programmatically set up the options than to build up string arguments.

Is the fix for this as simple as eliminating the check for zero args at line 118 in soot.Main?  My guess is that this would certainly fix my particular issue, but would cause confusion in other circumstances.  Perhaps adding another option in Option, and then adding the setting of this option to this check at line 118?

Another issue I have is dealing with the singleton state of Soot.  There doesn't appear to be any way to "reset" this state other than to essentially throw away the class loader and start over again.  This becomes a particular problem in unit testing under Eclipse or Maven, as it is rather difficult to simply throw away the class loader that is used for Soot.  As I move into integrating my system into the Eclipse IDE, Ant and Maven, this will also rear its head and force me to deal with it in some systematic fashion.  I believe I can work around this with some reflection hackery and a some class loader mucking, but it doesn't seem particularly attractive.  So, I was wondering if anyone else ran into this problem and whether or not they came up with a solution they'd like to share.  Certainly, if there is not better way, ugly or not I'll make use of the reflection option with a separate class loader.

Thanks,

Hal


More information about the Soot-list mailing list