Thursday, July 15, 2010

Re: error while adding cscope database

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.

Also adding database with -P option did not help.

I am using Windows Gvim.

Thanks,
Kapil


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.
>
>> and if i try to specify the complete path i.e
>>
>> :cs a c:\usr dir\cscope.out
>>
>> i  get this issue  E563: static(c:\usr\) error: 2
>>
>> well, its clear that this one is due to the space between usr dir, can
>> anyone please specify me how can i include a either space in path or
>> the actualy solution to this problem
>
> For the reasons given above, I doubt that fixing this latter error
> will solve the problem, but you can escape spaces in file names by
> preceding them with backslashes or by surrounding the file name with
> quotes.  Which one works depends on what program is handling the
> escaping/quoting.  I find it a whole lot less confusing to give Vim
> file names in Unix notation, using forward slashes rather than
> backslashes between directories.  Then I don't have to worry about
> whether a backslash is being interpreted as a delimiter or an
> escape.  Vim makes the conversion to DOS notation when necessary.
>
> 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.
>
> 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
>

--
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: