[Soot-list] Use the results from a previous run

Cheng Zhang cheng.zhang.stap at gmail.com
Tue Apr 12 14:26:25 EDT 2011


Hi, Eric,

I found that the second run may be unnecessary in my case,
since the slicing-like analysis only requires active bodies
of methods and the call graph. I should be able to do it using
just one SceneTransformer and then do the instrumentation
in a BodyTransformer.

My previous usage of Soot was somewhat weird, because,
due to my limited understanding of Soot's architecture,
I thought active bodies are available only when Soot has
reached jtp pack...

Thank you for your suggestion.

Best,

Cheng

On Tue, Apr 12, 2011 at 3:02 PM, Eric Bodden
<bodden at st.informatik.tu-darmstadt.de> wrote:
> Hi Cheng.
>
> I wonder whether you need to reset the Scene at all. Why not just keep
> the slicing results in memory and continue from there?
>
> Eric
>
> On 11 April 2011 18:58, Cheng Zhang <cheng.zhang.stap at gmail.com> wrote:
>> Hi,
>>
>> I'm using Soot in two steps:
>> 1) do an inter-procedural analysis that is similar to program slicing.
>> 2) use the results of the analysis to select some program points to
>> insert printing statements.
>>
>> Currently I use a SceneTransformer and a BodyTransformer in Step 1 and
>> use another BodyTransformer
>> in Step 2. Between the two steps, I reset Soot using G.v().reset().
>> The code looks like:
>>
>> ...
>> wtpPack.add(new Transfom("wjtp.getcg", new MySceneTransformer()));
>> jtpPack.add(new Transform("jtp.datadep", new MyBodyTransformer()));
>> soot.Main.main(args);
>>
>> // do some slicing-like analysis based on data produced in previous
>> transformations
>> // and store the results in a global data structure.
>>
>> G.v().reset();
>> ...
>> jtpPack.add(new Transform("jtp.instrument", new AnotherBodyTransformer()));
>> soot.Main.main(args2);
>> ...
>>
>> Unfortunately I cannot find a good way to use the results from the
>> previous run in the second run.
>> Because the Units are different (i.e., u1.equals(u2) is false) between
>> two runs, even if they represent the same program point.
>> Another problem is about values. When I attempt to insert a statement
>> using a Local (generated in the previous run), Soot throws
>> an exception complaining that this Local is not contained in the body
>> (generated in the second run) when generating output files.
>>
>> Now I am using the String representation and line numbers to match
>> units from different runs, and using the name and type to match
>> values.
>> I am wondering whether there is a better way to use the results from
>> the previous run.
>> Thank you.
>>
>> Best,
>>
>> Cheng
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>
>
>
> --
> 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
>


More information about the Soot-list mailing list