[Soot-list] setEntryPoints and CallGraph
Ondrej Lhotak
olhotak at sable.mcgill.ca
Fri Jul 29 12:10:53 EDT 2005
On Thu, Jul 28, 2005 at 03:11:35PM -0400, Saswat Anand wrote:
> 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)
The field System.out starts out null. It is initialized to something
non-null by the entry point
java.lang.System: void initializeSystemClass()
which you have removed. So, the points-to analysis finds that $r0 can
only be null, and invoking println on null will not invoke any method.
> 2- Why there is no edge out of Object.<init> stmt? (commenting hack does
> not change this).
The Test12 constructor (in which the call occurs) is unreachable in the
call graph, so no call edges are constructed for it.
Ondrej
>
> Could anybody explain to me.
>
> Thanks
> Saswat
>
>
>
>
>
>
>
>
>
>
>
>
> -Saswat Anand (saswat at cc.gatech.edu)
> _______________________________________________
> 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