[Soot-list] incomplete callgraph
Eric Bodden
eric.bodden at mail.mcgill.ca
Tue Jan 23 10:23:06 EST 2007
I am not sure what's going wrong in your case, but I would suggest to
build call graphs in another way. Just enable the -W command line option
and then invoke Scene.v().getCallGraph() after the cg phase has
finished.
Eric
> -----Original Message-----
> From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-
> bounces at sable.mcgill.ca] On Behalf Of
Toth.Gabriella.2 at stud.u-szeged.hu
> Sent: Tuesday, January 23, 2007 4:06 AM
> To: soot-list at sable.mcgill.ca
> Subject: [Soot-list] incomplete callgraph
>
> 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