[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: querying the InvokeGraph
The InvokeGraph has edges from call sites to target methods. If you need
edges from methods to target methods called from them, you need a
MethodCallGraph (which is created from an InvokeGraph).
On Fri, Jan 24, 2003 at 05:30:07PM -0000, Eric Bodden wrote:
> Hi!
>
> Today I have two questions on querying the InvokeGraph. I created this
> graph using ClassHierarchyAnalysis.newInvokeGraph(). After that, let's
> say, I want to determine callers and callees for a given method. I do
> that using:
> getTransitiveTargetsOf()
> getTargetsOf()
> getCallingSitesOf()
> The last method is wrking and returns a huge list of calling sites. But
> the both first ones always return a list of length 0 (and there _are_
> methods called by the given method.
The most common reason for this is that the classes containing the
target methods were not loaded when the CHA was executing. Does it still
happen for methods that call methods in the same class?
> Second question: getCallingSitesOf() returns a List of what? When I do a
> toString() I get the actual invocation as String. But how can I
> determine, which _method_ actually called the given method?
getCallingSitesOf() returns a list of the Stmt objects containing the
calls whose target is a given method.
Ondrej
>
> Thanks,
> Eric
>
> --------------------------------
> Eric Bodden
> University of Kent at Canterbury
>