[Soot-list] Exceptions when using Soot phase option

Sunny sunfire001 at gmail.com
Tue May 9 17:12:26 EDT 2006


Hi,

I searched through Soot's online documents and archives and found that the
solution
to my question asked yesterday may be the phase option: -p jb
use-original-names:true

But let me first make sure I understood some concepts correctly: a Pack such
as "jtp" or "jb" is a top-level
phase. Subphases can be divided into two groups: Soot defined and User
defined. Soot-defined subphases
are jb.a, jb.ls ... User-defined subphases are those that extend either
BodyTransformer or SceneTransformer.
Is this right?

Right now I am using Feng Qian's example (tutorial "Using Soot to instrument
a class file"). In that example,
the MainDriver.java uses:

 Pack jtp = PackManager.v().getPack("jtp");

to get a Jimple Transformation Pack. But according to the "Soot phase
options", it seems that i
should use jb = PackManager.v().getPack("jb"); since the option
use-original-names is accepted by
jb, not jtp. Therefore I changed the MainDriver.java like this:

 Pack jb = PackManager.v().getPack("jb");
 jb.add(new Transform("jtp.instrumenter", new InvokeStaticInstrumenter()));
 PhaseOptions.v().setPhaseOption("jb", "use-original-names");

Unfortunately, I got the following exception:

Soot started on Tue May 09 17:03:36 EDT 2006
java.lang.NullPointerException
 at soot.coffi.Util.getLocalForIndex(Util.java:840)
 at soot.coffi.CFG.generateJimple(CFG.java:3241)
 at soot.coffi.CFG.jimplify(CFG.java:1464)
 at soot.coffi.CFG.jimplify(CFG.java:1127)
 at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:98)
 at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:80)
 at soot.SootMethod.retrieveActiveBody(SootMethod.java:304)
 at soot.PackManager.retrieveAllBodies(PackManager.java:727)
 at soot.PackManager.runPacks(PackManager.java:306)
 at soot.Main.run(Main.java:179)
 at soot.Main.main(Main.java:153)
 at src.MainDriver.main(MainDriver.java:33)
Exception in thread "main"

Is this a correct usage of the phase options?  Many thanks for any
suggestions!

Sunny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060509/921a259c/attachment.htm


More information about the Soot-list mailing list