Navigating in HelenOS sources
Searching and Grepping
Most people coming from the Unix background will be used to working with the grep
command. While using plain grep
to search HelenOS sources is possible too, Git, the VCS used by HelenOS, provides a nice wrapper around grep
, so that it is possible to do for example:
$ git grep -n foo
This will search all versioned files for the occurrence of string 'foo' and for each match it will print the file, line number and the line itself. The output will be colorized and the matching string will be highlighted.
Another possibility to search the sources is to use cscope
.
Indexing the sources
HelenOS main Makefile
provides the cscope
target, which indexes the source files for later interactive searching and querying:
$ make cscope
The index can be used directly via the cscope
command:
$ cscope -d
Many text editors provide some sort of a cscope
plugin to seamlessly integrate source navigation with the text editor's editing and viewing features.
Browsing on-line
It is also possible to browse cross-referenced sources on-line (re-generated nightly).