What is cscope




















The -d flag tells Cscope not to regenerate the database which you already did in the previous step. Within the Cscope browser, type? The browser will show you a list of the searches you can perform in your code:.

Most of these should be self-explanatory. C symbols include pretty much anything that you can think of in a C file: function names, variable names, things that are define 'd, etc. You can search for all instances of a symbol, or find its original definition. Cscope can find all of the functions that call a particular function, which can be extremely useful; this is a feature of Cscope that other tools like Ctags do not have. If you find that the C symbol and function searches do not find what you are looking for, you can fall back to the text search options at the bottom of the list.

Select the type of search that you'd like to perform, type in your search term and hit Enter. At the top of the screen Cscope will display a list of results with the file, function, and line where the search term was found. If you select one of these results and hit Enter, Cscope will open up the editor to the matching line in the file. You can manipulate the file as you please, and when you close it the browser will appear again. When you're finished, press Ctrl-d to exit.

When using Cscope on forkbomb , I've noticed some weirdness with searches being executed as case-sensitive when they shouldn't be, or vice-versa. If Cscope is returning no results from your search when you expect that there should be some, try toggling case-sensitive mode by pressing Ctrl-c inside of the Cscope browser you'll see a toggle message at the top of the window. After making modifications to your source code, the cscope database will become out of sync, so you can periodically regenerate the database by running the find and cscope commands again.

When searching for "global definitions," sometimes Cscope will return multiple definitions, which is annoying. It appears that many forward declarations i. See the Cscope man page and help page press? For example:. For more information on executing Cscope commands from directly within your editor especially vi , see the list of resource links at the top of this tutorial.

Cscope along with Ctags is an invaluable tool for navigating through the Linux kernel code that is used in project 1. This binary should work on any version of Windows 3. Windows NT and users also have the option of running Cscope under the CygWin toolkit , which provides a curses emulation library among other goodies.

Once Cygwin are installed on your system, you can compile and run Cscope just as if you were on a normal operating system i. Downloads If you experience problems with the latest release version, please try the latest top of tree code. If that doesn't work, please check our bug database, and add a new bug report if you don't see your problem listed.

Latest release: Bug fixes, egrep. Mainly bug fixes. Improvements, major bug fixes, XEmacs, Vim and web interface support. It is available for cscope, as well as cs. It is now available on sourceforge. Cscope is a developer's tool for browsing source code. Sources are available over at Sourceforce.

Vim integration Note: NOT in Debian's case If your version of Vim wasn't compiled with '--enable-cscope', you will need to reconfigure and recompile Vim with that flag.

You can check if your version of Vim is compiled with the cscope flag by issuing the following command: vim --version grep "cscope". Go into a directory with some C code in it, and enter cscope -R the '-R' makes Cscope parse all subdirectories, not just the current directory. This will build the Cscope database and drop you into Cscope's default text user interface. Move with the arrow keys and hit any of the numbers displayed on the left side to jump into Vim at the specified symbol location.



0コメント

  • 1000 / 1000