Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Oct 1999 12:09:32 -0600
From:      Wes Peters <wes@softweyr.com>
To:        Clark Jarvis <clark@pharlap.com>
Cc:        Mohit Aron <aron@cs.rice.edu>, freebsd-net@FreeBSD.ORG
Subject:   Re: Search a symbol in the source tree
Message-ID:  <38061C5C.75B89CA3@softweyr.com>
References:  <19991014163644223.AAA270@sugar.pharlap.com@clark>

next in thread | previous in thread | raw e-mail | index | archive | help
Clark Jarvis wrote:
> 
> In <199910122012.PAA23666@cs.rice.edu>, on 10/12/99
>    at 03:12 PM, Mohit Aron <aron@cs.rice.edu> said:
> 
> >> Can anyone suggest me a way of searching symbols in the entire /usr/src
> >> tree? I normally use grep */*.  But grep does not work recursively, right?
> >> Something like a small shell script may do this. Thanks a lot.
> 
> >Rather than using something equivalent to a recursive grep (which is
> >slow), I prefer to use etags. This gives me the flexibility of searching
> >for symbols from within emacs where emacs directly takes me to the
> >section of code that defines the symbol.
> 
> [tags creation code deleted]
> 
> I use a combination of tags and an unzipped tar file of the source tree,
> providing your text editor can handle large files and binary characters
> with some success.  Just load up the tar file and search.  Inside the tar
> file, the filespec for each file is stored in a block at the beginning of
> each file, so it only takes a little reverse searching to figure out where
> the file lives in the source tree.
> 
> Tags are great, but they don't find where/how symbols are used, just where
> they are defined.  And realizing that this is an old, ingrained behavior -
> etags may be able to do more than I'm aware of.

'tags-search' will exhaustively search all the tagged files for the symbol.  
On popular symbols, this can take a while, but it will certainly find all
the references.  Handily enough, the search string is a regexp.

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
wes@softweyr.com                                           http://softweyr.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38061C5C.75B89CA3>