Chapter 14. Tools for Programmers
Many judge a computer system by the tools it offers its programmers. Unix systems have won the contest by many people’s standards, having developed a very rich set over the years. Leading the parade is the GNU debugger, gdb. In this chapter, we take a close look at this invaluable utility and a number of other auxiliary tools C programmers will find useful.
Even if you are not a programmer, you should consider using the Revision Control System (RCS). It provides one of the most reassuring protections a computer user could ask for--backups for everything you do to a file. If you delete a file by accident, or decide that everything you did for the past week was a mistake and should be ripped out, RCS can recover any version you want. If you are working on a larger project that involves either a large number of developers or a large number of directories, Concurrent Versioning System (CVS) might be more suitable for you. It is based on RCS, but provides some additional features.
Debugging with gdb
Are you one of those programmers who scoff at the very idea
of using a debugger to trace through code? Is it your philosophy that
if the code is too complex for even the programmer to understand,
then the programmer deserves no mercy when it comes to bugs? Do you step through
your code, mentally, using a magnifying glass and a toothpick?
More often than not, are bugs usually caused by a single-character omission,
such as using the
= operator when ...