[Soot-list] How to get loop Info?

Nikhil cs16m028 at smail.iitm.ac.in
Mon Mar 12 10:06:44 EDT 2018


Hi all,

I am new to Soot. I am using LoopNestTree to find the loop.

// Note that I will be working with loops which have simple termination
// condition and incerement/decrement values
for(int i = 0;i<5;i++)
    System.out.println(i);

But, What I want for my work is:
for the above loop I want
Start_i = 0; 
End_i = 5;
Incr_i = 1;

Is there any way of getting this info?

I am getting the loop termination conditions using getLoopExits().
I think I can extract the value of End_i from it.

#Jimple for reference

       i = 0;

     label1:
        if i >= 5 goto label2;
        $r0 = <java.lang.System: java.io.PrintStream out>;
        virtualinvoke $r0.<java.io.PrintStream: void println(int)>(i);
        i = i + 1;
        goto label1;

     label2:
        return;



Thanks,
--Nikhil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180312/dfc1b9c5/attachment.html>


More information about the Soot-list mailing list