Next: , Previous: ID Utils, Up: Top


15 CScope

Several tools in CEDET can support the use of CScope. If you use CScope in your project, you can enable the use of it to enhance or speed up various tools in CEDET.

You can download CScope from http://cscope.sourceforge.net/

To make sure your CScope installation is good, use the command

     M-x cedet-cscope-version-check RET

You can wrap any CEDET / CScope configurations in your .emacs file like this:

     (when (cedet-cscope-version-check t)  ; Is it ok?
         ;; Configurations for CScope and CEDET.
         )

15.1 Detecting CScope

CScope is detected by the presense of a cscope.out file at the ROOT of your current project, as specified by EDE. CScope the program supports multiple cscope.out files spread out through your project, but this is not detected by CEDET. It will also use a cscope.out in the same directory as your sources if you do not use EDE

If you use CScope and need this feature, please consider fixing it. Contact the cedet-devel mailing list.

15.2 EDE and CScope

The EDE project system can use CScope to accelerate finding files within a project. The EDE command to ede-find-file bound to C-c . f is one direct application. semantic also makes heavy use of of the feature to find header files for C and C++.

To enable it, configure the variable ede-locate-setup-options. Something like this can work in your .emacs file.

     (setq ede-locate-setup-options
           '(ede-locate-cscope
             ede-locate-base))

15.3 semantic Database

semantic can use CScope as a back end for database searches. To enable it, use:

     (semanticdb-enable-cscope-databases)

This will enable the use of cscope for all C and C++ buffers.

CScope will then be used for project-wide searches as a backup when pre-existing semantic database searches may not have parsed all your files.

15.4 semantic

The semantic symref tool can use CScope to local symbol references. This tool will automatically detect CScope and use it. You can search for references via the commands:

semantic-symref
Find references to the tag under the cursor.
semantic-symref-symbol
Find references to an arbitrary symbol.