Monday, February 18, 2008

CScopeFinder, JEdit Plugin for Rapid Code Searching

I use JEdit as my "support" IDE. Sometime I can't do all things in main IDE and sometime situation require side-by-side comparison. There are the kind of situation, among others, that I use JEdit for. It requires me to setup plugins that help in searching symbols and tracing relationships. One of them is CScopeFinder.

The setup is using a very nice built-in PluginManager in Jedit, you just need to look for CScopeFinder and install it. The tricky part is on cscope binary dependencies (the root of source tree to be searched need to be run "cscope -b -c -R" first). In Windows I use cscope binary from here. It has some bugs that confuse me at first but, long story short, it turned out that it has bugs in outputting root path of the resulting csope.out : it add double quote after that path with no matching double quote before. The first line looks like something like this :

cscope 16 e:\the\path\here" ....

I just need to edit the file, delete the offending double quote and it is usable afterwards.

The usage is not as tricky as the installation though : just select the symbol you like to search (double click on the word will do), right click and choose "Find This C Symbol" and the result will popup which has more contextual information then generic searching. It also has "Cscope Stack" window where it keep the result of it's finding to be refered to more conviniently.

I usually use it in combination with the, also very powerful, built-in HyperSearch in JEdit.

I find this plugin quite handy when I work through unfamiliar code which I have to refer to without opening up another instance of IDE just to get the cross searching capability or adding more burden to the already-crowded currently running IDE. It's a bit outdated (the plugin as well as the csope-win32) but still useful nonetheless.

1 comment:

Unknown said...

The Cscope for Win32 found here
has no problem on the double quote you mentioned. Give it a try.
However, you'll need an msvcrtd.dll which is not in the package.