Error condition:
have been using Cscope to read the source code, during the encounter found a function/variable definition, but jump not past the situation, the hint "File." /xxxx/yyyy.c "There are no such errors. Workaround:
This problem occurs because the relative path is used when we use CSCOPE-RBQ to generate the Cscope.out file. The solution is also simple, using an absolute path when generating. Cscope Official provides a solution: Use the Cscope.files file to generate the Cscope.out file.
The Cscope.files content is all the filenames that need to be indexed. Like this:
As for how to generate the file, the simplest way is to use the Find command to list all eligible files and redirect them to Cscope.files. For example, find/-name *.c >> cscope.files. Of course, you can also write a simple shell or Python script to generate (at the end of the source code for Python scripts, in the need to generate Cscope.files directory to execute).
With Cscope.files, we can run CSCOPE-BQK. The problem with this relative path is solved.
Simple Python script:
#!/bin/python
import os
save_file = open ("Cscope.files", ' W ')
for Root, dirs, list in Os.walk ("./"):
For I in list:
Cur_path = Os.path.abspath (root)
File_path = Cur_path + '/' + I
save_file.write (file_path+ ' \ n ') )
Save_file.close ()