I want to be familiar with cscope. So i read a Blog which gives a simple example and followed it step by step.
But I failed to complete it successfully.
When I typed :cs find g InFile_Open
, it jumped into another file which is expected, but nothing shows was unexpected.
Seemed like that it create a new file.
And it supposed to show me the file 7zFile.c which holds the only definition of InFile_Open symbol as described by that blog.
Like this
And the same thing happened when i typed
:cs find g PrintError
It supposed to show me a list of definition and asked me to choose one
Cscope tag: PrintError
# line filename / context / line
1 261 C/Util/7z/7zMain.c <<PrintError>>
void PrintError(char *sz)
2 33 C/Util/Lzma/LzmaUtil.c <<PrintError>>
int PrintError(char *buffer, const char *message)
3 86 CPP/7zip/UI/Client7z/Client7z.cpp <<PrintError>>
static void PrintError(const char *message, const FString &name)
4 94 CPP/7zip/UI/Client7z/Client7z.cpp <<PrintError>>
static void PrintError(const AString &s)
Type number and <Enter> (empty cancels):
But it jumped directly into the corresponding file ,leaving me no choice, but show nothing just like above.
Besides, I hit ctrl + t
for going back to previous file , but vim showed me
E73: tag stack empty
How can I fix this?
P.S. (cscope version:15.8b and my cscope settings for vim)
if has("cscope")
set csprg=/usr/local/bin/cscope
set csto=0
set cscopetag
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
endif