[prev in list] [next in list] [prev in thread] [next in thread] 

List:       soot-list
Subject:    Re: [Soot-list] Should CFG be used for transformation
From:       "Bodden, Eric" <eric.bodden () sit ! fraunhofer ! de>
Date:       2013-11-05 16:16:04
Message-ID: 92EC47B5-8668-49D2-9395-4C8B9B5A8A51 () sit ! fraunhofer ! de
[Download RAW message or body]

Hello Khanh.

The only advantage that a CFG gives you is that your analysis can see the c=
ontrol-flow easier. You can easily ask a statement for its control-flow pre=
decessors, even if some of those come textually later in the code (due to b=
ack-jumps). This is something you cannot do in a single-pass straight-line =
scan. Hence you have to decide whether you can implement your transformatio=
n correctly without such information. What happens if a statement jumps to =
a statement you transformed?

Creating a CFG comes at a cost but it's not hard to use. It's simply anothe=
r view on the same Jimple body.

Cheers,
Eric

On 30.10.2013, at 21:36, Khanh Nguyen <khanhtn1@uci.edu> wrote:

> Marc-Andr=E9, thanks for your reply.
> In my work, given a class A - I want to generate another class called new=
A that preserves the semantics of A. One statement in A may require multipl=
e statements in newA to achieve the same effect.
> The transformation from A to newA can be done in flow-insensitive manner.=
 If you have statements 1-2-3 in A, newA would have 1'-2'-2''-3'. Even the =
tranformation of an if statement is quite simple since we know the target s=
tmt (for the else branch)
> I simply cant think of any example that the transformation would need to =
be done in flow-sensitive manner
> =

> =

> =

> Thank you,
> =

> Khanh Nguyen
> =

> =

> On Wed, Oct 30, 2013 at 7:34 AM, Marc-Andr=E9 Laverdi=E8re <marc-andre.la=
verdiere-papineau@polymtl.ca> wrote:
> Hello,
> =

> The answer, as with everything in software engineering, is "it depends".
> =

> I am doing plenty of stuff in a flow insensitive manner. That makes
> sense when you only need the information from that Stmt object and
> nothing else. This is what I'd call 'structural changes' - but I am not
> sure this is proper terminology.
> =

> Flow insensitive analyses are quick and often crude. That may be good
> enough for what you need to do.
> =

> If you want to do flow sensitive, you're obviously going to increase
> your precision, but it is not as simple. Sometimes you need to loop
> until a fixed point is reached - this is not as fast.
> =

> So the real question is: what is it that you are trying to do?
> =

> Marc-Andr=E9 Laverdi=E8re-Papineau
> Doctorant - PhD Candidate
> =

> On 10/28/2013 03:15 PM, Khanh Nguyen wrote:
> > Dear All,
> >
> > I have a transformation that operates on Jimple. Up to now, in my
> > transformation, I consider the method body as straight line of codes.
> > Thus, I just loop thru the units in the body in top-down manner and
> > perform my transformation accordingly. The result is the new class.
> >
> > However, I'm concerned whether doing this would create problems (what
> > problems, I dont know) A suggestion to me was to use the CFG instead.
> > I.e., get the original CFG, clone it (to preserve the same flow
> > structure) then going inside each basic block and still perform the
> > transformation on each unit in the basic block, the transformed units
> > will be put in the correspondent basic block in the clone version.
> >
> > Obviously, the latter method involves serious interference with soot
> > since UnitGraph doesnt offer methods to do what I need.
> > So soot experts, do you think CFG is needed? I do not believe CFG is
> > needed (but again, I'm new with soot, I dont know what kind of problems
> > could arise by doing straight-line transformation)
> > Furthermore, CFG requires a body to work on, if I just clone the CFG and
> > then change the statements in the CFG, isnt it the same as considering
> > the body as straight line of codes?
> >
> > Thank you,
> >
> > Khanh Nguyen
> > UC Irvine
> >
> >
> > _______________________________________________
> > Soot-list mailing list
> > Soot-list@sable.mcgill.ca
> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> >
> _______________________________________________
> Soot-list mailing list
> Soot-list@sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> =

> _______________________________________________
> Soot-list mailing list
> Soot-list@sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC=
 SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

_______________________________________________
Soot-list mailing list
Soot-list@sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic