unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Perry Smith <pedz@easesoftware.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: OT:cscope/tags
Date: Tue, 5 Dec 2006 21:19:22 -0600	[thread overview]
Message-ID: <712957F4-9CB5-4DB5-9225-B95C3D687B52@easesoftware.com> (raw)
In-Reply-To: <hgr6vdbygu.fsf@gmail.com>


On Dec 5, 2006, at 7:32 PM, Hadron Quark wrote:

> Perry Smith <pedz@easesoftware.com> writes:
>
>> On Dec 5, 2006, at 4:39 PM, Hadron Quark wrote:
>>
>>> Perry Smith <pedz@easesoftware.com> writes:
>>>
>>>> cscope.  To make the db I use -q.  To invoke it via emacs, I use -q
>>>> and -d:
>>>>
>>>>        -d     Do not update the cross-reference.
>>>>
>>>>        -q     Enable  fast  symbol  lookup  via an inverted
>>>
>>> Just for thread completeness, how do you add these options when
>>> inviking
>>> cscope from emacs? How are you accessing cscope from emacs? Which el
>>> package do you use?
>>
>> Well, its a long story.  I created my own cscope.el back in 1990.   
>> I'm
>> happy to share it
>> but it has lots of weird twisted gunk in it.  I have the concept  
>> of an
>> "inherited buffer".  Each
>> buffer has a buffer local variable that points back to its inherited
>> buffer.  In this way,
>> different buffers can use different cscope's and not get confused
>> between them.  At the
>
> Can you expand on this? I dont understand.

I was working on debugging the entire OS.  Once at Tandem, the other  
at IBM.  At the time,
it was not practical to have one cscope database for the entire OS.   
So I had separate cscope
files for the particular areas I would be working in.  So if I was  
editing a group of files down the
path /a/b/c/d which had a cscope database in d, then all the files in  
d would point back to the cscope
buffer using the database in d.  At the same time, I might be editing  
and looking at files down the
path /u/v/w/x which would have its own separate cscope db.  All the  
files in x would point back to
the cscope buffer using the db in x.  I could look at various things  
in separate files and do
symbol lookups, etc.  There was also the problem of various build  
versions of the OS.  Again, I could
have separate db's in the various directories so foodog.h from build  
1 would look at the cscope
db file from build 1 while foodog.h from build 2 would look at the  
cscope db from build 2.  This
is also where I had "inherited" buffer local variables.  So if I did  
a make in foodog.h of build 1, it
would use the proper commands for build level 1.



> Did you try xcscope previously referenced? With auto database update
> turned off, it works great.

I like what I have very much except that cscope does not actually  
truly understand C++ so
it can not really find me all the references to a particular method  
of a particular class.

>> time, there was a lot of other things that were inherited besides  
>> just
>> the cscope information
>> (like build information and that sort of thing).
>>
>> I also have a script called cscope-front (I've appended it to the
>> bottom).  I doubt if it
>> will do you much good either except just as a thought of calling
>> cscope via a script
>> and then that script can add and subtract arguments based upon a
>> number of
>> variables.  This keeps the lisp code simpler -- I was more  
>> comfortable
>> writing shell
>> scripts than lisp code at the time.
>>
>> I create the cscope database via make.  The makefile creates a  
>> list of
>> files called cscope.files,
>> (usually based upon various make variables), then it calls cscope as:
>>
>> cscope -q -b
>>
>> (The cscope I'm using defaults to looking in cscope.files for the  
>> list
>> of files.)
>>
>> From emacs, I call cscope-front (using my cscope.el routines).  As  
>> you
>> can see, the script
>> has debug output to /tmp/doggy.  Here are some sample lines from  
>> doggy:
>>
>> /home/pedz/Eclipse/SATA/src
>> a='' p='/home/pedz/Eclipse/SATA/src'
>> /usr/local/bin/cscope -d -q -l -P /home/pedz/Eclipse/SATA/src -f
>> cscope.out
>>
>> The last line is all the args I use to call cscope with.
>>
>> Hopefully, something in here will be useful to you.
>>
>> #!/usr/local/bin/bash
>> #
>> # First arg is the string to pass to setup, second arg is the
>> # directory where the cscope should behave from
>> #
>> a=$1
>> p=$( echo $2 | sed -e 's%/$%%' )
>> CSCOPE=/usr/local/bin/cscope
>>
>> shift
>> shift
>>
>> /bin/pwd >>  /tmp/doggy
>> echo "a='$a' p='$p'" >> /tmp/doggy
>> if [ -n "$a" ] ; then
>>   source ~/.setup $a
>> fi
>> #
>> # DFS permissions are weird and I can execute things even though the
>> # file system says I can not.  So I only check to see if the file
>> # exists or not.
>> #
>> if [ -e cscope/bin/cscope ] ; then
>>   CSCOPE=cscope/bin/cscope
>> elif [ -e ../cscope/bin/cscope ] ; then
>>   CSCOPE=../cscope/bin/cscope
>> elif [ -e ../../cscope/bin/cscope ] ; then
>>   CSCOPE=../../cscope/bin/cscope
>> fi
>>
>> echo $CSCOPE -d -q -l -P "$p" "$@" >> /tmp/doggy
>> exec $CSCOPE -d -q -l -P "$p" "$@" 2>>/tmp/doggy
>> # echo $CSCOPE -q -l -P "'$p'" "$@" >> /tmp/doggy
>> # exec $CSCOPE -q -l -P "'$p'" "$@" 2>> /tmp/doggy
>> # echo $CSCOPE -q -l >> /tmp/doggy
>> # $CSCOPE -q -l 2>> /tmp/doggy
>>
>> # /afs/austin/aix/project/aix41C/cscope/bin/cscope -d -q -l \
>> #	-f /afs/austin/aix/project/aix41C/cscope/bos.db
>> #
>> #	-P /afs/austin/aix/project/aix41C/build/base
>>
>>
>>
>
> -- 
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>

Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems

      reply	other threads:[~2006-12-06  3:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04  9:40 OT:cscope/tags Hadron
2006-12-04 10:40 ` OT:cscope/tags Thorsten Bonow
2006-12-04 11:52   ` OT:cscope/tags Hadron Quark
2006-12-04 14:43     ` OT:cscope/tags Thorsten Bonow
2006-12-04 20:37       ` OT:cscope/tags Thorsten Bonow
2006-12-05 19:01         ` OT:cscope/tags Hadron Quark
2006-12-05 21:37           ` OT:cscope/tags Thorsten Bonow
2006-12-05 22:37         ` OT:cscope/tags Hadron Quark
2006-12-04 16:31 ` OT:cscope/tags Perry Smith
     [not found] ` <mailman.1509.1165249894.2155.help-gnu-emacs@gnu.org>
2006-12-05 18:58   ` OT:cscope/tags Hadron Quark
2006-12-05 20:19     ` OT:cscope/tags Perry Smith
     [not found]     ` <mailman.1572.1165349985.2155.help-gnu-emacs@gnu.org>
2006-12-05 22:39       ` OT:cscope/tags Hadron Quark
2006-12-06  0:31         ` OT:cscope/tags Perry Smith
     [not found]         ` <mailman.1581.1165365122.2155.help-gnu-emacs@gnu.org>
2006-12-06  1:32           ` OT:cscope/tags Hadron Quark
2006-12-06  3:19             ` Perry Smith [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=712957F4-9CB5-4DB5-9225-B95C3D687B52@easesoftware.com \
    --to=pedz@easesoftware.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).