Use vim / cscope to find the definition of a symbol in the linux kernel

I am using gvim / vim with cscope / ctags to find the definition of a symbol in the linux kernel. The source code is huge. when I want to find a structured device with the "tag device" command as an example, vim will offer me hundreds of entries. because it will offer a global variable named device, a member of a structure called device. Is there a way to improve this? Is it possible to tell vim / cscope / tag to see only the structure definition?

+3


source to share


1 answer


You probably already know this. I judge it by the cscope vim team

:cs f e struct device {

      



Please refer to the use 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)

      

+1


source







All Articles