分页: 1 / 2
神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:01
由 dshbusiness
最近在看xorg,gtk,directfb的代码……每个代码都是重量级的选手……
然后以前从来没有用过任何源代码阅读软件……为了读代码……我用的是一下方法:
看到一个函数abcd,为了查到它的定义,在源代码目录下使用命令
grep -R abcd ./ | less
然后一行一行的看……
通常为了查一个函数的最终定义可能至少要用好几个小时……例如abcd调用了__abcd,__abcd又调用了__abcd_core……我就是这么一行一行查过来的……
今天看gtk和glib的代码……实在受不了了,想起网上经常有人搜源代码阅读软件,我原来一直以为就是文本编辑器之类的……今天抱着试试看的态度……搜索了一下,就发现了这个无比强大的工具——cscope!!!
我只要输入函数名,就可以帮我定位函数定义的文件和行数!太牛X了!
在这里感动的哭一会
向大家隆重推荐这个软件!另外谁要是还有更好的阅读源代码的解决方案,也跟帖发上来吧!
不知道算不算重复帖……希望别删
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:05
由 delectate
vim帝,来吧,给你们个吐槽的机会!
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:05
由 tenzu
不看代码的路过
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:30
由 Strange
delectate 写了:vim帝,来吧,给你们个吐槽的机会!
就算是vim也要借助cscope接口才能方便浏览代码的
ctags的跳转功能太差了
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:35
由 qingshi163
Strange 写了:delectate 写了:vim帝,来吧,给你们个吐槽的机会!
就算是vim也要借助cscope接口才能方便浏览代码的
ctags的跳转功能太差了
vim只是个文本编辑器,当然需要其他的工具来辅助。这不是linux的设计思想吗
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 17:53
由 BigSnake.NET
delectate 写了:vim帝,来吧,给你们个吐槽的机会!
vim 有 cscope 插件
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:30
由 dshbusiness
vim的插件是我心中永远的痛……完全不会用……
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:34
由 wangdu2002
楼主进步很快啊。。。唉,专业出身滴就是比某这样的初中农民强。。。至今还不会看源码。。。

Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:37
由 dshbusiness
wangdu2002 写了:楼主进步很快啊。。。唉,专业出身滴就是比某这样的初中农民强。。。至今还不会看源码。。。

某其实也是泥腿子出身……半路出家的……
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:40
由 adam8157
这adam@debian:~$ ai cscope
[sudo] password for adam:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
emacsen-common
Suggested packages:
cbrowser
The following NEW packages will be installed:
cscope emacsen-common
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 184kB of archives.
After this operation, 729kB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
为什么依赖这个!!!!!
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:40
由 delectate
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:45
由 dshbusiness
adaml 写了:这adam@debian:~$ ai cscope
[sudo] password for adam:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
emacsen-common
Suggested packages:
cbrowser
The following NEW packages will be installed:
cscope emacsen-common
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 184kB of archives.
After this operation, 729kB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
为什么依赖这个!!!!!
ai是什么命令???
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:46
由 JiangHui

应该是 apt-get install 的alias
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:49
由 dshbusiness
JiangHui 写了:
应该是 apt-get install 的alias
我安装的时候没提示那个东西
Re: 神一般的cscope!!!它拯救了我!!!
发表于 : 2010-04-07 19:57
由 dshbusiness
pocoyo 写了:lz 進步很神速可以試試 emacs

不行啊,试过至少3次……小指头受不了啊……