[Soot-list] Soot method transformation

Jeff Huang jeffwalt630 at gmail.com
Wed Aug 24 11:52:05 EDT 2011


Thanks for your always quick response, Eric!

By this transformation, I want to do some shared variable privatization. For
example, here 'o' is a shared variable, while 'o1' is a local
variable. Either transforming an old method or making a fresh one is fine to
me. The key thing is that I have to correctly handle to control flow.

An easy way to do this is to directly operate the basic blocks in the CFG.
Since Soot does not support it, I will proceed at the statement-level (just
as what you suggested, inserting/removing/updating statements in the
JimpleBody is surely doable).

Many thanks,
Jeff

On Wed, Aug 24, 2011 at 10:52 PM, Eric Bodden <
bodden at st.informatik.tu-darmstadt.de> wrote:

> Hi Jeff.
>
> > m1()
> > {
> >    if(o==null)
> >    {
> >       o=new MyObject();
> >    }
> >    o.f();
> > }
> > m2()
> > {
> >     o1=o;
> >     if(o1==null)
> >     {
> >        o=new MyObject();
> >        o.f();
> >     }
> >    else
> >    {
> >        o1.f();
> >    }
> > }
>
> I am sorry but I think I am missing the point of this transformation.
> Could you elaborate? In "o1=o" the value "o" is undefined.
>
> Also, I am not sure whether you want to transform a method (updating
> its code) or generate a new fresh method in addition to the old
> method.
>
> > 1. Does Soot support CFG manipulation, e.g., block&edge insert, delete,
> > clone? If not, is there any easy way to achieve that?
> Soot does not support manipulation in the CFG itself - the CFG is just
> a view on a body of code. There is elaborate support, though, for
> updating code within a JimpleBody (basically
> inserting/removing/updating statements in a list of statements).
>
> > 2. Is it be possible to make a Soot Body from a CFG?
>
> No. It's always done the other way around. But usually, that's not a
> problem.
>
> Eric
> --
> Dr. Eric Bodden, http://bodden.de/
> Principal Investigator in Secure Services at CASED
> Coordinator of the CASED Advisory Board of Study Affairs
> PostDoc at Software Technology Group, Technische Universität Darmstadt
> Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
> Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110824/de0124e2/attachment.html 


More information about the Soot-list mailing list