[Soot-list] Use the results from a previous run

Cheng Zhang cheng.zhang.stap at gmail.com
Mon Apr 11 12:58:15 EDT 2011


Hi,

I'm using Soot in two steps:
1) do an inter-procedural analysis that is similar to program slicing.
2) use the results of the analysis to select some program points to
insert printing statements.

Currently I use a SceneTransformer and a BodyTransformer in Step 1 and
use another BodyTransformer
in Step 2. Between the two steps, I reset Soot using G.v().reset().
The code looks like:

...
wtpPack.add(new Transfom("wjtp.getcg", new MySceneTransformer()));
jtpPack.add(new Transform("jtp.datadep", new MyBodyTransformer()));
soot.Main.main(args);

// do some slicing-like analysis based on data produced in previous
transformations
// and store the results in a global data structure.

G.v().reset();
...
jtpPack.add(new Transform("jtp.instrument", new AnotherBodyTransformer()));
soot.Main.main(args2);
...

Unfortunately I cannot find a good way to use the results from the
previous run in the second run.
Because the Units are different (i.e., u1.equals(u2) is false) between
two runs, even if they represent the same program point.
Another problem is about values. When I attempt to insert a statement
using a Local (generated in the previous run), Soot throws
an exception complaining that this Local is not contained in the body
(generated in the second run) when generating output files.

Now I am using the String representation and line numbers to match
units from different runs, and using the name and type to match
values.
I am wondering whether there is a better way to use the results from
the previous run.
Thank you.

Best,

Cheng


More information about the Soot-list mailing list