etags crashes, ctags not

Darryl Okahata Darryl Okahata <darrylo@soco.agilent.com>
Tue, 27 Feb 2001 14:15:05 -0800


rgmerk@mira.net (Robert Graham Merkel) wrote:

> I can't speak for anyone else, but I think having a tags file is very
> useful, and IIRC it's a very small part of the time required to do the
> build.

     Oh, certainly.  It's definitely useful.  However:

* It's certainly not needed to build gnucash.

* Many people who build gnucash, do so because they just want to install
  it (linux is not the entire world), and have no interest in being a
  gnucash developer.

* Few other projects (that use configure/autoconf) do anything similar.

> By the way, what's better about cscope?

     Not only will cscope tell you where something is defined (which is
what ctags/etags will do), but cscope can also do:

* Show all occurrences of a symbol.

* Show functions called by a function.

* Show functions calling a function.

* Text string searches.

* Regexp searches.

* Locating a file (good for nasty/large projects with lots of
  subdirectories).

* List files that #include a file.

Once search results are displayed, you can then press a key to use your
favorite editor to edit files.

     It's also fairly fast (especially if you use AT&T lex instead of
flex when building cscope).  On my old/slow HP-UX workstation, I can
search 1000+ files in 50+ directories in under 30 seconds (after the
first search, once everything's cached in memory by HP-UX, searches take
under two seconds).  This covers ~1.8 million lines of C/C++ code
(including comments and blank lines, though), with a cscope database of
around 18.5MB.  This is using cscope built with AT&T lex, though (cscope
built using flex takes around five times longer).

     By default, cscope has a terminal/full-screen interface, but can
also be used under Emacs/XEmacs (I have to admit that I wrote the XEmacs
interface for it).  However, cscope also has a line-oriented mode
(perfect for scripting or interfacing to your favorite editor), where
the results are displayed in a simple form (somewhat similar to that of
grep(1) output).

[ Cscope isn't perfect, however.  For example, among other issues, it
  doesn't recognize function definitions with a function pointer
  argument.  ]

-- 
	Darryl Okahata
	darrylo@soco.agilent.com

DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Agilent Technologies, or
of the little green men that have been following him all day.