cscope无法索引代码树之外的软链接
2014-03-25 14:19
309 查看
http://blog.csdn.net/sudolee/article/details/9052291
背景:为什么非要使用cscope?不用ctags?
尽管ctags可以索引软链接,但是,ctags不能查找“调用者”,比如:你想看看某个函数在哪些位置被调用了, .etc
1, 卸载cscope
2, 下载cscope源代码:
[html] view plaincopy
http://sourceforge.net/projects/cscope/files/cscope/15.8a/
p.s 我下载的15.8a,在debian sid使用正常
3, 修改如下:
[html] view plaincopy
diff --git a/src/dir.c b/src/dir.c
index cf9330d..e73d86f 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -651,7 +651,7 @@ accessible_file(char *file)
if (access(compath(file), READ) == 0) {
struct stat stats;
- if (lstat(file, &stats) == 0
+ if (stat(file, &stats) == 0
&& S_ISREG(stats.st_mode)) {
return YES;
}
原因如下: man stat
stat() stats the file pointed to by path and fills in buf.
lstat() is identical to stat(), except that if path is a symbolic
link, then the link itself is stat-ed, not the file that it refers to.
4, 接下来就是通用的方法:
[html] view plaincopy
./configure
make -jN
sudo make install
5, 试试效果:
[html] view plaincopy
find -L . | grep -E '\.c$|\.h$|\.S$|\.cpp$|\.java$|\.lds$|\.ld*|\.chh$|\.cc$' > cscope.files
cscope -Rbqk
6, vim....
编译过程中可能碰到的问题:
sudo apt-get install libncursesw5-dev
sudo apt-get install libncurses5-dev
sudo apt-get install byacc
sudo apt-get install flex
背景:为什么非要使用cscope?不用ctags?
尽管ctags可以索引软链接,但是,ctags不能查找“调用者”,比如:你想看看某个函数在哪些位置被调用了, .etc
1, 卸载cscope
2, 下载cscope源代码:
[html] view plaincopy
http://sourceforge.net/projects/cscope/files/cscope/15.8a/
p.s 我下载的15.8a,在debian sid使用正常
3, 修改如下:
[html] view plaincopy
diff --git a/src/dir.c b/src/dir.c
index cf9330d..e73d86f 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -651,7 +651,7 @@ accessible_file(char *file)
if (access(compath(file), READ) == 0) {
struct stat stats;
- if (lstat(file, &stats) == 0
+ if (stat(file, &stats) == 0
&& S_ISREG(stats.st_mode)) {
return YES;
}
原因如下: man stat
stat() stats the file pointed to by path and fills in buf.
lstat() is identical to stat(), except that if path is a symbolic
link, then the link itself is stat-ed, not the file that it refers to.
4, 接下来就是通用的方法:
[html] view plaincopy
./configure
make -jN
sudo make install
5, 试试效果:
[html] view plaincopy
find -L . | grep -E '\.c$|\.h$|\.S$|\.cpp$|\.java$|\.lds$|\.ld*|\.chh$|\.cc$' > cscope.files
cscope -Rbqk
6, vim....
编译过程中可能碰到的问题:
sudo apt-get install libncursesw5-dev
sudo apt-get install libncurses5-dev
sudo apt-get install byacc
sudo apt-get install flex
相关文章推荐
- python 点滴记录4:TypeError: range() integer end argument expected, got str.
- 关于 java注解 问题
- [转载] Spring3.1 Cache注解
- php笔记:单例模式
- c# 写入读取Cookie值
- 运行Java程序的参数
- 浅学JAVA类加载
- 类加载--- JAVA动态性
- C#制作源代码的帮助文档 chm帮助文档 C#类库帮助文档生成
- 学习java从length和length()开始
- Java的方法参数的传递
- 处理java错误”编码 GBK 的不可映射字符“
- 关于c++ vector和map的遍历和删除对象
- java学习——内部类、匿名内部类
- windows7下c++11环境搭建
- JAVA 之JDK1.5新特性和反射机制!
- Qt提示QPainter::begin: Paint device returned engine == 0, type:0/1/2/3...,type数值代表什么
- java实现附件预览(openoffice+swfTools+FlexPaper) (转载)
- Java的单例模式7种写法
- PHP中超全局变量$GLOBALS和global的区别