问题
I'm using Eclipse to debug a Java app.
I'd like to see all the possible "call paths" leading to calls to a specific function somefunc
.
Does Eclipse provide a way to get this information? (FWIW, I'm using Juno Service Release 1; Build id: 20121004-1855.)
PS: FWIW, at least some calls to somefunc
result from choices made by the user interactively, so I expect that some of the call paths will start in one or another GUI event handler.
EDIT: this is what I mean by a "call path". Suppose that some event handler a
calls function b
, then b
calls c
, c
calls d
, and finally d
calls somefunc
. Then the sequence
a -> b -> c -> d -> somefunction
is one of the call paths I'm interested in.
回答1:
Does 'right click' >> Open Call Hierarchy help?
It does not aggregate all direct and indirect callers in a flat structure, but gives you a tree through.
回答2:
Left click in the method name, then right click -> References -> Project (or Workspace)
This will show you all the places that that method is called from. I am not sure if that is what you mean by "call path" or not.
来源:https://stackoverflow.com/questions/13753857/how-to-get-the-call-paths-to-a-given-function