[Soot-list] setEntryPoints and CallGraph

Saswat Anand saswat at cc.gatech.edu
Thu Jul 28 15:11:35 EDT 2005


Hello,

I was trying to cut on the time to build the call graph (-w -p cg.spark
on). So I set the entryPoints (through Scene.v().setEntryPoints()) in
Main.run() to only one method:

Scene.v().getMainClass.getMethod("void main(java.lang.String[] arg"));

Now for a program like the following I printed CallGraph Edges out of each
unit by writing a BodyTransformer. The output is as follows:

public class Test12
{
    public Test12(){}
    public static void main(String[] arg)
    { System.out.println( "hello world" ); }
}

Output:
        this := @this: Test12
        specialinvoke this.<java.lang.Object: void <init>()>()
        return

        arg := @parameter0: java.lang.String[]
        $r0 = <java.lang.System: java.io.PrintStream out>
                CLINIT edge: $r0 = <java.lang.System: java.io.PrintStream
out> in <Test12: void main(java.lang.String[])> ==> <java.lang.System:
void <clinit>()>
                CLINIT edge: $r0 = <java.lang.System: java.io.PrintStream
out> in <Test12: void main(java.lang.String[])> ==> <java.lang.Object:
void <clinit>()>
        virtualinvoke $r0.<java.io.PrintStream: void
println(java.lang.String)>("hello world")
        return

I have two questions about the above output:
1- Why there is no edge out of println stmt? (commenting the above
setEntryPoints hack does produce a edge out of this stmt)
2- Why there is no edge out of Object.<init> stmt? (commenting hack does
not change this).

Could anybody explain to me.

Thanks
Saswat












			-Saswat Anand (saswat at cc.gatech.edu)


More information about the Soot-list mailing list