1:使用cscope在开始之前需要对整个文件工程使用命令
i@ubuntu:~/work/linux-5.1.7$ cscope -Rbq
2: 用vim打开任一一个本工程的文件,然后需要先生成对应文件的数据库(好烦。。。。)
我用vim打开一个文件之后没用add 命令添加数据库,导致出现错误
切记,对于之前没有用过cscope的人来说,连输入命令怎么输入都蹑手蹑脚的,
用vim打开,输入冒号 ":" ,这样从vim编辑界面的底部就可以看到冒号":"
输入cscope命令 :cs find g funname
示例如下
感觉每打开一个文件就要add一次所谓的数据库,真的好麻烦
/* toshiba.c -- Linux driver for accessing the SMM on Toshiba laptops
*
* Copyright (c) 1996-2001 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
*
* Valuable assistance and patches from:
* Tom May <tom@you-bastards.com>
* Rob Napier <rnapier@employees.org>
*
* Fn status port numbers for machine ID's courtesy of
* 0xfc02: Scott Eisert <scott.e@sky-eye.com>
* 0xfc04: Steve VanDevender <stevev@efn.org>
* 0xfc08: Garth Berry <garth@itsbruce.net>
* 0xfc0a: Egbert Eich <eich@xfree86.org>
* 0xfc10: Andrew Lofthouse <Andrew.Lofthouse@robins.af.mil>
* 0xfc11: Spencer Olson <solson@novell.com>
* 0xfc13: Claudius Frankewitz <kryp@gmx.de>
* 0xfc15: Tom May <tom@you-bastards.com>
* 0xfc17: Dave Konrad <konrad@xenia.it>
* 0xfc1a: George Betzos <betzos@engr.colostate.edu>
* 0xfc1b: Munemasa Wada <munemasa@jnovel.co.jp>
* 0xfc1d: Arthur Liu <armie@slap.mine.nu>
* 0xfc5a: Jacques L'helgoualc'h <lhh@free.fr>
:cs find g reader_detach
下面是错误
/* toshiba.c -- Linux driver for accessing the SMM on Toshiba laptops
*
* Copyright (c) 1996-2001 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
*
* Valuable assistance and patches from:
* Tom May <tom@you-bastards.com>
* Rob Napier <rnapier@employees.org>
*
* Fn status port numbers for machine ID's courtesy of
* 0xfc02: Scott Eisert <scott.e@sky-eye.com>
* 0xfc04: Steve VanDevender <stevev@efn.org>
* 0xfc08: Garth Berry <garth@itsbruce.net>
* 0xfc0a: Egbert Eich <eich@xfree86.org>
* 0xfc10: Andrew Lofthouse <Andrew.Lofthouse@robins.af.mil>
* 0xfc11: Spencer Olson <solson@novell.com>
* 0xfc13: Claudius Frankewitz <kryp@gmx.de>
* 0xfc15: Tom May <tom@you-bastards.com>
* 0xfc17: Dave Konrad <konrad@xenia.it>
* 0xfc1a: George Betzos <betzos@engr.colostate.edu>
* 0xfc1b: Munemasa Wada <munemasa@jnovel.co.jp>
* 0xfc1d: Arthur Liu <armie@slap.mine.nu>
* 0xfc5a: Jacques L'helgoualc'h <lhh@free.fr>
E567: no cscope connections 1,1 Top
用add添加所谓的数据库
/* toshiba.c -- Linux driver for accessing the SMM on Toshiba laptops
*
* Copyright (c) 1996-2001 Jonathan A. Buzzard (jonathan@buzzard.org.uk)
*
* Valuable assistance and patches from:
* Tom May <tom@you-bastards.com>
* Rob Napier <rnapier@employees.org>
*
* Fn status port numbers for machine ID's courtesy of
* 0xfc02: Scott Eisert <scott.e@sky-eye.com>
* 0xfc04: Steve VanDevender <stevev@efn.org>
* 0xfc08: Garth Berry <garth@itsbruce.net>
* 0xfc0a: Egbert Eich <eich@xfree86.org>
* 0xfc10: Andrew Lofthouse <Andrew.Lofthouse@robins.af.mil>
* 0xfc11: Spencer Olson <solson@novell.com>
* 0xfc13: Claudius Frankewitz <kryp@gmx.de>
* 0xfc15: Tom May <tom@you-bastards.com>
* 0xfc17: Dave Konrad <konrad@xenia.it>
* 0xfc1a: George Betzos <betzos@engr.colostate.edu>
* 0xfc1b: Munemasa Wada <munemasa@jnovel.co.jp>
* 0xfc1d: Arthur Liu <armie@slap.mine.nu>
* 0xfc5a: Jacques L'helgoualc'h <lhh@free.fr>
:cs add cscope.out
输入了命令之后也就是
:cs add cscope.out
点击 按键上的确定“enter” 这条命令也不会消失
需要再次点击一下“enter”,这条命令才消失
这样才可以用cscope的其他命令
并且书本或者网上说的 c命令,查找C语言符号 查找函数名,宏,枚举出现的地方
一直不明白是什么异常,什么叫C语言符号?是sizeof这些吗?int这些吗?
不会用,不会用,不好用,不好用。