20.1. Installing GDB
If the GNU C compiler, GCC, is available on your system, then GDB is probably already installed as well. You can tell by running the following command, which displays the debugger's version and copyright information:
$ gdb -version
As in the preceding chapters, the dollar sign character ($) followed by a space represents the shell command prompt.
If GDB is installed, a message like the following appears:
GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux".
If GDB is not installed, you can download the source code and compile it (see http://www.gnu.org/software/gdb/download/). This is seldom necessary, though. Most Unix-like systems provide a convenient method to install a binary GDB package, including the documentation. On Windows systems, we recommend that you install the Cygwin software. Cygwin provides a standard Unix environment on Windows platforms, including the GCC compiler, the GDB debugger, and other GNU tools (see http://www.cygwin.com or http://www.redhat.com/software/cygwin/).