Questions tagged [cscope]

Cscope is a code searching application originally written for searching C code bases. Cscope is useful for searching many other code bases as well: C++, Java, Python, etc.

Cscope home page

266 questions
8
votes
5 answers

How to use cscope for a project which has .c , .cpp and .h files?

I am working on a project which requires the understanding of llvm compiler source-code. To browse source code of llvm, I tried to use cscope with following command in the root directory of the source: cscope -R * But it doesn't work. As there…
user1129237
7
votes
4 answers

Vim Cmake integration

I have a cmake project. I want to do the following easily search the declaration, definition and references of any variable, function, etc. under the cursor, which may be declared in an external header file whose path is added using…
Ujjwal Rajput
  • 181
  • 2
  • 8
7
votes
6 answers

cscope for files which are symlinks

I have a source directory with several files. Some of them are symlinks to other files. I created a cscope.files file. But when I execute cscope. It complains for the files that are symlinks: cscope: cannot find file /home/bla/source/file.cc I…
user972014
  • 3,296
  • 6
  • 49
  • 89
7
votes
2 answers

Build cscope.out files in a separate directory

I've source code of a huge project in one directory (/my/src/) and I want the cscope files to be built in some other directory (/my/db/). How can I do that ?
viji
  • 2,706
  • 5
  • 28
  • 34
6
votes
0 answers

cscope: Generate only one symbol using #ifdef

I have C source code which have lots of #ifdef ANSI macro. For example, #ifdef ANSI int test ( int a ) #else int test(a) int a; #endif So If I use cscope+vim with the above source code to navigate test(), it always displays the same two…
James
  • 61
  • 1
6
votes
1 answer

Cscope unable to create inverted index. Why?

The following command works fine: $>cscope -b -R However, the option for inverted index does not work: $>cscope -b -q -k -R Input file specified two times. cscope: cannot create inverted index; ignoring -q option cscope: removed files…
venk
  • 1,085
  • 1
  • 7
  • 18
6
votes
4 answers

Linux kernel makefile cscope target

When I generate Linux kernel cscope database by issuing make cscope I get database file along with a list of files with relative path. This is a problem for me because later on when I attach that external kernel's database in vim editor from…
mesmerizingr
  • 1,417
  • 1
  • 18
  • 25
6
votes
2 answers

What cscope reference card do you use?

What is the standard/best reference card for cscope shortcuts/usage that I can print for quick reference?
Lazer
  • 90,700
  • 113
  • 281
  • 364
6
votes
1 answer

Cscope build fails with error message "could not read symbols: File in wrong format"

I am cross-compiling cscope, but suprised to be failed. However, I succeed to build ctags without error, so why does the cscope build fail? The error message is as follows: `sh cflags "optimize='-O2'" doop.o` doop.c CCCMD = cc…
thinke365
  • 1,305
  • 3
  • 14
  • 22
6
votes
1 answer

How to ignore struct declarations and consider only definitions in cscope?

I always use vim + cscope to check symbol definition, and I find cscope always take declaration like: struct sk_buff; as a definition, which make vim always show a long list files to choose. Indeed, I only want the definition: struct sk_buff { …
Sam Liao
  • 43,637
  • 15
  • 53
  • 61
5
votes
2 answers

E262: error reading cscope connection 0

I am using screens for coding using vim and cscope. when I leave the code for about 5 min (I mean go out for coffee etc) and start again. I can't use cscope again. I will get errors like: E262: error reading cscope connection 0 E257: cstag: tag not…
user1123008
  • 51
  • 1
  • 3
5
votes
2 answers

How to filter cscope output within Vim

I am looking for a way to grep the output of cscope queries from Vim. The following didn't work for me: :cs f s symbol !grep pattern It gave: E259: no matches found for cscope query s symbol !grep pattern ... P.S: I know the redir method, I am…
Aman Jain
  • 10,927
  • 15
  • 50
  • 63
5
votes
4 answers

Vi + Cscope: using "cscope find c function" in vim, finds multiple results, how to go next

When I used this command to search functions who call this function, if there are more than one result, only the first one showed in the buffer, how do I go to the next one with a vi command or shortcut keys?
tao
  • 251
  • 3
  • 13
5
votes
4 answers

OSX: Environment variables pointing to application bundles?

I want cscope to open files in MacVim instead of vim, so I'm trying to have the path to MacVim as the Value of the EDITOR environment variable which is used by cscope: $ export EDITOR=/Applications/MacVim.app/Contents/MacOS/MacVim If I'm now trying…
Benjamin Buch
  • 620
  • 7
  • 15
5
votes
3 answers

Vim picking up Cscope command instead of ctags?

I have installed ctags but not installed cscope. When I press Ctrl-], vim correctly takes me to the definition. However, when I press Ctrl-t, it replies back with error - "E567: no cscope connections". vim --version has +cscope in it. I tried…
1 2
3
17 18