Difference between revisions of "Cscope plugin"

From Code::Blocks
(Add instructions to installing cscope)
m (→‎Installing CScope: Add a missing dot.)
 
(4 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
   developer = Daniel Anselmi |
 
   developer = Daniel Anselmi |
 
   maintainer = |
 
   maintainer = |
   version = 0.2
+
   version = 0.3
 
}}
 
}}
  
 
== General information ==
 
== General information ==
  
This plugin integrates the source code searching features of [http://cscope.sourceforge.net/ Cscope] into Code::Blocks (a Windows build is available at [http://code.google.com/p/cscope-win32/ Cscope-win32]). Cscope is especial useful on large projects, and can search for:
+
This plugin integrates the source code searching features of [http://cscope.sourceforge.net/ Cscope] into Code::Blocks (a Windows build is available at [http://code.google.com/p/cscope-win32/ Cscope-win32]). Cscope is especially useful on large projects, and can search for:
 
* all references to a symbol
 
* all references to a symbol
 
* global definitions
 
* global definitions
Line 20: Line 20:
 
* files including a file
 
* files including a file
 
Although the parser within Cscope is targeted at C, it retains enough flexibility to provide functionality with C++ (and Java) code.
 
Although the parser within Cscope is targeted at C, it retains enough flexibility to provide functionality with C++ (and Java) code.
 
 
 
== Installing CScope ==
 
== Installing CScope ==
This instruction is for codeblocks SVN Version > 11828
+
This instruction is for codeblocks SVN Version > 11828.
 
=== Linux ===
 
=== Linux ===
Under Linux installing cscope should be as easy as calling your favorite package manager and installing cscope. Codeblocks should find the executable by default. If it can not find the cscope executable please set it in Settings->Environement->CScope . You can find the path to the cscope executable by typing <code>locate cscope</code> in your favorite terminal
+
Under Linux installing cscope should be as easy as calling your favorite package manager and installing cscope. Codeblocks should find the executable by default. If it can not find the cscope executable please set it in Settings->Environement->CScope . You can find the path to the cscope executable by typing <code>locate cscope</code> in your favorite terminal.
  
 
=== Windows ===
 
=== Windows ===
it is hard to find a precompiled binary for cscope on windows. The easiest solution is to install msys2 [[https://www.msys2.org/]]. Follow the instruction on the website to install msys2. After installing and updating as described open the msys terminal and type  <code>pacman -S cscope</code>. This will install cscope from the global package repository.  
+
It is hard to find a precompiled binary for cscope on windows. The easiest solution is to install msys2 [https://www.msys2.org/]. Follow the instruction on the website to install msys2. After installing and updating as described open the msys terminal and type  <code>pacman -S cscope</code>. This will install cscope from the global package repository.  
  
 
Now you have to setup codeblocks:
 
Now you have to setup codeblocks:
Line 34: Line 32:
 
# Settings->Environment->CScope
 
# Settings->Environment->CScope
 
# Press the button with the <code>...</code> dots
 
# Press the button with the <code>...</code> dots
# Search the ''cscope.exe'' executable. It is probably under <code>INSTALL_DIRECTORY_OD_MSYS2\usr\bin\cscope.exe</code>
+
# Search the ''cscope.exe'' executable. It is probably under <code>INSTALL_DIRECTORY_OF_MSYS2\usr\bin\cscope.exe</code>
 
# Close the dialog with OK
 
# Close the dialog with OK
 
# Now you should be able to use the cscope functions in codeblocks (for ex. "Find functions calling XXXX").
 
# Now you should be able to use the cscope functions in codeblocks (for ex. "Find functions calling XXXX").

Latest revision as of 14:07, 20 May 2023

Cscope
Generic-plugin.png
Developer(s): Daniel Anselmi
Maintainer(s):
Version: 0.3

General information

This plugin integrates the source code searching features of Cscope into Code::Blocks (a Windows build is available at Cscope-win32). Cscope is especially useful on large projects, and can search for:

  • all references to a symbol
  • global definitions
  • functions called by a function
  • functions calling a function
  • text string
  • regular expression pattern
  • a file
  • files including a file

Although the parser within Cscope is targeted at C, it retains enough flexibility to provide functionality with C++ (and Java) code.

Installing CScope

This instruction is for codeblocks SVN Version > 11828.

Linux

Under Linux installing cscope should be as easy as calling your favorite package manager and installing cscope. Codeblocks should find the executable by default. If it can not find the cscope executable please set it in Settings->Environement->CScope . You can find the path to the cscope executable by typing locate cscope in your favorite terminal.

Windows

It is hard to find a precompiled binary for cscope on windows. The easiest solution is to install msys2 [1]. Follow the instruction on the website to install msys2. After installing and updating as described open the msys terminal and type pacman -S cscope. This will install cscope from the global package repository.

Now you have to setup codeblocks:

  1. Open Codeblocks
  2. Settings->Environment->CScope
  3. Press the button with the ... dots
  4. Search the cscope.exe executable. It is probably under INSTALL_DIRECTORY_OF_MSYS2\usr\bin\cscope.exe
  5. Close the dialog with OK
  6. Now you should be able to use the cscope functions in codeblocks (for ex. "Find functions calling XXXX").