- cscope
-
cscope Stable release 15.7 / February 2, 2009 Operating system UNIX, Linux Type C and C++ programming tool License BSD License Website http://cscope.sourceforge.net/ cscope is a console mode or text-based graphical interface that allows computer programmers or software developers to search C source code (there is limited support for other languages). It is often used on very large projects to find source code, functions, declarations, definitions and regular expressions given a text string. cscope is free and available under a BSD License. The original developer of cscope is Joe Steffen.
Contents
History
The history of the tool goes back to the days of the PDP-11,[1] but it is still used by developers who are accustomed to using the vi or vim editor or other text-based editors (instead of GUI-based editors). The functionality within Cscope is available to varying degrees in modern graphical source editors.
Mode of use
cscope is used in two phases. First a developer builds the cscope database. The developer can often use
find
or other unix tools to get the list of filenames that they need to index into a file calledcscope.files
. The developer then builds a database using the commandcscope -b -q -k
. Second, the developer can now search those files using the commandcscope -d
. Often an index needs to be re-built whenever changes are made to files.In software development it is often very useful to be able to find the callers of a function because this is the way to understand how code works and what other parts of the program expect from a function. cscope can find the callers and callees of functions, but it is not a compiler and it does that by searching the text for keywords. This has the disadvantages that macros and duplicate symbol names can generate an unclear graph. There are other programs that can extract this information by parsing the source code[2] or looking at the generated object files.[3]
cscope was created to search content within C files, but it can also be used (with some limitations) for C++ and Java files[4].
GUI
A GUI frontend called Kscope under KDE is available which in addition to easing the usage integrates the KATE text editor.[5]
A PyQT4 GUI frontend called Seascope is available which in addition to easing the usage integrates the scintilla text editor.[6]
CCTree is a native Vim Plugin that integrates with the Vim editor and offers functionalities similar to Kcsope and Seascope. [7]
See also
- ctags
- X-Ref
- LXR Cross Referencer - Web-based source code browsing with Hyperlinks.
- OpenGrok
References
- ^ The History of Cscope
- ^ ncc - The new generation C compiler
- ^ CodeViz: A CallGraph Visualiser
- ^ CScope home page: "The fuzzy parser supports C, but is flexible enough to be useful for C++ and Java[...]"
- ^ Kscope homepage
- ^ Seascope homepage
- ^ http://www.vim.org/scripts/script.php?script_id=2368
External links
- cscope's page on SourceForge (including a semi-detailed history)
- Source code navigation tools
Categories:- Code navigation tools
- Static program analysis tools
- Linux programming tools
- Unix programming tools
Wikimedia Foundation. 2010.