[Soot-list] Call graph construction, overriding methods

Richard L. Halpert richardlhalpert at gmail.com
Thu Sep 13 19:23:46 EDT 2007


Soot actually uses points-to analysis to try to construct the most precise
call-graph possible.  If the B object is never actually of type C or D, then
C.m2() and D.m2() will not be included in the call graph.

If you want the most conservative possible estimate of which methods might
be called from that callsite, use CHA for call-graph construction.  However,
even with CHA, some call-graph edges that can never occur will still be
removed (ie if you never instantiate an object of type C or D, then I
believe even CHA will know that C.m2() and D.m2() cannot be called here).

If you want the most precise possible estimate of the call-graph, use Paddle
with context sensitivity for points-to analysis and call graph
construction.  Spark is a good balance between those two extremes.

Then, when you're doing an analysis of a callsite, just use the call graph
to determine what methods you actually need to analyze.
CallGraph.edgesOutOf(stmt) will tell you what methods may be called from
callsite "stmt".

-Richard

On 9/13/07, Howard Branxon <howardbranxon at gmail.com> wrote:
>
> Hi,
>
> When Soot constructs a call graph, can it put all of the parent and
> children of a class into consideration?  It should check the corresponding
> classes of each node for an overriding method.  For example, if I have
>
> A.m1
> {
> B.m2();
> }
>
> And then we have C.m2 and D.m2 that override method m2 in B, our analysis
> should consider B.m2(), C.m2(), and D.m2(), but right now it only
> considers B.m2().
>
> I am looking at the Soot source code in soot.jimple.tools.callgraph, and
> have some ideas of what I could do, but was wondering if anyone else has
> encountered this issue and has any relatively efficient ways to solve this.
>
> Thanks!
> Howie
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20070913/570931b1/attachment.htm


More information about the Soot-list mailing list