When we use CSCOPE for a large project. Make Cscope parse all subdirectories, not just the current directory
Step 1: Generate a list of files to be scanned
In the project's top-level directory to build Cscope database. This command will inlcude every C source file in the project's directories in Cscope database
cscope -R
or
find /my/project/dir/* -type f \( -name *.c -o -name *.h \) > /my/project/dir/cscope.files
Will list all *.c files and .h files to list of files to be scanned
Step 2: Generate the Cscope database. Use command:
cscope -b -q -k # at the directory with 'cscope.files'
Step 3: Using this database with cscope command
Here i want to make Cscope parse all subdirectories in UNPV13e
$ cd unpv13e $ cscope -R
result as a picture
press ? for help
Here i want to find the definition of "daytimetcpcli.c" function:
Move to line "Find all function definitions" and type find g daytimetcpcli.c. Result follow
type Enter to view or edit this file