[Soot-list] instrument loop for a method

Linh Ho Tran hotranlinh at yahoo.com
Wed May 8 09:26:25 EDT 2013


I got it, Thanks a lot

Linh


________________________________
 From: Bernhard Berger <berber at tzi.de>
To: Linh Ho Tran <hotranlinh at yahoo.com> 
Cc: "soot-list at sable.mcgill.ca" <soot-list at sable.mcgill.ca> 
Sent: Wednesday, May 8, 2013 5:15 PM
Subject: Re: [Soot-list] instrument loop for a method
 


Hi,

labels are not explicit in Jimple. You just set the target statement for the goto statement (in your case the assignment statement a = a+1). 

Regards,
Bernhard


Am 08.05.2013 um 09:48 schrieb Linh Ho Tran <hotranlinh at yahoo.com>:

Dear members,
>
>
>My work is to instrument a loop for whole body of a method
>
>
>Example: 
> public static foo(int a){
>   a = a + 1;
>   System.out.println(a);
>}
>
>
>Method after instrumentation looks like:
>
>
>public static foo(int a){
>int i = 100;
>  while ( i > 0){
>        a = a + 1;
>System.out.println(a);
>        i--;
>  }
>}
>
>
>My idea is to instrument Goto statement into method such as:
>
>
>public static foo(int a){
>int i = 100;
>  label 0:
>    a = a + 1;
>    System.out.println(a);
>    i--;
>  if (i > 0) goto label0;
>}
>
>
>Instrument label: "label0" at the beginning of body
>Instrument ifStmt with goto at the end of body
>
>
>The problem I cannot find any API function support the instrumentation of label "label0:" into class file. 
>if anyone knows, please help me solve this situation
>
>
>Thanks a lot
>
>
>Linh_______________________________________________
>Soot-list mailing list
>Soot-list at sable.mcgill.ca
>http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130508/f3d28898/attachment.html 


More information about the Soot-list mailing list