cscope无法索引代码树之外的软链接

2023-05-16

背景:为什么非要使用cscope?不用ctags?

尽管ctags可以索引软链接,但是,ctags不能查找“调用者”,比如:你想看看某个函数在哪些位置被调用了, .etc


1, 卸载cscope

2, 下载cscope源代码:

http://sourceforge.net/projects/cscope/files/cscope/15.8a/
p.s 我下载的15.8a,在debian sid使用正常

3, 修改如下:

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, 接下来就是通用的方法:

./configure
make -jN
sudo make install
5, 试试效果:
find -L . | grep -E '\.c$|\.h$|\.S$|\.cpp$|\.java$|\.lds$|\.ld*|\.chh$|\.cc$' > cscope.files
cscope -Rbqk
6, vim....

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

cscope无法索引代码树之外的软链接 的相关文章

  • unzip命令用法

    我使用过的Linux 命令之unzip 解压zip 文件 本文链接 xff1a http codingstandards javaeye com blog 792040 xff08 转载请注明出处 xff09 用途说明 zip 文件是一种常
  • System.in.read()的用法

    System in read 的用法 2007 10 25 22 00 24 分类 xff1a 默认分类 标签 xff1a 字号 大 中 小 订阅 用读取键盘输入必须构建 1 输入流 System in 2 字符输入流 InputStrea
  • django中的models的常用字段及属性

    django 模型models 常用字段 1 models AutoField 自增列 61 int 11 如果没有的话 xff0c 默认会生成一个名称为 id 的列 如果要显式的自定义一个自增列 xff0c 必须设置primary key
  • Ubuntu 20.04本地源使用(用apt-get 安装本地包)

    系统版本 xff1a Ubuntu 20 04 一 新建一个文件夹 xff0c 用于存放下载的某个 deb包 xff08 例 xff1a 2048 xff09 Tips 相关命令 xff1a mkdir 文件名 二 把本地的 deb包移动至
  • C++程序员经常问的11个问题

    下面的这些要点是对所有的C 43 43 程序员都适用的 我之所以说它们是最重要的 xff0c 是因为这些要点中提到的是你通常在C 43 43 书中或网站上无法找到的 如 xff1a 指向成员的指针 xff0c 这是许多资料中都不愿提到的地方
  • Ubuntu配置任意版本的apt-get镜像

    我们知道 xff0c 迄今为止 xff0c Ubuntu已有多个发行版 xff0c 如11 04 11 10 xff0c 以至于现在最新的16 而我们平常通过apt get来安装软件 xff0c 如果OS版本不同 xff0c 那么镜像源的配
  • 在APK中获取鸿蒙应用Ability信息

    Android开发工具箱大概在版本2 2 0 xff08 2021 06 10 xff09 就已经支持查看鸿蒙系统信息以及鸿蒙应用信息了 这里我讲一下Android开发工具箱是如何在Android应用中 xff08 APK xff09 获取

随机推荐