Subject: source code tool
To: None <amiga-dev@sun-lamp.cs.berkeley.edu>
From: Andy Heffernan <ahh@netcom.com>
List: amiga-dev
Date: 06/10/1994 23:00:38
There is a tool which I have become dependent upon for figuring out
large, complicated collections of source code. I thought some other
folks might be interested in it.
I have placed the file id.tar.Z on ftp.uni-regensburg.de in the
pub/NetBSD-Amiga/incoming directory
In short, what this tool lets you do is quickly grep for occurrences
of a particular symbol in a source tree. For example:
(moji:/usr/src/sys)# gid arpintr
netinet/if_ether.c:385: arpintr()
netinet/if_ether.c:396: panic("arpintr");
netinet/if_ether.h:158: void arpintr __P((void));
arch/amiga/amiga/machdep.c:1236: arpintr();
(moji:/usr/src/sys)# gid config_found
kern/subr_autoconf.c:181: config_found(parent, aux, print)
scsi/scsiconf.c:310: if (config_found((struct device *)scsi,
sys/device.h:140: int config_found __P((struct device *, void *, cfprint_t));
arch/amiga/amiga/autoconf.c:120: return(config_found(pdp, auxp, pfn));
arch/amiga/amiga/autoconf.c:195: config_found(dp, "clock", simple_devprint);
arch/amiga/amiga/autoconf.c:196: config_found(dp, "ser", simple_devprint);
arch/amiga/amiga/autoconf.c:197: config_found(dp, "par", simple_devprint);
arch/amiga/amiga/autoconf.c:198: config_found(dp, "kbd", simple_devprint);
arch/amiga/amiga/autoconf.c:199: config_found(dp, "grfcc", simple_devprint);
arch/amiga/amiga/autoconf.c:200: config_found(dp, "fdc", simple_devprint);
arch/amiga/amiga/autoconf.c:201: config_found(dp, "ztwobus", simple_devprint);
arch/amiga/amiga/autoconf.c:203: config_found(dp, "ahsc", simple_devprint);
arch/amiga/amiga/autoconf.c:205: config_found(dp, "zthreebus", simple_devprint);
arch/amiga/amiga/autoconf.c:208: config_found(dp, "idesc", simple_devprint);
arch/amiga/dev/ahsc.c:155: config_found(dp, &sc->sc_link, ahscprint);
arch/amiga/dev/atzsc.c:164: config_found(dp, &sc->sc_link, atzscprint);
arch/amiga/dev/fd.c:283: config_found(dp, &args, fdcprint);
arch/amiga/dev/fd.c:287: config_found(dp, &args, fdcprint);
arch/amiga/dev/gtsc.c:200: config_found(dp, &sc->sc_link, gtscprint);
arch/amiga/dev/gvpbus.c:124: config_found(dp, &ga, gvpbusprint);
arch/amiga/dev/idesc.c:400: config_found(dp, &sc->sc_link, idescprint);
arch/amiga/dev/ivsc.c:182: config_found(dp, &sc->sc_link, ivscprint);
arch/amiga/dev/mgnsc.c:132: config_found(dp, &sc->sc_link, mgnscprint);
arch/amiga/dev/mlhsc.c:150: config_found(dp, &sc->sc_link, mlhscprint);
arch/amiga/dev/otgsc.c:150: config_found(dp, &sc->sc_link, otgscprint);
arch/amiga/dev/wesc.c:132: config_found(dp, &sc->sc_link, wescprint);
arch/amiga/dev/wstsc.c:167: config_found(dp, &sc->sc_link, wstscprint);
arch/amiga/dev/zssc.c:136: config_found(dp, &sc->sc_link, zsscprint);
Whenever I update my kernel source tree, I cd to /usr/src/sys and do
the following:
# find . -name '*.[sch]' -print | mkid -fID -
This takes a little while to run, and will create the database file in
the current directory. From that point on, you can use gid and related
commands anywhere in the tree to find stuff very very quickly.
Naturally, it's a good idea to update the database after making
wholesale changes (especially additions and deletions), but simple
editing won't confuse it.
------------------------------------------------------------------------------