[Soot-list] ContextInsensitiveBuilder
Saswat Anand
saswat at cc.gatech.edu
Fri Dec 23 19:35:43 EST 2005
Hello,
I want to slightly change the on-fly callgraph building. But before I
start tweaking I was trying to understand the complex (though nicely
done) machinery. I am puzzled by the build method of
ContextInsensitiveBuilder class, which looks as follows.
In case when on_fly_callgraph option is set, is it necessary to process
the call targets (i.e., pag.addCallTarget(e) stmt). ofcg.build() already
does that. Also I dont understand why we need to handleClass(c) for all
classes in the Scene when on_fly_callgraph option is set.
I would appreciate if anybody familiar with this could explain.
Thanks,
Saswat
/** Fills in the pointer assignment graph returned by setup. */
public void build() {
QueueReader callEdges;
if( ofcg != null ) {
callEdges = ofcg.callGraph().listener();
ofcg.build();
reachables = ofcg.reachableMethods();
reachables.update();
} else {
callEdges = cgb.getCallGraph().listener();
cgb.build();
reachables = cgb.reachables();
}
for( Iterator cIt = Scene.v().getClasses().iterator();
cIt.hasNext(); ) {
final SootClass c = (SootClass) cIt.next();
handleClass( c );
}
Stmt s = null;
while(callEdges.hasNext()) {
Edge e = (Edge) callEdges.next();
MethodPAG.v( pag, e.tgt() ).addToPAG(null);
pag.addCallTarget( e );
}
if( pag.getOpts().verbose() ) {
G.v().out.println( "Total methods: "+totalMethods );
G.v().out.println( "Initially reachable methods:
"+analyzedMethods );
G.v().out.println( "Classes with at least one reachable
method: "+classes );
}
}
More information about the Soot-list
mailing list