cscope absolute paths

274 views
Skip to first unread message

James M Beck

unread,
Jan 16, 2008, 12:12:28 PM1/16/08
to vim...@googlegroups.com
Hi,

I must be missing something here. I'm trying to get the cscope database to
use absolute path names so that Vim will find the files I request. There
seems to be a solution where you find <every file> and dump it in
cscope.files for cscope to use. But that's lame (and I presume, slow). Is
there a variable I can set in Vim that prepends a path to cscope files? Or
maybe there's a better way to generate a cscope database with absolute
paths?

If all else fails, I'll do all this in a script, and call the script from
Vim. But based on what I understand of typical *nix programs, it seems
like an absolute-path flag should be available.

Thanks,
-James

Gary Johnson

unread,
Jan 16, 2008, 12:58:47 PM1/16/08
to vim...@googlegroups.com

If all your files are in or below a particular directory, I think
you can just give cscope the full path name to that directory when
you build the database. If you've already built a database with
relative path names, you can use cscope's -P to add a path prefix to
all the file names in the database.

HTH,
Gary

Navdeep Parhar

unread,
Jan 16, 2008, 1:03:28 PM1/16/08
to vim...@googlegroups.com
> From: James M Beck <james....@nasa.gov>
> Subject: cscope absolute paths

>
> Hi,
>
> I must be missing something here. I'm trying to get the cscope
> database
>
to
> use absolute path names so that Vim will find the files I
> request.
>
There
> seems to be a solution where you find and dump it in
> cscope.files for cscope to use. But that's lame (and I presume,
> slow).
Is there a variable I can set in Vim that prepends a path
> to cscope files?
Or maybe there's a better way to generate
> a cscope database with absolute paths?

You can specify a prepend path while adding the cscope database
(see help of ":cs add"). Then use ":cs show" to verify that the right
prepend path *is* being used.

Regards,
Navdeep


____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

James M Beck

unread,
Jan 16, 2008, 2:58:03 PM1/16/08
to vim...@googlegroups.com
AH! I see now. I thought the P command modified the database, but I guess
it's just a runtime thing.

Thanks for your help.

On Wed, 16 Jan 2008 12:03:28 -0600, Navdeep Parhar <nspa...@yahoo.com>
wrote:

Reply all
Reply to author
Forward
0 new messages