Somebody may have difficulty in reading source code of hotspot. I give my practice here:
1. get src from clearcase
2. cd $HOTSPOT/Src/src/
3. generate cscope.files:
find . -path '/./os/hp-ux/*' /
-o -path '/./os_cpu/hp-ux_ia64/*' /
-o -path '/./cpu/ia64/*' /
-o -path '/./share/*' /
| grep '/.[ch]p/?p/?$' > cscope.files
4. generate cscope.out:
cscope -b -q -k
-b: tells Cscope to just build the database, and not launch the Cscope GUI
-q: causes an additional, 'inverted index' file to be created, which makes searches run much faster for large databases.
-k: sets Cscope's 'kernel' mode--it will not look in /usr/include for any header files that are #included in your source files (this is mainly useful when you are using Cscope with operating system and/or C library source code, as we are here).
5. vim -t main
Reference:
http://cscope.sourceforge.net/cscope_vim_tutorial.html
本文分享了阅读HotSpot源代码的实践经验,包括如何获取源码、使用cscope工具生成索引文件,并通过Vim进行高效浏览。适用于希望深入了解HotSpot内部实现的开发者。
4632

被折叠的 条评论
为什么被折叠?



