[Soot-list] use Soot to extend our analysis

Keith Lea keith at cs.oswego.edu
Mon May 23 11:38:39 EDT 2005


My project Nully uses a slightly modified version of Soot. You can  
see how it loads Soot here:

https://nully.dev.java.net/source/browse/nully/code/idea-plugin/src/ 
net/kano/nully/analysis/nulls/CodeAnalyzer.java?rev=1.3&view=markup

You should look at prepareSootClasses() and loadSootClasses().

On May 23, 2005, at 11:24 AM, Kyle Lahnakoski wrote:

> I am very interested in using Soot as a library, unfortunately I have
> not had the time to separate the core compiler and optimizer from the
> rest of the code. I am *not* interested in the parser, and I expect to
> use some sort of intermediate representation (Shimple?) to work with
> this core.
>
> Is there high level documentation that describes the various packages
> and their general responsibility and use in the great scheme of Soot?
>
> If not, are there other open source programs that use the Soot
> compiler/optimizer as an API? I am hoping that their hooks into Soot
> provide the information I am looking for, albeit indirectly.
>
> Thanks for you time.
>
>
> Keith Lea wrote:
>
>
>> I thought I should reply with details to back up what I said about  
>> Soot
>> having problems as an application library, instead of apparently  
>> blindly
>> criticizing it.
>>
>> My application uses Soot as a library. It's is an IDE plug-in (for
>> IntelliJ IDEA) which uses Soot to analyze source code in real time  
>> while
>> the user is typing. I had (and have) a few problems developing  
>> with Soot:
>>
>> 1. Memory problems
>> To use Soot, I had to spend a few days profiling to find all of the
>> memory leaks. I then had to modify Soot source itself in several  
>> places
>> to prevent some memory leaks which are otherwise inherent in its  
>> design.
>>
>> I've been told that there's a G.reset() method which resets all of  
>> Soot
>> and throws away all state. I haven't tried using it, but I suspect it
>> has performance problems compared to my approach of only releasing
>> memory which is unnecessary, rather than re-initializing all of  
>> Soot. It
>> might not, however; you should try it.
>>
>> 2. Multithreading issues
>> You simply can't use Soot from multiple threads at once. A huge
>> modification of Soot would be necessary to change this. Your  
>> application
>> should probably have a "Soot thread" whose job is to run Soot tasks
>> which are enqueued by other parts of your application, and to return
>> results to those threads using listeners.
>>
>> These two problems are the major problems I've had. I suggest  
>> using Soot
>> in your application but you should be prepared to spend time working
>> around these two issues.
>>
>> -Keith
>>
>>
>>
> ----------------------------------------------------------------------
> Kyle Lahnakoski                                       kyle at arcavia.com
> (416) 892-7784                                    Arcavia Software Ltd
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at cs.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



More information about the Soot-list mailing list