cscope無法索引代碼樹之外的軟連結解決 背景:為什麼非要使用cscope?不用ctags?
儘管ctags可以索引軟連結,但是,ctags不能尋找“調用者”,比如:你想看看某個函數在哪些位置被調用了, .etc 1, 卸載cscope2, 下載cscope原始碼:[html] http://sourceforge.net/projects/cscope/files/cscope/15.8a/ p.s 我下載的15.8a,在debian sid使用正常3, 修改如下:[html] 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] ./configure make -jN sudo make install 5, 試試效果:[html] find -L . | grep -E '\.c$|\.h$|\.S$|\.cpp$|\.java$|\.lds$|\.ld*|\.chh$|\.cc$' > cscope.files cscope -Rbqk 6, vim....