bsp_cscope_gen.py

http://wiki.freescale.net/display/MADTools/bsp_cscope_gen.py

 

What's CSCOPE?

If you don't know what's CSCOPE then you may be missing on one of the most productive tools there are for Linux kernel/driver development or U-boot driver development.

HERE is another wiki I wrote where you can learn more about CSCOPE and integration with vim or gvim.

DOWNLOAD:

Benefits of using bsp_cscope_gen.py

Why should I use bsp_cscope_gen.py considering that LTIB already offers an option to build the CSCOPE database?

  1. LTIB creates a super inefficient and large CSCOPE database file because it simply takes in consideration ALL of the Linux kernel code.
  2. As you know, Linux has been ported to many platforms and CPUs. If you build a brute force CSCOPE database and want to quickly check the definition of "board_init" function then CSCOPE will show you ALL of the "board_init" implementations: i.MXs, OMAPs, i386s, PowerPCs, etc.
  3. Wouldn't it be nice if CSCOPE will show me only the "board_init" implementation of the platform you are currently compiling for?
  4. Then bsp_cscope_gen.py is what you need.

bsp_cscope_gen.py generates the CSCOPE database exclusively from the files that were compiled. If a file is not compiled it will never show up during your code searches.

How to use bsp_cscope_gen.py?

bsp_cscope_gen.py can be used with Linux or U-boot code trees. Redboot is not supported yet.

Explanation for Linux kernel code tree:

Assume the following folder contains a compiled linux kernel tree:

/myfolder/with/linux

Assume the current directory is the same where bsp_cscope_gen.py is located.

$./bsp_cscope_gen.py /myfolder/with/linux

If everything went fine, the following files will be created under "/myfolder/with/linux":

cscope.files
cscope.out
cscope.out.in
cscope.out.po

Change your current working directory to  "/myfolder/with/linux" and VOILÁ. Now you execute CSCOPE directly, or better yet, integrate the CSCOPE database with vim.

To learn how to integrate CSCOPE with vim, check this tutorial I wrote.

Explanation for U-boot code tree:

Same as Linux case, but instead of specifying a Linux kernel tree directory you specify a U-boot code tree directory.

Example:

Let's assume you unpacked and compiled U-boot using LTIB, in a case like this your U-boot code tree will be located at something like:

..../ltib/rpm/BUILD/u-boot-2009.08

At the console execute:

$./bsp_cscope_gen.py ..../ltib/rpm/BUILD/u-boot-2009.08

If everything went fine, the following files will be created under "..../ltib/rpm/BUILD/u-boot-2009.08":

cscope.files
cscope.out
cscope.out.in
cscope.out.po

Change your current working directory to  "..../ltib/rpm/BUILD/u-boot-2009.08" and VOILÁ. Now you execute CSCOPE directly, or better yet, integrate the CSCOPE database with vim.

To learn how to integrate CSCOPE with vim, check this tutorial I wrote.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值