Anonymous
Anonymous

Reputation: 1297

linux tool to list all functions in a source file?

I am looking for a command line utility on *nix, that can dump the names of all the functions, classes etc. defined in a file(C/C++/Java)

Upvotes: 8

Views: 4923

Answers (5)

Anand Kumar
Anand Kumar

Reputation: 499

You can try Doxygen to list all your functions (see also XML output possibility) http://www.doxygen.nl/

Upvotes: 0

codaddict
codaddict

Reputation: 454912

You might also want to take a look at cscope which is similar to ctags suggested in the accepted answer. It creates its own symbol database. It provides a nice interface for you, enabling search of a given symbol/inclusion/file/declaration within your project.

Upvotes: 0

Antonio Pérez
Antonio Pérez

Reputation: 6962

Not sure if it would be useful for your exact purpose, but take a look at GCC-XML

Upvotes: 0

Gadolin
Gadolin

Reputation: 2686

It is not clear which language you refer to: if:

  • complied elf file then you have readelf utility providing that you compiled file with debug information "-g"

Upvotes: 0

Gilad Naor
Gilad Naor

Reputation: 21516

ctags can give you that (and much more). It is included with most Linux distributions...
http://ctags.sourceforge.net/whatis.html

Upvotes: 9

Related Questions