在源码目录下,运行
$ctags -R
在要搜索函数名处按ctrl+],跳转到函数定义代码部分
再点击ctrl+t返回函数调用处
生成cscope索引文件
$cscope -Rbkq
使vi关联cscope数据库
:cs add cscope.out
:cs show //查看关联数据库名
:cs add //添加一个新的数据库
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)
查找工程中的main函数
:cstag main
阅读(1765) | 评论(0) | 转发(0) |