[Fwd: Re: [Soot-list] DAVA question]
Patrick Lam
plam at sable.mcgill.ca
Fri Feb 2 23:02:07 EST 2007
David A Weiser wrote:
> I've got the most current soot package, sootall-2.2.3.jar, added to my
> classpath, and I still get " Exception in thread "main"
> java.lang.NullPointerException" as an error. How can I manipulate the
> AST used by DAVA?
I don't get that exception with the following code. Unfortunately, my
Transform doesn't get called either:
import soot.*;
import java.util.Map;
class DAVATree extends BodyTransformer {
protected void internalTransform(Body b, String phaseName, Map
options) {System.err.println("*** called DAVATree! ***"); }
}
public class MainDriver {
public static void main(String[] args) {
Pack db = PackManager.v().getPack("db");
db.add(new Transform("db.foo", new DAVATree()));
soot.options.Options.v().setPhaseOption("cg", "verbose:true");
soot.options.Options.v().set_output_format(soot.options.Options.v().output_format_dava);
soot.Main.main(args);
}
}
A quick-and-dirty way to do what you want is to hack the DavaBody
constructor. That'll get called with the Dava ASTs...
pat
More information about the Soot-list
mailing list