David Thompson:
 |Anybody know of a set of tools to parse c and c++ that can produce a 
 |list of functions and globals? I'd really like to clean up any 
 |duplicates, etc as I begin libtooling.

This might help you.  Check out cscope:

     http://cscope.sourceforge.net/
     http://www.unipress.com/att/new/cscope.html
     http://www.ziplink.net/~felaco/cbrowser/

cscope builds a symbol cross-reference file from a tree of source code
(with ascii screen- & line-oriented i/f's), and cbrowser layers on top to
give you a user-friendly Tcl GUI.  emacs, vim and, other editors have
cscope integration.

Whenever I'm doing much digging in a large source package like DX, I use
"cscope -R -k" with cbrowser.

By using cscope to search on function symbols referenced in the global
scope, it looks like it wouldn't be too hard to write a script to find all
duplicate definitions.  Though you could probably do it easier with
something like:

       find . -name '*.o' | xargs nm -Bo | grep "T <symbol>"

Randy

-- 
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711

Reply via email to