[Soot-list] Call graph strangeness
Graham Hughes
ghughes at email.arc.nasa.gov
Wed Sep 28 13:25:01 EDT 2005
Ondrej Lhotak wrote:
> On Tue, Sep 27, 2005 at 06:47:32PM -0700, Graham Hughes wrote:
>
>>When I run the attached file through Soot with Spark enabled, I find
>>that the call graph claims that foo is never called; that is, the foo
>>method is not in Scene.v ().getCallGraph ().sourceMethods (). This is
>
>
> The sourceMethods() method does not give the set of methods that may be
> called, but as its javadoc says:
> /** Returns an iterator over all methods that are the sources of at least
> * one edge. */
> That is, it returns the set of all methods that have at least one
> outgoing call edge. In your example, the foo method has no call sites,
> so it is not in this set.
>
> It sounds like you're looking for the set of all methods reachable
> through the call graph, which you can get by calling
> Scene.v().getReachableMethods().listener(). This returns a QueueReader
> which implements Iterator.
Aha! Thank you.
Graham
More information about the Soot-list
mailing list