From owner-freebsd-net Thu Oct 14 11:10:46 1999 Delivered-To: freebsd-net@freebsd.org Received: from xylan.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id 24AC714C1E for ; Thu, 14 Oct 1999 11:10:43 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com by xylan.com (8.8.7/SMI-SVR4 (ind.alcatel.com 2.3 [OUT])) id LAA15963; Thu, 14 Oct 1999 11:09:36 -0700 (PDT) Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id LAA15229; Thu, 14 Oct 1999 11:09:36 -0700 Received: from softweyr.com (dyn0.utah.xylan.com) by omni.xylan.com (4.1/SMI-4.1 (xylan engr [SPOOL])) id AA12453; Thu, 14 Oct 99 11:09:12 PDT Message-Id: <38061C5C.75B89CA3@softweyr.com> Date: Thu, 14 Oct 1999 12:09:32 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en Mime-Version: 1.0 To: Clark Jarvis Cc: Mohit Aron , freebsd-net@FreeBSD.ORG Subject: Re: Search a symbol in the source tree References: <19991014163644223.AAA270@sugar.pharlap.com@clark> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Clark Jarvis wrote: > > In <199910122012.PAA23666@cs.rice.edu>, on 10/12/99 > at 03:12 PM, Mohit Aron 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