I'm using gvim/vim with cscope/ctags to find a symbol definition in the linux kernel. The source code is huge. when I want to search for the structure device with "tag device" command as example, vim will propose me hundred of occurrences. because it will propose global variable named device, structure's member that are named device. Is there anyway to improve this? Is it possible to tell vim/cscope/tag to look only for structure definition?
3
votes
My comment may not be directly related. I had used cscope but found lxr to be more convinent. So i would suggest to use lxr instead of cscope. You can also try out a web based lxr at lxr.free-electrons.com and get a feel of things
- Prajosh Premdas
If you want to move hand away from vim, then eclipse would be much powerful.
- Neo
I am not sure eclipse and Linux kernel will be good combination
- Prajosh Premdas
I have used it in the past. It tends to be slow on my i3 core cpu /3 GB ram. but then I was forced to work on virtual machine and it becomes impractical.
- Neo
1 Answers
1
votes
This, you might have known already. I narrow it down by cscope vim command
:cs f e struct device {
Please refer the usage of cscope vim commands
cscope commands:
add : Add a new database (Usage: add file|dir [pre-path] [flags])
find : Query for a pattern (Usage: find c|d|e|f|g|i|s|t name)
c: Find functions calling this function
d: Find functions called by this function
e: Find this egrep pattern
f: Find this file
g: Find this definition
i: Find files #including this file
s: Find this C symbol
t: Find assignments to
help : Show this message (Usage: help)
kill : Kill a connection (Usage: kill #)
reset: Reinit all connections (Usage: reset)
show : Show connections (Usage: show)