开发者

Is there any way to display a function call graph? [closed]

Closed. This question nee开发者_运维知识库ds to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 6 years ago.

Improve this question

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.


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.


Doxygen is a tool that can take your code and create call graphs, UML diagrams, class hierarchies, etc... It works on C++, Java, among others. It produces output in HTML and Latex, and others I think. It operates on Linux, Mac, and Windows.

For the most part, it is a standalone program. However, you can use it within the KDevelop IDE to do some basic previews of Doxygen output.


Visual Studio 2005 can do this (I assume newer versions as well):

http://msdn.microsoft.com/en-us/library/z3zaa390(VS.80).aspx

The results are displayed as a tree in a separate view/window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜