[Soot-list] Source code of a given SootMethod

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Nov 14 17:01:22 EST 2007


Hi, Mario.

Soot puts tags on the statements in the SootMethod, indicating where
their source came from. (see Stmt.getTag(..)) Using those tags you can
then retrieve the source location and read in the file if you like.
Soot has no built-in support for that.

Eric

On 14/11/2007, Mario Mendez <mario at cs.unm.edu> wrote:
> Hi all,
>
> I was trying to find, for a given SootMethod (JimpleBody), the
> equivalent Java source code. For doing that, I'm forcing the compilation
> process to start in the source:
>      Options.v().set_src_prec(Options.src_prec_java);
> , but then I found no method in the SootMethod class that returns the
> source (since getSource seems not to deal with this).
>
> I guess I could decompile the SootMethod using Dava, but I'm looking for
> a solution that saves that effort by simply retrieving the source
> (String) that might have been stored somewhere when the compilation
> starts in the .java file.
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>


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


More information about the Soot-list mailing list