Noeud:Source Code Navigation, Noeud « Next »:Where to go from here, Noeud « Previous »:Profiling and Optimising Your Code, Noeud « Up »:Top
It is a sad but true fact that we programmers have to pick up where others have left off. The main trouble is that the "other guy" did the design by seat-of-the-pants typing and pasting, and he forgot to go back and insert the comments he always intended to do. Now what?
"Read the source, Luke," works, but it is one of the lesser fun things
in a programmer's life. To help you through this process are the
standard command line tools, find
and grep
. Those two
utilities and a little study in the black art of regex will stand you
in good stead. For the mortals, there are a couple of powerful UI
tools that facilitate this process a great deal. They are:
I mention them both because cscope has been around for over a decade
and is simpler to configure and get started with. On the other hand,
Source Navigator has a very nice GUI front end to a tool similar to
cscope and has numerous additional features. It is a full-fledged
development environment that integrates many of the tools we discuss
in this book. So, really, the choice is between immediate
(find
and grep
), short (cscope
) and long term
convenience.
This chapter will give you a brief introduction to these tools. Enough of an introduction to make these tools useful to you.