免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: shoecat
打印 上一主题 下一主题

Linux下编程如何查询某个结构体的信息? [复制链接]

论坛徽章:
0
1 [报告]
发表于 2006-07-14 10:21 |显示全部楼层
请教assiss 大哥.
执行cs add cscope.out
发生
duplicate cscope database not added错误是怎么个事?

论坛徽章:
0
2 [报告]
发表于 2006-07-14 10:46 |显示全部楼层
还一个问题.换了路径就不好用了怎么个事?

论坛徽章:
0
3 [报告]
发表于 2006-07-14 10:52 |显示全部楼层
1   2642  /usr/include/glib-1.2/glib.h <<getpid>>
             #define getpid _getpid
   2    109  /usr/include/mysql/my_pthread.h <<getpid>>
             #define getpid() GetCurrentThreadId()
   3    108  /usr/include/mysql3/mysql/my_pthread.h <<getpid>>
             #define getpid() GetCurrentThreadId()
   4     27  /usr/include/php/main/win95nt.h <<getpid>>
             #define getpid _getpid
   5    257  /usr/include/pm_config.h <<getpid>>
             #define getpid() ((pid_t)FindTask(NULL))
   6    549  /usr/include/unistd.h <<getpid>>
             extern __pid_t getpid (void ) __THROW;
   7    105  /usr/include/wvstreams/wvpipe.h <<getpid>>
             int getpid() const { return proc.pid; };
   8    257  pm_config.h <<getpid>>
             #define getpid() ((pid_t)FindTask(NULL))
   9    549  unistd.h <<getpid>>
             extern __pid_t getpid (void ) __THROW;

第9个不是决定路径怎么个事?

论坛徽章:
0
4 [报告]
发表于 2006-07-14 11:06 |显示全部楼层
第一个问题是绝对路径的问题,我解决了.
cs add /usr/include/cscope.out

论坛徽章:
0
5 [报告]
发表于 2006-07-14 11:10 |显示全部楼层
第二个问题
cd /usr/include
find /usr/include -name '*.h' >cscope.files
cscope -b
cd /home
vi aaa
cs add /usr/include/cscope.out

tag getpid
出现了以下的结果
Cscope tag: getpid
   #   line  filename / context / line
   1   2642  /usr/include/glib-1.2/glib.h <<getpid>>
             #define getpid _getpid
   2    109  /usr/include/mysql/my_pthread.h <<getpid>>
             #define getpid() GetCurrentThreadId()
   3    108  /usr/include/mysql3/mysql/my_pthread.h <<getpid>>
             #define getpid() GetCurrentThreadId()
   4     27  /usr/include/php/main/win95nt.h <<getpid>>
             #define getpid _getpid
   5    257  /usr/include/pm_config.h <<getpid>>
             #define getpid() ((pid_t)FindTask(NULL))
   6    549  /usr/include/unistd.h <<getpid>>
             extern __pid_t getpid (void ) __THROW;
   7    105  /usr/include/wvstreams/wvpipe.h <<getpid>>
             int getpid() const { return proc.pid; };
   8    257  pm_config.h <<getpid>>
             #define getpid() ((pid_t)FindTask(NULL))
   9    549  unistd.h <<getpid>>
             extern __pid_t getpid (void ) __THROW;

8,9都不是绝对路径
按9
造成了按就就显示
E429: File "unistd.h" does not exist
E257: cstag: tag not found
怎么个事?

论坛徽章:
0
6 [报告]
发表于 2006-07-14 11:11 |显示全部楼层
原帖由 assiss 于 2006-7-14 11:10 发表

你不会是:
cd /usr/include
find . -name "*.h" >cscope.files
cscope -b
吧?


find /usr/include -name "*.h" >cscope.files

我是这样做的.

论坛徽章:
0
7 [报告]
发表于 2006-07-14 11:22 |显示全部楼层
都是绝对路径

论坛徽章:
0
8 [报告]
发表于 2006-07-14 11:29 |显示全部楼层
不放在/usr/include下就好用了.多谢多谢多谢了

论坛徽章:
0
9 [报告]
发表于 2006-07-14 11:38 |显示全部楼层
还有一个问题.我把cs add /home/cscope.out加到~/.vimrc里,vi打开文件的时候显示Added cscope database /home/cscope.out
Hit ENTER or type command to continue能不能不让它显示啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP