[Soot-list] instrument loop for a method

Linh Ho Tran hotranlinh at yahoo.com
Wed May 8 03:48:11 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130508/1d33ddba/attachment.html 


More information about the Soot-list mailing list