cscope: Cscope error: cscope: cannot read list siz

2019-07-10 17:10发布

问题:

Issue: I get the following error when I try to open a file in vim (version 7.3).

cs_read_prompt EOF: Illegal seek E609: Cscope error: cscope: cannot read list size from file cscope.out

Description: I created the cscope database "cscope.out" using the command "cscope -b -R". The file ~/.vim/plugin/cscope_maps.vim contains the command "cs add cscope.out" to add the cscope database. When I try to open one of the source files, I get the error mentioned above.

uname -a

Linux 2.6.16.60-0.58.1.3835.0.PTF.638363-smp #1 SMP Wed Dec 2 12:27:56 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux

What could be the problem here?

Thanks for your help.

回答1:

I had the same problem.

Mine got resolved when I found that the size of the "cscope.out" file was too LARGE(~2.5GB).
Create a separate cscope DB for larger sub folders. And add all DBs separately using ":cs add ".

Note: Reverse index(cscope -b -q) creates larger files.



回答2:

One of the cases where you encounter this error is: if you have a directory that has space(s) in the directory name (even in the path of your source folder) then rename the directory without space(s) and retry.



回答3:

There may be multiple version of cscope on your system. You may check various location of your cscope binary by

whereis cscope

Then add one of this path in your .vimrc

vim ~/.vimrc
set csprg=/path/to/your/desired/cscope


标签: cscope