[Soot-list] How to use Spark to analze DaCapo benchmark on Eclipse

Zhoulai zell08v at orange.fr
Tue Jun 4 16:37:04 EDT 2013


 Hi,

Basically, there are at least two approaches to launch soot from your java
codes.

 1. The hard way starts by loading class manually, and then set the options
using the facilities in soot.Options, soot.SparkOptions etc.

2. The gentle way specifies everything in your soot options (of type
String[] ) and launch SOOT using soot.main.Main($soot_options)

I guess you have been trying with  #1. Below we go with #2:

Suppose your have a jar fiile, named a.jar, located at the path home/p",
and the main class in the .jar has its fully qualified name b.c.Main.class,
then you specify the options like this

String[] args= new String[]{
"-w",
"-p","cg.spark","on",
"cp","home/p/a.jar","-pp",
 b.c.Main
};
soot.Main.main(args);

Hope it helps..

Zhoulai


On Tue, Jun 4, 2013 at 8:52 AM, 王一 <i3.wangyi at gmail.com> wrote:

> Thanks Zhoulai,
>           Could you give me a further explanations? I still get a confused
> by the way of running soot on eclipse.
>           Here's my way of running Soot (exactly Spark )on Eclipse:
>           Like PointsToAnalysis.java in surviveguideexample, my main
> function goes like this:
>           public static void main(String[] args) {
> // Pointsto.loadClass("Container", false);
>  // Pointsto.loadClass("Item", false);
>
> SootClass sc = Pointsto.loadClass("JLex.Main", true);//*.java source code
> name
>
> java.util.List list = new java.util.ArrayList();
> list.add(sc.getMethodByName("main"));
>  soot.Scene.v().setEntryPoints(list);
>
> soot.Scene.v().loadNecessaryClasses();
>
> Pointsto.setSparkPointsToAnalysis();
>
> }
>         And I didn't compile and run the whole soot projects since it
> contains some bugs. I just put some important java file into my projects
> and configure the build path correctly.
>         Now I'm confused of your saying, as to I know, it's better to
> modify the soot.main file, and I don't know how to specify input formats of
> jar package, for instance, Dacapo.jar. Thank you very much for your help!
> ------------------------
> String[] sootArgs[]new String[]{
>         //specify your classpath and input format etc here
> }
>
> soot.main.Main(sootArgs);
>
> ----------------------
>
>
> 2013/6/4 Zhoulai <zell08v at orange.fr>
>
>> Hi, Soot can analyze bytecoes, not necessarily source code. See its
>> command-line options. So you specify your input format and classpath in
>> your soot arguments, and run soot.Main.main(sootArgs) from within Eclipse.
>> Here is the layout of your codes
>>
>>
>> ------------------------
>> String[] sootArgs[]new String[]{
>>         //specify your classpath and input format etc here
>> }
>>
>> soot.main.Main(sootArgs);
>>
>> ----------------------
>>
>> Hope it helps.
>> Zhoulai
>>
>>
>>
>>
>> On Tue, Jun 4, 2013 at 5:07 AM, 王一 <i3.wangyi at gmail.com> wrote:
>>
>>>
>>> Hi,
>>>    I've modified the work-list propagate algorithm to analyze the
>>> points-to analysis implemented by Spark. And now I need some benchmarks to
>>> compare the efficiency and accuracy of my algorithm with original work-list
>>> algorithm. However, on Eclipse, It needs precise source code to analyze
>>> with, Dacapo didn't provide the original source code but a jar package.
>>>     How should I put the jar into Eclipse so that I can analyze some of
>>> programs. I already have known the TamiFlex method of using Dacapo,
>>> however, it's limited to command-line procedure.
>>> Maybe I didn't clarify my problems clearly, if there's any question
>>> left, let me know.
>>>     Thanks!
>>>
>>> --
>>> 祝好!
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
> --
> 祝好!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130604/2beecb26/attachment-0001.html 


More information about the Soot-list mailing list