nullstream weblog - Linux Source Code Browsing

« Nerd Power Ups | Virtual Fridays »

Linux Source Code Browsing


March 2, 2007 11:58 AM PST

There are a few free and not so free varieties of code browsing tools available for Linux. Two of the free kind are KScope and Source Navigator.

Both of these tools allow you to import existing code projects and build cross reference indexes. They both will also function as a code editor and project manager. Both can be pointed at existing projects regardless of their structure. Both allow for code browsing without having to compile without special flags, unlike some tools. KScope has been around for a while now and is actively being developed. Source Navigator has more features than KScope but development pretty much stopped in early 2004. Source Navigator still works perfectly fine however, although the X style GUI makes it seem dated.

KScope is a GUI front end for Cscope that is primarily indended for large C projects. Cscope builds a source code index for your source files. It lets you do searches against this index in ways that Ctags can't. (KScope still depends on Ctags however for at least one of its tools.) You can quickly go to a definition, get a list of all references, build calling and caller graphs, lookup symbols and more. KScope's gui is pretty much a rip off of SourceInsight. While it doesn't have the power and maturity of Source Insight it at least brings a good portion of the functionality to Linux. The native editor is Kate, which is also shared by Kdevelop. The editor is pretty rich with good syntax highlighting. While not a full IDE, KScope is a good solution for managing large source code projects. Being a KDE project it has dependencies on various KDE elements. It is possible to install it on a Gnome system however. Ubuntu has a KScope package available in its standard app repository. One gotcha: Cscope will not properly parse sources files with Windows style line terminators (I found that out the hard way).

KScope Screenshots

Source Navigator is an older project from Redhat used to navigate sources trees and more. Source Navigator is a fully functioning IDE that can handle C / C++ project, launch builds as well as integrate with the *Insight debugger and version control systems. The project is pretty stale now however. One big difference between Source Navigator and Kscope is that SN doesn't depend on Cscope, it builds its own index. In addition to the normal definition lookup and call graphs, SN adds many features not yet found in KScope. These include a full class, hierarchy, and include browsers as well as a sophisticated symbol search called the retriever that has very advanced type filtering supporting nearly all C programming types. The last stable (non beta) version of Source Navigator is available for Ubuntu via the admin synaptic tool.

Source Navigator Screenshots

Another free Linux source browsing tool is Eclipse with the CDT plugin. I have not spent a lot of time in Eclipse yet, but it is my understanding that you have to to a special build to get the browse symbols support. I may blog about this in the future.

*Note: I currently use Insight as my primary Linux debugger at work. Be warned however that it is just a GUI for GDB so it has the same limitations GDB has. Also note that it is highly tied to specific GDB versions, so if you install it you're going to get a new/different GDB as well. There is an Ubuntu package of an older version available if you go through the admin synaptic tool.

Comments (0)

All links will be marked with the nofollow tag, making them useless for search rankings. Any posts containing spam URLs will then be deleted.