code_graphs -- The C Source Code Graphical Browser

R. J. Brown -- Elijah Laboratories Inc.

code_graphs -- The C Source Code Graphical Browser

To the left is a frame with a list of tools in it. This start-up page allows you to choose which tools you wish to use, and to open them.

You will need to have a pdf file viewer installed as a plug-in to your browser, as the graphs you will be viewing are contained in pdf files.

I find that acroread is the best tool for this because it supports panning and scrolling using the mouse in "palm" mode, and it supports zomming in and out with the mouse wheel. The combination of these operations provides you with the ability to explore these intracate graphs in as much detail as you desire.

Typical Usage

Clicking on a node in a graph opens a graph of all the nodes in the maximal subgraph that contain the node you clicked on.

So for an #include hierarchy graph, if you click on a node, which represents a source file, then it shows you all the files that #include that file, and all the file that that file #include's, recursively, over the entire set of files making up the program.

Likewise, in a call-tree graph, each node represents a C function, and it shows who calls who, etc. Clicking on a node here shows you who calls that function, and who that function calls.

When I start the browser using firefox or Internet Explorer, I like to middle click on each of the tools to the left. This opens each tool up in a separate tab. Once I have all the tools open in tabs, I close the tab containing this start-up page. This gives me all the tools, and no extra stuff. You may prefer to keep the start-up page the first few times you use it, just in case you need to refer back to it.

The Tools Available

In all of the tools, a frame appears to the left allowing you to choose the graph you want to see by clicking on its name. You may also click on a name in a node in the graph itself to do the same thing.

  • Module Graph
    This shows a node for each object file, or object module, in the program. Arcs show which object files reference which other object files, allowing you to easily determine why a particular file was included in the link.
  • Include Graph
    This shows a node for each source file in the program. Arcs show which file includes which file, and which function is called by which function. This helps you determine why a particular #include file is included into a compilation. It also helps you during development by alerting you when the graph becomes a terrible tangled mess to the realization that you need to clean up your #include heirarchy.
  • Call Graph
    This shows a node for each C function in the program. Arcs show which function calls which function, and which function is called by which function. This allows you to determine which functions will be called as a result of calling another function. This is useful for testing and maintenence. It is also useful during development by letting you visualize the calling structure of your program while you are developing it. This helps you better factor your code for easier maintenence and understanding.
  • Linkage Graph
    This shows a node for each object module in the program, and for each global symbol in the program. Arcs show which symbols are exported and imported by any given object module. Colors and shapes distinguish object modules, defined function names are in red. Undefined function names, such as names defined in a library that is not actually part of the build, are in white. Variables appear in green if they are read-only, and in yellow if they are both read and written to. Object modules are in blue. Black arcs are imports of a symbol into an object module, and red arcs are exports of a symbol from an object module.
  • Source Listings
    This is not a graph at all, but a pretty printed set of source files for the program.
  • Elijah Laboratories Inc. logo Elijah Laboratories Inc. logo

    © 2011 Elijah Laboratories Inc.
    ALL RIGHTS RESERVED WORLDWIDE.

    Web page design by Robert J. Brown.
    Last modified: Sat Feb 19 18:39:00 EST 2011

    Signature