Copyright ©

Installing GNU Debugger - GDB

previous next


Before you go for installtion,check if you already have gdb installed on your Unix system by issuing following command

$gdb -help

If GDB is installed then it will display all the available options within your GDB. If GDB is not installed then proceed for a fresh installation.

Its very easy to install GDB on your system. This session will guide you steps by step to install GDB.

  • Make sure you have the prerequisites for installing gdb:
    • An ANSI-compliant C compiler ( gcc is recommended - note that gdb is capable of debugging code generated by other compilers )
    • 115 MB of free disk space on the partition you're going to build gdb on.
    • 20 MB of free disk space on the partition you're going to install gdb on.
    • GNU's decompression program, gzip
    • The make utility - the GNU version is known to work without a problem, others probably do as well.

  • Download the gdb source distribution from (I used gdb-6.6.tar.gz for these instructions.) Place the distribution files in your build directory.

  • In your build directory, uncompress gdb-6.6.tar.gz and extract the source files from the archive. Once the files have finished extracting, change your working directory to the the gdb-6.6 directory that was automatically created in your build directory.

   $ build> gzip -d gdb-6.6.tar.gz
$ build> tar xfv gdb-6.6.tar
$ build> cd gdb-6.6

  • Run the configure script to configure the source tree for your platform.

   $ gdb-6.6> ./configure

  • Build gdb using the make utility.
   $ gdb-6.6> make

  • Login as root, and install gdb using following command.
   $ gdb-6.6> make install

  • If desired, disk space can be reclaimed by deleting the gdb build directory and archive file after installation is complete.
   $ gdb-6.6> cd ..
$ build> rm -r gdb-6.6
$ build> rm gdb-6.6.tar

Now gdb is now installed on your system and ready for use.

previous next

Copyright ©