[Soot-list] extracing actual value from local variable

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Jun 8 03:14:26 EDT 2010


Hi Paris.

A value is a runtime thing. At compile time, a variable has no value.
But you can walk through different assignments to i1. Then,
immediately after an assignment you know that i1 has to have the
assigned value *at this position*. If the assigned value is a
constant, then in Soot you can just cast it to this constant (e.g. an
IntConstant) and retrieve its value from there.

Constant propagation may help you to find more constants than usual.

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



On 7 June 2010 18:12, Paris Yiapanis <yiapanip at cs.man.ac.uk> wrote:
> Hi,
>
> How can I extract the actual value of a local variable in Jimple?
>
> For instance I have:
>
> if i1 < 5
>
> and I want to extract the value of local variable i1.
>
> Thank you in advance,
>
> Paris
>
> _______________________________________________
> 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