soot-oss / soot

Soot - A Java optimization framework
GNU Lesser General Public License v2.1
2.89k stars 708 forks source link

How can I use VTA and normal context-insensitve points-to analysis (e.g. Andersen Algorithm) #1247

Open SeanCoek opened 4 years ago

SeanCoek commented 4 years ago

I want to use vta and normal context-insensitive points-to analysis algorithm to generate call graph. I am looking in the source code of Spark and there are some code I got confuse. if (opts.on_fly_cg() && !opts.vta()) { this.ofcg = new OnFlyCallGraph(this.pag, opts.apponly()); this.pag.setOnFlyCallGraph(this.ofcg); } else { this.cgb = new CallGraphBuilder(DumbPointerAnalysis.v()); } I want to know what is this 'DumbPointerAnalysis' represents?

ericbodden commented 4 years ago

Hi.

As the documentation (https://soot-build.cs.uni-paderborn.de/public/origin/master/soot/soot-master/3.3.0/options/soot_options.htm) states:

"Setting VTA to true has the effect of setting field-based, types-for-sites, and simplify-sccs to true, and on-fly-cg to false, to simulate Variable Type Analysis, described in our OOPSLA 2000 paper. Note that the algorithm differs from the original VTA in that it handles array elements more precisely.”

A DumbPointerAnalysis is one that tells that every variable could point to every object. VTA uses this because it is field-based and as such does not really need a full, allocation-site-based pointer analysis. Obviously, such a pointer analysis should never be used to resolve aliasing.

Does that answer your question?

Eric

On 8. Dec 2019, at 15:54, Sean Coek notifications@github.com wrote:

I want to use vta and normal context-insensitive points-to analysis algorithm to generate call graph. I am looking in the source code of Spark and there are some code I got confuse. if (opts.on_fly_cg() && !opts.vta()) { this.ofcg = new OnFlyCallGraph(this.pag, opts.apponly()); this.pag.setOnFlyCallGraph(this.ofcg); } else { this.cgb = new CallGraphBuilder(DumbPointerAnalysis.v()); } I want to know what is this 'DumbPointerAnalysis' represents? And if I want to use vta, I have to turn the option 'on_fly_cg" on? Right?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

SeanCoek commented 4 years ago

Thanks a lot. I still have one question about VTA. Is it possible to get the resolved types of a variable? (using VTA).