Search code examples
language-agnosticidegraphstack

Is there any way to display a function call graph?


While browsing through source code in my IDE I'll sometimes wish I could see a call stack/s or function call graph from a particular point in the code (while the program isn't running) to help me understand the sequence of events better.

An example of the functionality I'd like to see is: I click a function called 'sendNotificationEmail' And a 'stack' of functions is displayed (owner is to the right):

sendNotificationEmail->EmergencyNotificator->CheckIfServersOnFire->UpdateThread->Main

My question is: Can any ides/plugins/or otherwise display such information, and if not - why?

This question isn't IDE or language specific.


Solution

  • This does tend to be IDE / language-specific. IntelliJ and Eclipse both have Call Hierarchies available for Java methods, which lets you look at callers and callees for a given method. Visual Studio offers similar facilities for MS languages.

    For less mainstream languages, you might need to swallow some Rich Programmer Food if the available tools aren't up to it.