LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 744|回复: 2

问个vim + cscope 查看源代码的问题

[复制链接]
发表于 2009-5-20 22:58:35 | 显示全部楼层 |阅读模式
http://paste.ubuntu.org.cn/i14974
以上是出错载图

操作记录
cd /usr/src ; make cscope
vim
:e drivers/core.c
cs find g list_for_each_entry_safe_reverse  出现的错误,好像因为相对路径造成的
cs find c list_for_each_entry_safe_reverse 虽列出很多文件,但选择后还是跳不过去
: pwd 显示的是
/usr/src/linux-2.6.29-tuxonice-r2/drivers/base

ctrl + ] 可以跳转,不过是我之前用绝对路径生成的
================================================
http://www.gentoo-cn.org/~zhangle/talk/view_source_using_vim.html
使用VIM分析源代码
Date:         2006-09-26
Version:         1.0
Authors:         张乐
发表于 2009-5-20 23:32:27 | 显示全部楼层
试试这个上面配置的vim IDE。
http://xdaqing.blogbus.com/logs/35987781.html
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-20 23:34:37 | 显示全部楼层
多谢, 我现在弄成绝对路戏就有搞头了
  1. #!/bin/bash
  2. #find . -name "*.[chsS]" -print > cscope.files
  3. #--------------------------------------------------------------------------------------------
  4. #find . -name "*.h" -o -name "*.c" -o -name "*.cc" -o -iname "*.cpp" > cscope.files
  5. #find `pwd` -name "*.h" -o -name "*.c" -o -name "*.cc" -o -iname "*.cpp" > cscope.files
  6. PWD_DIR=`pwd`
  7. find  ${PWD_DIR} -name "*.[chsS]" -print > cscope.files
  8. TMPDIR=/var/tmp cscope -bkq -i cscope.files
  9. #ctags -R
  10. TMPDIR=/var/tmp ctags -R --c++-kinds=+p --fields=+iaS --extra=+q `pwd`
  11. #--------------------------------------------------------------------------------------------
  12. #       0 或 s: 查找本 C 符号 查找C语言符号,即查找函数名、宏、枚举值等出现的地方
  13. #           1 或 g: 查找本定义  查找函数、宏、枚举等定义的位置,类似ctags所提供的功能
  14. #           2 或 d: 查找本函数调用的函数
  15. #           3 或 c: 查找调用本函数的函数
  16. #           4 或 t: 查找本字符串
  17. #           6 或 e: 查找本 egrep 模式  相当于egrep功能,但查找速度快多了
  18. #           7 或 f: 查找本文件 查找并打开文件,类似vim的find功能
  19. #           8 或 i: 查找包含本文件的文件
  20. #
  21. #--------------------------------------------------------------------------------------------
复制代码
  1. -rw-r--r--  1 root root 1.5M 05-20 23:24 cscope.files
  2. -rw-r--r--  1 root root 9.2M 05-16 12:02 vmlinux.o
  3. -rwxr-xr-x  1 root root  11M 05-16 12:02 vmlinux
  4. -rw-r--r--  1 root root  27M 05-20 23:27 cscope.in.out
  5. -rw-r--r--  1 root root 152M 05-20 23:27 cscope.po.out
  6. -rw-r--r--  1 root root 209M 05-16 15:42 tags
  7. -rw-r--r--  1 root root 220M 05-20 23:27 cscope.out
复制代码

用绝对路径来索引的,一直没试过相对路径正常的,也许跟 vimrc 有关吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表