220Chapter7 • Miscellaneous Tools
As you can see, there are five files listed in the top part of the screen that contain this sym-
bol. This listing contains five columns as below:
1.
Number of row, starting with zero.
2.
File name that contains the symbol.
3.
Function name where symbol is used. If the symbol is not inside a function, it is
marked as global.
4.
Line number where symbol is present in that file.
5.
The line showing the definition or use of the symbol.
You can move the cursor to a particular line and press the Enter key to edit that file. By
default the file is opened in vi editor. However, you can configure to use an editor of your choice.
To move back to the bottom part of the screen to search for another symbol, you can use the Tab
key. Use the Ctrl+D key combination to quit the program.
The utility is also very useful if you want to find non-utilized code in a software project.
For example, if a function is present in the source code but never used anywhere in the project, it
can be detected using
cscope
. It is also useful when you want to modify a particular symbol
throughout the source code tree. Common options used with
cscope
are listed in Table 7-3.
Figure7-2 List of files with symbol msg.
Next Page >>
<< Previous Page
Back to the Table of Contents