help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT:cscope/tags


From: Thorsten Bonow
Subject: Re: OT:cscope/tags
Date: Mon, 04 Dec 2006 15:43:19 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

>>>>> "Hadron" == Hadron Quark <hadronquark@gmail.com> writes:

    Hadron> Do you have the entire kernel cscope'd? I use xcscope.

    Hadron> What cscope.el or equivalent do you use? I use xcscope.el. There are
    Hadron> lots of versions around. This was the first one I tried which
    Hadron> worked:


    Hadron> ; File: xcscope.el RCS: $RCSfile: xcscope.el,v $ $Revision: 1.14 $
    Hadron> ; $Date: 2002/04/10 16:59:00 $ $Author: darrylo $ Description:
    Hadron> ; cscope interface for (X)Emacs Author: Darryl Okahata Created: Wed
    Hadron> ; Apr 19 17:03:38 2000 Modified: Thu Apr 4 17:22:22 2002 (Darryl
    Hadron> ; Okahata) darrylo@soco.agilent.com Language: Emacs-Lisp

    Hadron> There was no emacs package for cscope in
    Hadron> /usr/share/doc/cscope/contrib as part of the Ubuntu distro.

Hi,

I looked into your problem:

I use the same xcscope.el. And yes, doing so makes cscope *extremely* slow (> 
20(0)
seconds respond time).

    >> If you can be more specific I can try to reproduce it on my box and we
    >> can compare the results.

Here is what I did:

I got the new kernel source 2.6.19, unzipped it into a directory and told
xcscope to generate it's files in this directory. I then searched for the global
definition of "adb_request":

---------------------------------------
Finding global definition: adb_request

Database directory: /home/toto/42/kernel-source/
-------------------------------------------------------------------------------
*** linux-2.6.19/include/asm-m68k/adb.h:
adb_request[54]                struct adb_request {
adb_request[62]                void (*done)(struct adb_request *);

*** linux-2.6.19/include/linux/adb.h:
adb_request[45]                struct adb_request {
adb_request[53]                void (*done)(struct adb_request *);

*** /usr/include/linux/adb.h:
adb_request[45]                struct adb_request {
adb_request[53]                void (*done)(struct adb_request *);
-------------------------------------------------------------------------------

Search complete.  Search time = 21.80 seconds.
---------------------------------------

Then I tried to be extremely clever and told xcscope (via customize) to make use
of my own version of cscope-indexer(.xxx) which added the "-k -q" options to the
cscope call: this enables "kernel mode" in which no other directories are
searched and "-q" creates two extra files which allows for a faster searching
algorithm to be used (as described in the cscope man page). I had to write a
wrapper script for cscope, too (cscope.xxx) to pass these options to all cscope
calls and customized emacs to actually use it ;-)

As reward for my troubles the searching times exploded to more than 200
seconds. Sigh.

Than I put on my thinking cap and realized that now the database was rebuild
*every* time before actually doing the look-up (although obviously no file had
*changed in the source tree).

Changing my wrapper scripts to include the "-d" option, which forces cscope
*not* to rebuild the database, search times went down to 0.5 seconds, which
is---in the emacs world---instantaneous :-)

---------------------------------------
Finding global definition: adb_request

Database directory: /home/toto/42/kernel-source/
-------------------------------------------------------------------------------
*** linux-2.6.19/include/asm-m68k/adb.h:
adb_request[54]                struct adb_request {
adb_request[62]                void (*done)(struct adb_request *);

*** linux-2.6.19/include/linux/adb.h:
adb_request[45]                struct adb_request {
adb_request[53]                void (*done)(struct adb_request *);
-------------------------------------------------------------------------------

Search complete.  Search time = 0.50 seconds.
---------------------------------------

See that the "-k" option prevented cscope from searching (and finding anything)
in "/usr/include/linux/adb.h".

So I think what's wrong with xscope.el is the "do I need to update the database"
algorithm.

Working with much smaller projects, the problem didn't occur to me up to now. I
will look into it.

You could start with

    http://www.emacswiki.org/cgi-bin/wiki/CScopeAndEmacs

where the problem is mentioned and an alternative "bscope"
(http://groups.google.de/group/gnu.emacs.sources/browse_frm/thread/6e087f36c31336b8/92f00c90361f07da?lnk=st&q=bscope&rnum=1#92f00c90361f07da)
is mentioned (and which I should have read before trying out myself) ...
    
    >> Have you given gtags a shot?

    Hadron> Oh no :) Another tool :( So far I have etags, ctags, semantic &
    Hadron> senator and now cscope.

    Hadron> A quick google shows gtags to be a faster etags : tags are already
    Hadron> fast enough just not powerful enough. Semantic is just plain buggy
    Hadron> and doesn't seem to have half the options you might need for code
    Hadron> navigation.

    Hadron> cscope is the way as far as I can see, if I can find out which of
    Hadron> the many .el packages I should be using.

I like it best, too. About the only good thing coming from SCO these days ;-)

    Hadron> Thanks for any help.

Hope this helps...

Toto


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

[...] the dangerous role of the troublemakers in history has
often fallen to the Jewish people. Anne Frankly, it should be
noted, in passing, that a great deal of good for the advancement
of mankind has been accomplished between circumcision, where they
cut off the tip of your dick, to crucifixion, where they throw
the whole Jew away.

Friedman, Kinky (1995), "God Bless John Wayne", Simon and
Shuster, New York


reply via email to

[Prev in Thread] Current Thread [Next in Thread]