[Soot-list] Performing analysis on Java Source Code

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Mon Jul 11 10:35:32 EDT 2011


Hi John.

There is no need to use loadClassAndSupport.

You just use Soot as you normally would. If Soot does not find a class
file for the class it is supposed to analyze then Soot will
automatically look for its source file. Also, you can use the src-prec
option to tell Soot what kind of input it should look for:
http://www.sable.mcgill.ca/soot/tutorial/usage/

Eric

On 9 July 2011 01:48, John Dee <jdsoot at hotmail.com> wrote:
> Hi there.
> I am interested in using Soot to perform some program slicing.
> However, ultimately, I will need to be able to map the analysis (jimple
> code) back to the java source code in order to remove some source code.
> I can perform the code manipulation using Eclipse JDT.
> I have read from the following thread
> (http://www.sable.mcgill.ca/pipermail/soot-list/2011-February/003495.html)
> that the way to be able to map jimple code back to java source code is by
> preserving the line number when performing the analysis. My question
> therefore is,
> how can you perform analysis from Java source code using Soot, instead of
> bytecode? I was working through the tutorials today
> and came across a code snippet:
> public static void main(String... args) {
> args = new String[]{"soot.backward.analysis.TestClass"};
> SootClass sClass = Scene.v().loadClassAndSupport(args[0]);
> sClass.setApplicationClass();
> // ...
> }
> As you can see above, the 'loadClassAndSupport' method is called on the
> 'TestClass' to load the class.
> However, will using the above code mean that the produced Jimple
> representation is generated from java bytecode
> or java source code?
> Many thanks,
> JD
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list