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

Re: Problem with PAG default options



It sounds like you are not building the PAG and propagating it. See
the method internalTransform in SparkTransformer for details. In fact,
you may want to just call this method, rather than rewriting it
yourself.

There's a more fundamental problem that you'll need to think about.
In order to build a call graph, you need points-to information to
resolve virtual calls. But, in order to do a non-trivial points-to
analysis, you need a call graph to specify interprocedural pointer flow.
There are two ways to resolve this interdependence in Soot. One way is
to first build a call graph using CHA (which is done by passing a
DumbPointerAnalysis into the call graph builder), use that to compute
points-to information, and then giving that call graph to Spark to
compute points-to information, and then building the final call graph
using the points-to information generated by Spark. The other option is
to build the call graph and points-to information simultaneously, which
is what Spark does with the on-the-fly option. So, you need to decide
which option is right for your application, and then implement it based
on the code in SparkTransformer.

Ondrej

On Sun, Aug 10, 2003 at 06:46:00PM +0100, Eric Bodden wrote:
> Hi!
> 
> Today I tried to create a callgraph holding only edges between application
> classes. The sourcecode is approximately as follows:
> 
> --
> //Scene prepared so far
> Scene.v().loadNecessaryClasses();
> 
> [get some entry points]
> 
> Scene.v().setEntryPoints(entryPoints);
> 
> Transform sparkTranform = new Transform( "cg.spark", null );
> PhaseOptions.v().setPhaseOption( sparkTranform, "rta:true" );
> PhaseOptions.v().setPhaseOption( "cg", "verbose:true" );
> PhaseOptions.v().setPhaseOption( "cg", "all-reachable:true" );
> 
> Map options = PhaseOptions.v().getPhaseOptions( sparkTranform );
> PointsToAnalysis spark = new PAG( new SparkOptions( options ) );
> 
> //set aspecific main class (just for testing)
> Scene.v().setMainClass(Scene.v().getSootClass("pkg.Main"));
> 
> new CallGraphBuilder().build();
> --
> 
> This works fine, so far, except, that I am still getting warnings about the
> incompleteness of the graph, because I am invoking CallGraphBuilder().using
> the default constructor.
> So I tried to use a "real" call graph builder by replacing the last line
> with: (CallGraphBuilder being a special version with appOnly==true
> hardwired)
> 
> CallGraphBuilder(spark).build();
> 
> This leads now - for me surprisingly - to a graph without any edges. I could
> track down the problem so far, that PAG.findVarNode( Object value ) always
> returns null because apparently for some reason localToNodeMap is empty.
> 
> So do you have any idea, what could go wrong?
> 
> Thank you very much,
> 
> Eric
> 
>