[Soot-list] Get the run-time associated value at certain line(a more clear description for the previous question)

Bodden, Eric eric.bodden at sit.fraunhofer.de
Mon Jan 20 03:17:51 EST 2014


Hi Jingyi.

You should look at the instrumentation tutorials on the Soot website (for instance the GotoInstrumenter). In general it seems like after every statement you want to insert some println-Statement that prints the appropriate values. Note that this kind of instrumentation will be very (!!!) costly at runtime because you will be adding a lot of code.

Eric

On 18.01.2014, at 06:28, Jingyi Wang <wangjyee at gmail.com> wrote:

> Hi Sooters:
> 
> What I want to achieve with soot is to use it to instrument the code such that during run time it can print out all (global and local) variables and their associated values in a file (output.txt) during run time.
> 
> E.g. Given a simple program
> int arr=0; //line 1
> for(int i=0;i<5;i++){ //line 2
>   arr++; //line 3
> }//line 4
> 
> 
> In the output.txt, this supposed to be what it prints out:
> line 1: arr=0
> line 2: i=0;arr=0
> line 3: i=0;arr=1
> line 2: i=1;arr=1
> line 3: i=1;arr=2
> ...
> line 2:i=4;arr=4
> line 3:i=4;arr=5
> line 2:i=5;arr=5
> line 4:i=5;arr=5
> 
> Can I achieve this with soot? If yes, what's the general idea for this?
> 
> Thanks,
> Jingyi
> 
>           
>  
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20140120/0a2d60d0/attachment.bin 


More information about the Soot-list mailing list