Thursday, July 15, 2010

Re: error while adding cscope database

On 2010-07-16, kapil upadhayay wrote:

> On Fri, Jul 16, 2010 at 1:37 AM, Gary Johnson <garyjohn@spocom.com> wrote:
> > On 2010-07-15, kapil upadhayay wrote:
> >> Hi Vim'ers
> >>
> >>       on my windows XP host i create a cscope datebase for my C
> >> project in
> >> c:\usr dir\mpm using command
> >> (on my cygwin shell)
> >>
> >> [/cygdrive/c/usr dir/mpm]$ cscope.exe -q -R -b
> >>
> >> and i open my gvim and cd to  mpm directory and issue this
> >>
> >> :cs a ./cscope.out
> >>
> >> and i am getting this error
> >>
> >> E609: Cscope error: cscope: cannot read trailer offset from file
> >> .\cscope.out
> >
> > According to a brief Google search for that error message, the
> > problem is that cscope can't handle paths containing spaces.
> >
> > If that's the case, then one solution would be to find a point in
> > your project tree below which there are no file names containing
> > spaces and build a cscope database with relative file names from
> > that directory.  Unfortunately, that would require that Vim's
> > working directory always be the directory from which you ran cscope.
> > A workaround to that _might_ be to add the cscope database with the
> > pre-path option, in the hope that cscope handles spaces in its -P
> > option better than it handles them in the database file.

[...]

> > One other thing.  You mentioned using the Cygwin shell and using
> > gvim.  Are you using Cygwin's gvim (running in X) or Windows' gvim?
> > Using Cygwin tools from within a Windows gvim can be troublesome,
> > because some paths come from or are given to the Windows OS API,
> > while others come from or are given to Cygwin programs such as the
> > shell, and the root of the two file systems is usually different.

> Thanks Gary and Fret for detailed help.
>
> i tried to resolve this issue by creating a new dir i.e
> c:/kap_usr_data/mpm. put all my code there, that away i removed the
> possibility of having any spaces in file paths (also cross checked
> that inside the project there aren't any files/directories that have
> spaces in their names), recreated the database. But no Luck.

I assume by "no Luck" you mean you got the same error message:

E609: Cscope error: cscope: cannot read trailer offset from file .\cscope.out

> I am using Windows Gvim.

I won't be able to try any experiments with this myself until
tomorrow, when I'll have access to a system with cscope. In the
mean time, you might try Cygwin's vim and see if that makes a
difference. You might also try creating a minimal source tree that
exhibits the problem and that others on this list could use to
replicate or help identify the problem.

Also, it's customary on this list to put your message at the bottom,
rather than at the top, of a reply.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: