[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spark analysis of an unreachable method



On Tue, Feb 24, 2004 at 04:30:53PM -0600, Algis Rudys wrote:
> Greetings --
> 
> In a (application) class I'm analyzing (which has several accessed
> methods), there are several methods which are never called, but over
> which I'd still like Spark pointer analysis done (these methods take no
> parameters (with the exception of this), so parameters should not be an
> issue); I've set cg's all-reachable option to true, to no avail. 
> 
> Is there a way (either through options or through coding) to force Soot
> to Spark-ify these methods (I haven't yet gone through the Spark code;
> that's my next step)?

A sure-fire way to force Soot to consider specific methods reachable is
to add them to the entry points in the Scene. Before Spark runs, do:

Scene.v().getEntryPoints().add( mySootMethod );

(where mySootMethod is the method you want to be sure gets analyzed)

It's strange that the all-reachable option doesn't work for you, however, since
this is exactly what it should do. If you've got a debugger (or you can
just add println's), have a look at what happens in the CallGraphBuilder
constructor. Notice the "if( options.all_reachable() )", and within it,
    entryPoints.addAll( EntryPoints.v().methodsOfApplicationClasses() );
That should add them. Can you see what methodsOfApplicationClasses()
returns, and what entryPoints contains after they've been added?

Ondrej

> 
> Thanks,
> Algis R.
> 
> -- 
>          Algis Rudys        Rice University
>      arudys@rice.edu        Computer Science
> "Heart has nothing to do with it anymore. It's all in the caffeine."
>  -- Frank Pembleton, _Homicide_
>