Listing C/C++ functions (Code analysis in Unix)

Run it through doxygen. It will complain about lack of commenting , but it will still produce call graphs and list all the functions. Presented in HTML with links to follow code paths.

doxygen


Exuberant Ctags http://ctags.sourceforge.net/

I've only used it from time to time some time ago, and from within a text editor, but check out the list of utilities/tools which can use it:

http://ctags.sourceforge.net/tools.html


cscope is very good for this sort of thing. Unlike ctags, cscope provides an interface suitible for searching (ctags requires an editor).

Just run cscope in the root directory of the code you want to inspect. It will: create a database if one isn't there, update the database if one is there, and open a curses gui where you can query all sorts of useful info

  • all references to a symbol
  • global definitions
  • functions called by a function
  • functions calling a function
  • text string
  • regular expression pattern
  • a file
  • files including a file

ctags only does the first one, 'all references to a symbol'.


Doxygen is able to generate some reasonable html documentation and parse out comments. It's not perfect, but it might help. You could incorporate Ctags into your editor to jump you to the functions that you're looking for.

Personally, I use grep ;)