Debugging with GDB (September 2007)

Appendix A: Installing GDB 327
Appendix A Installing GDB
If you obtain GDB (WDB) as part of the HP ANSI C, HP ANSI C++ Developer’s Kit
for HP-UX Release 11.x, or HP Fortran, you do not have to take any special action to build
or install GDB.
If you obtain GDB (WDB) from an HP web site, you may download either an swinstall
package or a source tree, or both.
Most customers will want to install the GDB binary that is part of the swinstall
package. To do so, use a command of the form
/usr/sbin/swinstall -s package-name WDB
Alternatively, it is po ssible to build GDB from the source distribution. If you want to
modify the debugger sources to tailor GDB to your needs, you may wish to do this. The
source distribution consists of a tar file containing the source tree rooted at gdb-4.17/...’.
The instructions that follow describe how to build a gdb executable from this source
tree. HP believes that these instructions apply to the WDB source tree that it distributes.
However, HP does not e xplicitly support building a gdb for any non-HP platform from
the WDB source tree. It may work, but HP has not tested it for any platforms other than
those described in the WDB Release Notes.
You can find additional information specific to Hewlett-Packard in the README.HP.WDB
file at the root of the source tree.
GDB comes with a configure script that automate s the process of preparing GDB for
installation; you can then use make to build the gdb program.
1
The GDB distribution includes all the s ource code you need for GDB in a single directory,
whose name is usually composed by appending the version number to gdb’.
For example, the GDB version gdb-199991101 distribution is in the gdb-gdb-199991101
directory. That directory contains:
gdb-gdb-199991101/configure (and supporting files)
script for configuring GDB and all its supporting libraries
gdb-gdb-199991101/gdb
the source specific to GDB itself
gdb-gdb-199991101/bfd
source for the Binary File Descriptor library
gdb-gdb-199991101/include
gnu include files
gdb-gdb-199991101/libiberty
source for the -liberty free software library
gdb-gdb-199991101/opcodes
source for the library of opcode tables and disassemblers
gdb-gdb-199991101/readline
source for the gnu command-line interface
1
If you have a more recent version of GDB than gdb-199991101, look at the README file in the sources;
we may have improved the installation procedures since publishing this manual.