Call graphs could give a big picture which makes you better and faster understanding of one project.
Egypt is a simple tool for creating call graphs of C programs. Egypt neither analyzes source code nor lays out graphs. Instead, it leaves the source code analysis to GCC and the graph layout to Graphviz, both of which are better at their respective jobs than egypt itself could ever hope to be. Egypt is simply a very small Perl script that glues these existing tools together.
To install, extract the compressed tar file, cd to the egypt directory, and type
First of all, one project is necessary. you can DOWNLOAD this project or select other one you prefered.
cd to summary-1.0.1, and type
Each .c in project will generate a corresponding .expand. Egypt uses these .expand files to generate the .dot file, and graphviz use .dot file to generate call graph. For example,
will be generated in summary project.
then open summary.svg which is shown below.
Note that, the dash line represents function pointer (C language) calling, the picture makes you better and faster understanding of this project. The main() directly call analyzeperson(), and call do\*() by calling function pointer. The do_*() directly call lib_print().
You will happy to use egypt and graphviz to study a unfamiliar project. Enjoy it!