[Soot-list] Incomplete exceptional graph

Octav Chipara ochipara at gmail.com
Sat Apr 18 23:15:44 EDT 2015


Hi guys,

I ran into a problem with exceptional graph not including all the 
information in a method's body. The method's body was printed with:

=== code to print the original method body ===
PatchingChain<Unit> unitBoxes = method.retrieveActiveBody().getUnits();
Iterator<Unit> iter = unitBoxes.iterator();
while (iter.hasNext()) { System.out.println("----> " +  iter.next()); }  

To obtain the following instructions:
----> $r0 := @this: uiowa.edu.tempustests.MainActivity
----> $r1 = new java.lang.Object
----> specialinvoke $r1.<java.lang.Object: void <init>()>()
----> staticinvoke <edu.ucsd.ape.Deadline: void 
deadline(int,java.lang.Object,int)>(10, $r1, 0)
----> specialinvoke $r0.<uiowa.edu.tempustests.MainActivity: void 
test6_foo()>()
----> $r2 = <java.lang.System: java.io.PrintStream out>
----> virtualinvoke $r2.<java.io.PrintStream: void 
println(java.lang.Object)>($r1)
----> return

I build the call graph and printout the graph using the following snippet:

=== build the exceptional graph ===
ExceptionalUnitGraph exceptionGraph = new ExceptionalUnitGraph(body);
Iterator<Unit> iter = exceptionGraph.iterator();
while(iter.hasNext()) System.out.println("graph " + iter.next());

The exceptional graph includes the following:
graph $r0 := @this: uiowa.edu.tempustests.MainActivity
graph $d0 = staticinvoke <java.lang.Math: double random()>()
graph $b0 = $d0 cmpl 5.0
graph if $b0 <= 0 goto return
graph $r1 = staticinvoke 
<edu.ucsd.ape.clienthelper.ServiceConnectionHelper: 
edu.ucsd.ape.clienthelper.ServiceConnectionHelper getIntance()>()
graph $r2 = newarray (boolean)[1]
graph virtualinvoke $r1.<edu.ucsd.ape.clienthelper.ServiceConnectionHelper: 
void waituntil_statement(int,int,boolean[])>(0, 100, $r2)
graph return
graph return

Note the missing call to the PrintStream. Is this a bug?

Additionally, the exceptional unit graph inlined the method for me. Is 
there a way to control the inlining. I'm trying to put together a simple 
inter procedural  analysis and what to propagate manually the results 
across method CFGs.

Thanks,
-- Octav

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150418/eeccc19d/attachment.html 


More information about the Soot-list mailing list