神一般的cscope!!!它拯救了我!!!

仅仅用于软件推荐,不适合发求软件或软件使用问题方面的贴子
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

神一般的cscope!!!它拯救了我!!!

#1

帖子 dshbusiness » 2010-04-07 17:01

最近在看xorg,gtk,directfb的代码……每个代码都是重量级的选手……
然后以前从来没有用过任何源代码阅读软件……为了读代码……我用的是一下方法:
看到一个函数abcd,为了查到它的定义,在源代码目录下使用命令
grep -R abcd ./ | less
然后一行一行的看……
通常为了查一个函数的最终定义可能至少要用好几个小时……例如abcd调用了__abcd,__abcd又调用了__abcd_core……我就是这么一行一行查过来的……
今天看gtk和glib的代码……实在受不了了,想起网上经常有人搜源代码阅读软件,我原来一直以为就是文本编辑器之类的……今天抱着试试看的态度……搜索了一下,就发现了这个无比强大的工具——cscope!!!
我只要输入函数名,就可以帮我定位函数定义的文件和行数!太牛X了!
在这里感动的哭一会 :em19 :em19 :em19 :em19 :em19 :em19 :em19 :em19
向大家隆重推荐这个软件!另外谁要是还有更好的阅读源代码的解决方案,也跟帖发上来吧!
不知道算不算重复帖……希望别删
delectate
帖子: 18311
注册时间: 2008-01-09 22:41

Re: 神一般的cscope!!!它拯救了我!!!

#2

帖子 delectate » 2010-04-07 17:05

vim帝,来吧,给你们个吐槽的机会!
头像
tenzu
论坛版主
帖子: 36924
注册时间: 2008-11-21 20:26

Re: 神一般的cscope!!!它拯救了我!!!

#3

帖子 tenzu » 2010-04-07 17:05

不看代码的路过
头像
Strange
帖子: 1824
注册时间: 2006-05-19 9:54
来自: Shanghai

Re: 神一般的cscope!!!它拯救了我!!!

#4

帖子 Strange » 2010-04-07 17:30

delectate 写了:vim帝,来吧,给你们个吐槽的机会!
就算是vim也要借助cscope接口才能方便浏览代码的
ctags的跳转功能太差了
ニンニク入れますか?
x60 with gentoo
头像
qingshi163
帖子: 275
注册时间: 2007-12-16 0:45

Re: 神一般的cscope!!!它拯救了我!!!

#5

帖子 qingshi163 » 2010-04-07 17:35

Strange 写了:
delectate 写了:vim帝,来吧,给你们个吐槽的机会!
就算是vim也要借助cscope接口才能方便浏览代码的
ctags的跳转功能太差了
vim只是个文本编辑器,当然需要其他的工具来辅助。这不是linux的设计思想吗
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

Re: 神一般的cscope!!!它拯救了我!!!

#6

帖子 BigSnake.NET » 2010-04-07 17:53

delectate 写了:vim帝,来吧,给你们个吐槽的机会!
vim 有 cscope 插件
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

Re: 神一般的cscope!!!它拯救了我!!!

#7

帖子 dshbusiness » 2010-04-07 19:30

vim的插件是我心中永远的痛……完全不会用……
头像
wangdu2002
帖子: 13284
注册时间: 2008-12-13 19:39
来自: 物华天宝人杰地灵

Re: 神一般的cscope!!!它拯救了我!!!

#8

帖子 wangdu2002 » 2010-04-07 19:34

楼主进步很快啊。。。唉,专业出身滴就是比某这样的初中农民强。。。至今还不会看源码。。。 :em03
行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

Re: 神一般的cscope!!!它拯救了我!!!

#9

帖子 dshbusiness » 2010-04-07 19:37

wangdu2002 写了:楼主进步很快啊。。。唉,专业出身滴就是比某这样的初中农民强。。。至今还不会看源码。。。 :em03
某其实也是泥腿子出身……半路出家的……
头像
adam8157
帖子: 2794
注册时间: 2009-03-05 16:31
联系:

Re: 神一般的cscope!!!它拯救了我!!!

#10

帖子 adam8157 » 2010-04-07 19:40

这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.

为什么依赖这个!!!!!
delectate
帖子: 18311
注册时间: 2008-01-09 22:41

Re: 神一般的cscope!!!它拯救了我!!!

#11

帖子 delectate » 2010-04-07 19:40

emacsen-common
rpwt
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

Re: 神一般的cscope!!!它拯救了我!!!

#12

帖子 dshbusiness » 2010-04-07 19:45

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是什么命令???
JiangHui
论坛版主
帖子: 21308
注册时间: 2007-08-02 20:29
系统: 窓辺とうこ

Re: 神一般的cscope!!!它拯救了我!!!

#13

帖子 JiangHui » 2010-04-07 19:46

:em06 应该是 apt-get install 的alias
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

Re: 神一般的cscope!!!它拯救了我!!!

#14

帖子 dshbusiness » 2010-04-07 19:49

JiangHui 写了::em06 应该是 apt-get install 的alias
:em20
我安装的时候没提示那个东西
dshbusiness
帖子: 1831
注册时间: 2009-04-03 15:10

Re: 神一般的cscope!!!它拯救了我!!!

#15

帖子 dshbusiness » 2010-04-07 19:57

pocoyo 写了:lz 進步很神速可以試試 emacs :lol:
不行啊,试过至少3次……小指头受不了啊……
回复