[Soot-list] Re: Soot-list Digest, Vol 38, Issue 1

Eric Bodden eric.bodden at mail.mcgill.ca
Mon Jun 2 09:13:54 EDT 2008


Ok this is tricky then.

Here is one possible approach that could work:

1.) Read in your source code with Soot and have it transformed to
Jimple, giving the -keep-line-number command line option to Soot.
2.) Perform all the analyses you need on the Jimple level, e.g. inside
a BodyTransformer or SceneTransformer.
3.) Now you need to somehow relate back the analysis results for the
Jimple code to your Java AST. You can do that using position
information: Because you added -keep-line-number to the command line,
Soot will generate a Tag on each Jimple statement (or at least on most
of them) telling you from which Java statement at which line and
column of Java code it originated. You cam then transform the Java AST
using usual rewrites, by comparing the position information of the
Java AST nodes to the position information on the Jimple level.

Eric

2008/6/2 Yu Zhang <upupsky at gmail.com>:
> Hi Eric,
> I need the format to be source code (.java) in the end, what procedure
> should I follow?
>
> Thanks!



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list