Using cscope and cbrowser219
7.4Using cscope and cbrowser
The
cscope
is a very useful utility to browse through the source code tree of a large project. It
was originally written by Santa Cruz Operations and made public later on. You can download it
from http://cscope.sourceforge.net. For Linux, it is available in RPM format as well.
It is a text-mode screen-oriented utility. When you start it using the
cscope
command,
the initial screen looks like the one shown in Figure 7-1.
When invoked,
cscope
first creates its symbol file
cscope.out
in the current direc-
tory that contains a reference to symbols in source code files. This reference is generated from
files with the extensions
.c
and
.h
. You can also use command line options to create this sym-
bol file from a particular type of source code files.
The bottom part of the screen shows options that can be used to look up a symbol in the
source code. The cursor is blinking at the first option and can be moved to other options using
arrow keys. For example, if you want to look up symbol “
msg
” in all source code files, just type
it in at the first line and press the Enter key. You will see a listing of files containing this symbol
as shown in Figure 7-2.
Figure7-1 The cscope initial screen.