[Soot-list] Data Flow Graph For Java Applaction

Guru Devanla gdevan2 at uic.edu
Wed Feb 26 22:22:16 EST 2014


I assume in your example, the last statement reads y(a).

Here are some pointers you can use. I do not have the code handy which can
give you your exact solution. But, here is the pseudo code:

//You need to build these structures.
 UnitGraph cfg = new EnhancedUnitGraph(body);
SimpleLocalDefs simpleLocalDefs = new SimpleLocalDefs(cfg);

//Unit u => this is the unit which has your local
// l => is the local which is in the unit u
List units = defs.getDefsOfAt(l, u);



1.  You also need a way to extract "l" out of "u". But, that would depend
upon what you are looking for.
2.  In your example, the return value of getDefsOfAt would be the unit [int
a = x(b,c)]. You need to check the presence of method x in that unit. That
can be done using ((Stmt)u).containsInvokeExpr and ((Stmt)u).getInvokeExpr.

3. Finally, you might have to recurse step 1 and 2 to handle cases such as

int a = x(a,b)
z = a
y(z)



Hope that helps to get you started.

-Guru






















On Wed, Feb 26, 2014 at 3:44 PM, Ibrahim Elgendy <eng.elgendy90 at gmail.com>wrote:

> Hi,
> can the soot tool show the data flow dependency?
>
> *for example*
>
> class Test{
>
> void z(int b,int c){
>
> int a=x(b,c);
>
> y(x);
>
> }
>
> }
>
> if method x return data that put in variable a
> *int a=x(b,c);*
> and method y use this variable x
> *y(x);*
>
> the result show that method y depend on method x (there is data dependency
> between two method)
>
> *if soot tool can do that ,can you help me how i can get this data
> dependency?if no can you help me how to get it?*
>
> Thanks
>
> --
> Ibrahem Elgendy
> Faculty of computers and information
>
> _______________________________________________
> 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/20140226/bc2401d2/attachment.html 


More information about the Soot-list mailing list