[Soot-list] Scripting with soot

Mihir Mehta mihir.cs.iitd at gmail.com
Tue Nov 25 13:35:09 EST 2014


There is no way for me to iterate through the method Bodys. I need to 
call soot.Main.main at the end of my class, which I believe is the 
standard. Once I do that, soot takes over and eventually calls 
internalTransform on each of the Bodys. I have a work-around in mind, 
but it's somewhat kludgy: I store all the relevant method names and the 
relevant assertions in a static data structure, and in the 
internalTransform method, I check the current Body against this static 
data structure and check assertions if any. You can see how storing 
assertions in a data structure is messy in a language such as java, 
which doesn't allow me to simply store functions as first-class values. 
This is why I'm wondering if there's a way for me to iterate through the 
method Bodys, which feels like a cleaner solution.

Mihir.

On 11/25/14 12:22, Patrick Lam wrote:
> Hi Mihir,
>
> It would be great to have an assertion-based test infrastructure for 
> Soot and sharing that with the community would be awesome.
>
> I'm not sure why you can't do the obvious thing. Can you not just run 
> the BodyTransformer on all Bodys and filter out the ones that aren't 
> relevant?
>
> pat
>
> On 25/11/14 12:56 PM, Mihir Mehta wrote:
>> Hi,
>>
>> I'm working on a data flow analysis using soot, following these
>> steps(http://www.bodden.de/2008/09/22/soot-intra/). I'd like to set up a
>> regression test suite, which would look something like a number of
>> source code files (classes, in .java files) and some assertions on the
>> result of the flow analysis on some methods in each of these classes.
>> However, because of the way soot seems to be structured, I'm not able to
>> figure out how to make a harness that runs my analysis on each of these
>> classes in turn and checks the assertions - because I can only see the
>> Body corresponding to a method in the internalTransform method of my
>> BodyTransformer instance, which means I cannot do the obvious thing,
>> i.e. search for all the relevant methods in all the different class
>> files, run the analysis on each method's Body, and print whether the
>> assertion passed.
>>
>> Can anyone suggest a work-around?
>>
>> Thanks,
>> Mihir Mehta,
>> Doctoral student,
>> UT Austin.
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at CS.McGill.CA
>> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>>
>



More information about the Soot-list mailing list