0

I started a while ago to learn the C language, and has spent several hours I search THE miracle software.

I am looking for software that import sources of software in C (files.c) and generates a "mind map" of the code with all files, functions, variables, etc ...

Do you know if it exists? It'll help me a lot to understand the architecture of complex software.

Thank you very much for all your answers.

4

2 回答 2

1

Take a look at the "call graph". This sort of visualization should get you started.

As the comment suggests, Doxygen is a good open-source tool. Take a look at some output here. Doxygen is straight-forward to configure for call-graph generation under *nix. It's a little more complex for Windows. First, check out this SO post: how to get doxygen to produce call & caller graphs for c functions. Doxygen's HTML output provides a number of nice cross-referencing features (files, variables, structs, etc.) in addition to caller/callee graphs.

On the commercial side, Understand for C/C++ has first-rate visualization features. Google "c call graph diagram" for other commercial and open-source options.

Finally, there are some older SO posts, like this one Tools to get a pictorial function call graph of code. Take a look at it.

于 2014-09-16T18:02:57.260 回答
0

Look into the program ctags. It is an indexer of names and functions based on the structure of the programming language.

It is quite mature, and has integration with a number of other tools. I use it with an older (but very nice) text editor called vi, but it can be used independently from the command line.

It does not generate a graphical view of the connections. However, in my estimation there are probably too many connections in most C programs to display visually without creating a large amount of information overload.

This answer differs from Throwback's answer in some interesting ways. A call graph can mean a few things. One thing it can mean is the path a running program took through a section of code, and another is the combination of all paths a running program might take through the code, and another is the combination of all paths in the code (whether they can be reached or not).

Your needs will drive which tool you should use.

于 2014-09-16T18:27:59.340 回答