[Soot-list] symbolic evaluation using soot

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Sun Sep 19 07:02:16 EDT 2010


Hi.

In Soot, toString() returns an informative representation meant for
debugging purposes, nothing else. It is therefore never a good idea to
use toString() for anything else.

What you should do instead is define a proper flow-through function
that treats every possible statement and expression in the correct
way. The classes StmtSwitch and ExprSwitch should help with this. They
implement the visitor pattern.

Eric

--
Dr. Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



2010/9/18 dingsun <xyz031702 at hotmail.com>:
> Dear Sir
>       I'm using soot(directly use the soot API of the jimple package ) to
> perform some symbolic evaluation and encountering some problems.
>
> For example, I have jimple code :
> 1. x= paramter0;
> 2. y= x+1;
> 3. z= function1();
> 4. a= x+y+z;
> I analyze the Value of each variable at each state,  and use the
> "setValue()" API to substitute the value.
> By doing so,  I will call value.toString() to obtain the "a" in a symbolic
> String form of "parameter0+ parameter0+1+ function1()".
> This works fine for simple case. But dealing with complex real codes, the
> operation of "toString()" will fall into a deap loop of recursive function
> call. I trace in and find the situation is caused like following:
> Local a= b+ 2;
> b= a+3;
> a.toString() --> b.toString () +"2" --> a.toStrin g()+"3"+
> "2"--->..................
>
> Is there anything I can do to avoid this ? What I currently did is to use a
> try {} catch(StackOverflow e){}   block to catch the deap loop and stop the
> toString() operation
> Best Regards,
> Ding Sun
>
>
>
> _______________________________________________
> 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