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

62 views
Skip to first unread message

王一

unread,
Jun 3, 2013, 11:07:41 PM6/3/13
to soot...@sable.mcgill.ca

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! 

--
祝好!

Zhoulai

unread,
Jun 4, 2013, 2:10:22 AM6/4/13
to 王一, Soot List
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




_______________________________________________
Soot-list mailing list
Soot...@sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list






Marc-André Laverdière-Papineau

unread,
Jun 4, 2013, 2:40:51 PM6/4/13
to soot...@sable.mcgill.ca
Adding to what Zhoulai said, I am wondering why you modified the
worklist propagation... is it to do an intraprocedural analysis???

If so, it would be cool if you shared your code when its stable. I think
it could be useful to do comparative analyses.

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

Zhoulai

unread,
Jun 4, 2013, 4:37:04 PM6/4/13
to Soot List
 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.w...@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 <zel...@orange.fr>



--
祝好!




Reply all
Reply to author
Forward
0 new messages