[Soot-list] setEntryPoints and CallGraph

Ondrej Lhotak olhotak at sable.mcgill.ca
Tue Aug 2 11:13:54 EDT 2005


On Fri, Jul 29, 2005 at 12:36:47PM -0500, Saswat Anand wrote:
> 
> Thanks a lot, Ondrej for the explanation. Since I guess this might a 
> topic of interest to many people I want to ask what is the approved way 
> to build a call graph with customized entry points, and still not get 
> into the problems as you described below. For example, is it sufficient 
> to add java.lang.System: void initializeSystemClass() as one of the 
> entrypoints.

The class soot.EntryPoints contains various methods that return the
default lists of entry points. In particular, implicit() returns
the entry points implicitly invoked by the VM, application() returns
the entry points of the application (the main method of the main class,
the static initializers of the main class and all its superclasses),
and all() returns the entry points from both implicit() and application().
The recommended way to customize the entry points is to call these
methods to get an initial list of entry points, then change it,
then call Scene.setEntryPoints() with your new list. In particular,
you will want to inlcude the entry points from the implicit() list
to avoid the problem you described.

Ondrej

> 
> Thanks
> Saswat
> 
> 
> > The field System.out starts out null. It is initialized to something
> > non-null by the entry point
> > java.lang.System: void initializeSystemClass()
> > which you have removed. So, the points-to analysis finds that $r0 can
> > only be null, and invoking println on null will not invoke any method.
> 
> 
> 


More information about the Soot-list mailing list