[Soot-list] Using soot and heros : Inter procedural Flow Analysis

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Fri Feb 28 11:21:44 EST 2014


Hello Utsav,

I am not going to add anything to what Steven said on Heros.

You asked if there was another way to do interprocedural. You can check 
out Vasco:
https://github.com/rohanpadhye/vasco

I think that the folks at IIT-B are going to keep working on it, but I'm 
not sure.

Regards,

-- 
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 2014-02-27 02:14, Utsav Chokshi wrote:
> Hello Soot-Community,
>
> I am currently using 'heros and soot' combination for interprocedural
> data flow analysis.
> For that,  I am going through 'Reaching Definition' example provided
> under 'soot.jimple.toolkits.ide'
> In that I am unable to manipulate 'FlowFunction' reference returned by
> flowFunctions.NormalFlowFunction
>
> Below is code, I am using for getting NormalFlowFunction between Unit
> and Successor Unit of single method. [ also I have written my
> difficulties in comments.]
>
> See the code, if you find my approach for getting reaching definition
> wrong then tell me.
> If any one have good document over this thing, then do provide me. [ I
> already read paper published by Erric Bodden on this.]
> I am aiming to use IFDS framework for performing Intraprocedural
> Analysis (normal flow function is for that ,right?) as well as
> Interprocedural Flow analysis (other threee flow functions).
>
> [Note : I am using nightly build version [ 24th Feb, 2014] of soot]
>
> And lastly, is there any other way of doing inter procedural data flow
> analysis (using soot).
>
> Thanks in advance for reading this much.
>
> *Code written under SceneTransformer :*
>
> SootMethod mainMethod=mainClass.getMethod(
>
> "void main(java.lang.String[])");
>
> JimpleBasedInterproceduralCFG icfg=
> *new* JimpleBasedInterproceduralCFG();
>
> IFDSReachingDefinitions reachingDefs=
> *new* IFDSReachingDefinitions(icfg);
>
> reachingDefs.computeValues();
>
> Set<SootMethod> calledMethodSet=
> *new* HashSet<SootMethod>();
>
> calledMethodSet.add(mainMethod);
>
> *for*(Unit unit, icfg.getCallsFromWithin(mainMethod)){
>
> InvokeExpr expr=((Stmt)unit).getInvokeExpr();
>
> * if*(!expr.getMethod().isJavaLibraryMethod()){
>
> calledMethodSet.add(expr.getMethod());
> }
>
> }
>
> UnitGraph unitGraph;
>
> FlowFunction<Pair<Value, Set<DefinitionStmt>>> flowFunction;
>
> *for*
>
> (SootMethod sootMethod : calledMethodSet){
>
> System./out/.println("Currently in : " + sootMethod.toString());
>
> jimpleBody=(JimpleBody) sootMethod.getActiveBody();
>
> unitGraph=
>
> *new* BriefUnitGraph(jimpleBody);
>
> *for*(Unit unit : jimpleBody.getUnits()){
>
> System./out/.println(" Current unit : " + unit.toString());
>
> *if*((Stmt)unit *instanceof* DefinitionStmt){
>
> *for*(Unit succUnit : unitGraph.getSuccsOf(unit)){
>
>   flowFunction
> = reachingDefs.flowFunctions().getNormalFlowFunction(unit, succUnit);
>   // Now what to do with this refrence 'flowFunction'
>   // Only method it provides is 'computevalues()' which requires source
> as argument
>
>   // So what should be that argument ?
>   // I have tried providing an arg : left operand of definition stmt and
> definition set, but it is returning empty set
>   // And What is puropse of having 'succ unit' as second argument in
> 'NormalFlowFunction' ?
>
>     }
>
> }
>
> }
>
> }
>
> - Utsav Chokshi
> [ Intern ,TCS Innovation Labs , Pune, India]
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>




More information about the Soot-list mailing list