[Soot-list] incomplete callgraph

Peng Gao gaop at cse.unsw.edu.au
Tue Jan 23 19:26:38 EST 2007


I have a similar problem here, for example:

public class ClassI{
     public static void main(String[] args) throws Exception{
         BufferedReader in = new BufferedReader(new InputStreamReader 
(System.in));
         String input = in.readLine();
         Class clazz = Class.forName(input);
         Object obj = clazz.newInstance();
     }
}

I am sure I used -W option however I could not find any NEWINSTANCE  
edge in the call graph.


On 23/01/2007, at 8:06 PM, Toth.Gabriella.2 at stud.u-szeged.hu wrote:

> Hi!
> I have this example:
>
> class A{
>   int a;
>   public A(int i){
>     a=i;
>   }
>   public int geta(){
>     return a;
>   }
>   public void seta(int i){
> 	a=i;
>   }
> }
>
> class B{
>   int b;
>   public B(int j){
>       b=j;
>     }
> 	 public int getb(){
>     return b;
>   }
>     void setb(int i){
>       b=i;
>     }
> }
> class C2{
> 	int c;
>   A a=new A(5);
>   static B b=new B(6);
> 	 public C2(int j){
>       c=j;
>     }
>   public int c(){
>
>    return b.getb()+6/a.geta();
>   }
>
>   public static void main(){
>     C2 c = new C2(3);
> 	b.setb(c.c());    <---
>   }
> }
>
>
> ---------------------------------------------
>
> I create callgraph:
>
> 	CallGraphBuilder cgb = new CallGraphBuilder();
> 		cgb.build();
> 		cg = cgb.getCallGraph();
>
> The callgraph:
>
> CLINIT edge: $r1 = <C2: B b> in <C2: int c()> ==>  
> <java.lang.Object: void <clinit>()>
> CLINIT edge: $r0 = <C2: B b> in <C2: void main()> ==>  
> <java.lang.Object: void <clinit>()>
> SPECIAL edge: specialinvoke r0.<java.lang.Object: void <init>()>()  
> in <C2: void <init>()> ==> <java.lang.Object: void <init>()>
> VIRTUAL edge: $i0 = virtualinvoke $r1.<B: int getb()>() in <C2: int  
> c()> ==> <B: int getb()>
> VIRTUAL edge: $i1 = virtualinvoke $r2.<A: int geta()>() in <C2: int  
> c()> ==> <A: int geta()>
> VIRTUAL edge: virtualinvoke $r0.<B: void setb(int)>($i0) in <C2:  
> void main()> ==> <B: void setb(int)>
> SPECIAL edge: specialinvoke r0.<java.lang.Object: void <init>()>()  
> in <A: void <init>(int)> ==> <java.lang.Object: void <init>()>
> SPECIAL edge: specialinvoke r0.<java.lang.Object: void <init>()>()  
> in <B: void <init>(int)> ==> <java.lang.Object: void <init>()>
>
> I don't find edge to c.c(). What should I do? I tried options but  
> the callgraph didn't change.
>
> Thanks
> Gabi
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> 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