[Soot-list] instrument loop for a method

Bernhard Berger berber at tzi.de
Wed May 8 04:15:30 EDT 2013


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/fab7c207/attachment-0001.html 


More information about the Soot-list mailing list