[Soot-list] new problems about detecting loops in SootMethod

dingsun xyz031702 at hotmail.com
Wed May 5 13:05:05 EDT 2010


Dear All       Yesterday I have been able to detect loop structure in a given sootMethod by using LoopFinder.java or LoopNestTree.java       Because I plan to construct CTx path (CTx here means I will go through a loop for x times), so I need to start from the head of the UnitGraph of the current method. Then check Stmt by Stmt, until I met a Stmt which is the head of a loop.   However I met several new problems:1.  I firstly use LoopNestTree to obtain a set of loops within a method:// Suppose we have a SootMethod: smLoopNestTree loopSet = new LoopNestTree(sm.getActiveBody());
2. If I have a Stmt u, I want to check whether is it a head of a loop:
public boolean isLoopEntry(Stmt u){	for(Loop lp: loopTree){		Stmt head=lp.getHead();		if(u.equals(head)){                     //this line never works! , u and head will always have different hashcode.			return true;              		}	}	return false;}
So I fail to check whether the current stmt is a entry of a loop and subsequently I feel hard to construct the CTx path.
Would you give me some indications ?Urgently expecting your suggestions.
Best Regards,Ding Sun

From: xyz031702 at hotmail.com
To: kevinn.tian at gmail.com; soot-list at sable.mcgill.ca
Date: Wed, 5 May 2010 02:03:14 +0800
Subject: Re: [Soot-list] how to detect loop in SootMethod








Dear Kelvin     Yes, It's in LoopFinder.java.  Thanks a lot !     By the way, do you know how to handle side effect functions using soot. Something like, I input a SootMethod, the program can tell me whether this function is side-effect or not.
Best Regards,Ding Sun

> From: kevinn.tian at gmail.com
> Date: Tue, 4 May 2010 12:08:35 -0400
> To: soot-list at sable.mcgill.ca
> Subject: Re: [Soot-list] how to detect loop in SootMethod
> 
> Hi,
> 
>     You might want to refer some files, such as LoopFinder.java  it's
> pretty clear there.
> 
> 
> --
> Best regards,
> Kelvin
> 
> 
> 
> 2010/5/4 dingsun <xyz031702 at hotmail.com>:
> > Dear All
> >        For my project requirement, I need to detect the following things in
> > CFG (jimple format).
> > 1. E
 ntry point (Stmt)of a sootmethod
> > 2.
> >
> >
> >     I noticed this class:  soot.jimple.toolkits.annotation.logic.Loop.
> > Given a graph( UnitGraph) or a soot method (sootMethod), how to use this
> > class to detect a loop?
> > Is there any sample code available?
> > Thanks very much.
> > < font class="Apple-style-span" face="'Times New Roman'">Best Regards,
> > DingSun
> > ________________________________
> > 更多热辣资讯尽在新版MSN首页! 立刻访问!
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list at sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >
> >
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
 		 	   		  
搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! 立即试用! 		 	   		  
_________________________________________________________________
MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取!
http://kaba.msn.com.cn/?k=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20100506/d1790637/attachment.html 


More information about the Soot-list mailing list