[Soot-list] about the cg.all-reachable option

Ondrej Lhotak olhotak at uwaterloo.ca
Mon Jan 28 09:49:45 EST 2008


The all-reachable option makes Soot consider all methods as possibly
entry points, but it does not make it assume that every pointer could
point to an object of any type (that is consistent with the declared
type of the pointer). This assumption is made by Class Hierarchy
Analysis, which is enabled by default in Soot as long as you do not
enable Spark or Paddle.

In your example, no actual object is ever assigned to the this parameter
of actionPerformed. The target of a non-static call depends on the
actual type of the receiver. Thus, if no object has been assigned to
this, the call to this.methodW does not resolve to any actual method.

Ondrej

On Mon, Jan 21, 2008 at 11:45:37PM -0800, Peng Li wrote:
> HI
> I am using spark to build a callgraph for a Java Swing program(GUI).
> However, I found the callgraph eliminate all the actionPerformed()
> methods in the GUI program. So, I just turned on the all-reachable
> option under the cg phase by using the following line,
> soot.options.Options.v().setPhaseOption("cg", "all-reachable:true");
> 
> And then, I did some test on a very simple test case as following,
> 
> public void actionPerformed(ActionEvent event)//
> {
>          methodT();
>          t1 tt = new t1(); // t1 is a class
>          methodW();
>      }
> private static void methodT() {}
> private void methodW() {}
> 
> Next,  when i used callgraph.edgesOutOf(actionPerformed) to get all
> the edges which use actionPerformed() as source. I  found the edges
> actionPerformed()->methodT() and actionPerformed()->t1(). However,
> there is no the edge actionPerformed()-> methodW()!
> 
> I am wondering if there is some options I did not turn on? Can anyone
> give me some suggestion?
> 
> 
> Thank you very much for your help and looking forward to hearing you.
> 
> Cheers
> Peng
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list