xref: /dflybsd-src/contrib/gdb-7/gdb/README (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1cf7f2e2dSJohn Marino		     README for GDB release
25796c8dcSSimon Schubert
35796c8dcSSimon SchubertThis is GDB, the GNU source-level debugger.
45796c8dcSSimon Schubert
55796c8dcSSimon SchubertA summary of new features is in the file `gdb/NEWS'.
65796c8dcSSimon Schubert
75796c8dcSSimon SchubertCheck the GDB home page at http://www.gnu.org/software/gdb/ for up to
85796c8dcSSimon Schubertdate release information, mailing list links and archives, etc.
95796c8dcSSimon Schubert
105796c8dcSSimon SchubertThe file `gdb/PROBLEMS' contains information on problems identified
115796c8dcSSimon Schubertlate in the release cycle.  GDB's bug tracking data base at
125796c8dcSSimon Schuberthttp://www.gnu.org/software/gdb/bugs/ contains a more complete list of
135796c8dcSSimon Schubertbugs.
145796c8dcSSimon Schubert
155796c8dcSSimon Schubert
165796c8dcSSimon SchubertUnpacking and Installation -- quick overview
175796c8dcSSimon Schubert==========================
185796c8dcSSimon Schubert
19cf7f2e2dSJohn Marino   The release is provided as a gzipped tar file called
20cf7f2e2dSJohn Marino'gdb-VERSION.tar.gz', where VERSION is the version of GDB.
21cf7f2e2dSJohn Marino
22cf7f2e2dSJohn Marino   The GDB debugger sources, the generic GNU include
235796c8dcSSimon Schubertfiles, the BFD ("binary file description") library, the readline
245796c8dcSSimon Schubertlibrary, and other libraries all have directories of their own
25cf7f2e2dSJohn Marinounderneath the gdb-VERSION directory.  The idea is that a variety of GNU
265796c8dcSSimon Schuberttools can share a common copy of these things.  Be aware of variation
27cf7f2e2dSJohn Marinoover time--for example don't try to build GDB with a copy of bfd from
28cf7f2e2dSJohn Marinoa release other than the GDB release (such as a binutils release),
295796c8dcSSimon Schubertespecially if the releases are more than a few weeks apart.
305796c8dcSSimon SchubertConfiguration scripts and makefiles exist to cruise up and down this
315796c8dcSSimon Schubertdirectory tree and automatically build all the pieces in the right
325796c8dcSSimon Schubertorder.
335796c8dcSSimon Schubert
34cf7f2e2dSJohn Marino   When you unpack the gdb-VERSION.tar.gz file, it will create a
35cf7f2e2dSJohn Marinosource directory called `gdb-VERSION'.
365796c8dcSSimon Schubert
375796c8dcSSimon SchubertYou can build GDB right in the source directory:
385796c8dcSSimon Schubert
39cf7f2e2dSJohn Marino      cd gdb-VERSION
405796c8dcSSimon Schubert      ./configure
415796c8dcSSimon Schubert      make
425796c8dcSSimon Schubert      cp gdb/gdb /usr/local/bin/gdb	(or wherever you want)
435796c8dcSSimon Schubert
445796c8dcSSimon SchubertHowever, we recommend that an empty directory be used instead.
455796c8dcSSimon SchubertThis way you do not clutter your source tree with binary files
465796c8dcSSimon Schubertand will be able to create different builds with different
475796c8dcSSimon Schubertconfiguration options.
485796c8dcSSimon Schubert
495796c8dcSSimon SchubertYou can build GDB in any empty build directory:
505796c8dcSSimon Schubert
515796c8dcSSimon Schubert      mkdir build
525796c8dcSSimon Schubert      cd build
53cf7f2e2dSJohn Marino      <full path to your sources>/gdb-VERSION/configure
545796c8dcSSimon Schubert      make
555796c8dcSSimon Schubert      cp gdb/gdb /usr/local/bin/gdb	(or wherever you want)
565796c8dcSSimon Schubert
575796c8dcSSimon Schubert(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly
58cf7f2e2dSJohn Marinodifferent; see the file gdb-VERSION/gdb/config/djgpp/README for details.)
595796c8dcSSimon Schubert
605796c8dcSSimon Schubert   This will configure and build all the libraries as well as GDB.  If
615796c8dcSSimon Schubert`configure' can't determine your system type, specify one as its
625796c8dcSSimon Schubertargument, e.g., `./configure sun4' or `./configure decstation'.
635796c8dcSSimon Schubert
64cf7f2e2dSJohn Marino   Make sure that your 'configure' line ends in 'gdb-VERSION/configure':
655796c8dcSSimon Schubert
66cf7f2e2dSJohn Marino      /berman/migchain/source/gdb-VERSION/configure      # RIGHT
67cf7f2e2dSJohn Marino      /berman/migchain/source/gdb-VERSION/gdb/configure  # WRONG
685796c8dcSSimon Schubert
69cf7f2e2dSJohn Marino   The GDB package contains several subdirectories, such as 'gdb',
705796c8dcSSimon Schubert'bfd', and 'readline'.  If your 'configure' line ends in
71cf7f2e2dSJohn Marino'gdb-VERSION/gdb/configure', then you are configuring only the gdb
72cf7f2e2dSJohn Marinosubdirectory, not the whole GDB package.  This leads to build errors
735796c8dcSSimon Schubertsuch as:
745796c8dcSSimon Schubert
755796c8dcSSimon Schubert      make: *** No rule to make target `../bfd/bfd.h', needed by `gdb.o'.  Stop.
765796c8dcSSimon Schubert
775796c8dcSSimon Schubert   If you get other compiler errors during this stage, see the `Reporting
785796c8dcSSimon SchubertBugs' section below; there are a few known problems.
795796c8dcSSimon Schubert
805796c8dcSSimon Schubert   GDB requires an ISO C (ANSI C) compiler.  If you do not have an ISO
815796c8dcSSimon SchubertC compiler for your system, you may be able to download and install
825796c8dcSSimon Schubertthe GNU CC compiler.  It is available via anonymous FTP from the
835796c8dcSSimon Schubertdirectory `ftp://ftp.gnu.org/pub/gnu/gcc'.  GDB also requires an ISO
84cf7f2e2dSJohn MarinoC standard library.  The GDB remote server, GDBserver, builds with some
855796c8dcSSimon Schubertnon-ISO standard libraries - e.g. for Windows CE.
865796c8dcSSimon Schubert
875796c8dcSSimon Schubert   GDB uses Expat, an XML parsing library, to implement some target-specific
885796c8dcSSimon Schubertfeatures.  Expat will be linked in if it is available at build time, or
895796c8dcSSimon Schubertthose features will be disabled.  The latest version of Expat should be
905796c8dcSSimon Schubertavailable from `http://expat.sourceforge.net'.
915796c8dcSSimon Schubert
925796c8dcSSimon Schubert   GDB can be used as a cross-debugger, running on a machine of one
935796c8dcSSimon Schuberttype while debugging a program running on a machine of another type.
945796c8dcSSimon SchubertSee below.
955796c8dcSSimon Schubert
965796c8dcSSimon Schubert
975796c8dcSSimon SchubertMore Documentation
985796c8dcSSimon Schubert******************
995796c8dcSSimon Schubert
1005796c8dcSSimon Schubert   All the documentation for GDB comes as part of the machine-readable
1015796c8dcSSimon Schubertdistribution.  The documentation is written in Texinfo format, which
1025796c8dcSSimon Schubertis a documentation system that uses a single source file to produce
1035796c8dcSSimon Schubertboth on-line information and a printed manual.  You can use one of the
1045796c8dcSSimon SchubertInfo formatting commands to create the on-line version of the
1055796c8dcSSimon Schubertdocumentation and TeX (or `texi2roff') to typeset the printed version.
1065796c8dcSSimon Schubert
1075796c8dcSSimon Schubert   GDB includes an already formatted copy of the on-line Info version
1085796c8dcSSimon Schubertof this manual in the `gdb/doc' subdirectory.  The main Info file is
109cf7f2e2dSJohn Marino`gdb-VERSION/gdb/doc/gdb.info', and it refers to subordinate files
1105796c8dcSSimon Schubertmatching `gdb.info*' in the same directory.  If necessary, you can
1115796c8dcSSimon Schubertprint out these files, or read them with any editor; but they are
1125796c8dcSSimon Schuberteasier to read using the `info' subsystem in GNU Emacs or the
1135796c8dcSSimon Schubertstandalone `info' program, available as part of the GNU Texinfo
1145796c8dcSSimon Schubertdistribution.
1155796c8dcSSimon Schubert
1165796c8dcSSimon Schubert   If you want to format these Info files yourself, you need one of the
1175796c8dcSSimon SchubertInfo formatting programs, such as `texinfo-format-buffer' or
1185796c8dcSSimon Schubert`makeinfo'.
1195796c8dcSSimon Schubert
1205796c8dcSSimon Schubert   If you have `makeinfo' installed, and are in the top level GDB
121cf7f2e2dSJohn Marinosource directory (`gdb-VERSION'), you can make the Info file by
122cf7f2e2dSJohn Marinotyping:
1235796c8dcSSimon Schubert
1245796c8dcSSimon Schubert      cd gdb/doc
1255796c8dcSSimon Schubert      make info
1265796c8dcSSimon Schubert
1275796c8dcSSimon Schubert   If you want to typeset and print copies of this manual, you need
1285796c8dcSSimon SchubertTeX, a program to print its DVI output files, and `texinfo.tex', the
1295796c8dcSSimon SchubertTexinfo definitions file.  This file is included in the GDB
130cf7f2e2dSJohn Marinodistribution, in the directory `gdb-VERSION/texinfo'.
1315796c8dcSSimon Schubert
1325796c8dcSSimon Schubert   TeX is a typesetting program; it does not print files directly, but
1335796c8dcSSimon Schubertproduces output files called DVI files.  To print a typeset document,
1345796c8dcSSimon Schubertyou need a program to print DVI files.  If your system has TeX
1355796c8dcSSimon Schubertinstalled, chances are it has such a program.  The precise command to
1365796c8dcSSimon Schubertuse depends on your system; `lpr -d' is common; another (for PostScript
1375796c8dcSSimon Schubertdevices) is `dvips'.  The DVI print command may require a file name
1385796c8dcSSimon Schubertwithout any extension or a `.dvi' extension.
1395796c8dcSSimon Schubert
1405796c8dcSSimon Schubert   TeX also requires a macro definitions file called `texinfo.tex'.
1415796c8dcSSimon SchubertThis file tells TeX how to typeset a document written in Texinfo
1425796c8dcSSimon Schubertformat.  On its own, TeX cannot read, much less typeset a Texinfo file.
1435796c8dcSSimon Schubert `texinfo.tex' is distributed with GDB and is located in the
144cf7f2e2dSJohn Marino`gdb-VERSION/texinfo' directory.
1455796c8dcSSimon Schubert
1465796c8dcSSimon Schubert   If you have TeX and a DVI printer program installed, you can typeset
147a45ae5f8SJohn Marinoand print this manual.  First switch to the `gdb' subdirectory of
148cf7f2e2dSJohn Marinothe main source directory (for example, to `gdb-VERSION/gdb') and then type:
1495796c8dcSSimon Schubert
1505796c8dcSSimon Schubert      make doc/gdb.dvi
1515796c8dcSSimon Schubert
1525796c8dcSSimon Schubert   If you prefer to have the manual in PDF format, type this from the
1535796c8dcSSimon Schubert`gdb/doc' subdirectory of the main source directory:
1545796c8dcSSimon Schubert
1555796c8dcSSimon Schubert      make gdb.pdf
1565796c8dcSSimon Schubert
1575796c8dcSSimon SchubertFor this to work, you will need the PDFTeX package to be installed.
1585796c8dcSSimon Schubert
1595796c8dcSSimon Schubert
1605796c8dcSSimon SchubertInstalling GDB
1615796c8dcSSimon Schubert**************
1625796c8dcSSimon Schubert
1635796c8dcSSimon Schubert   GDB comes with a `configure' script that automates the process of
1645796c8dcSSimon Schubertpreparing GDB for installation; you can then use `make' to build the
1655796c8dcSSimon Schubert`gdb' program.
1665796c8dcSSimon Schubert
1675796c8dcSSimon Schubert   The GDB distribution includes all the source code you need for GDB in
168cf7f2e2dSJohn Marinoa single directory.  That directory contains:
1695796c8dcSSimon Schubert
170cf7f2e2dSJohn Marino`gdb-VERSION/{COPYING,COPYING.LIB}'
1715796c8dcSSimon Schubert     Standard GNU license files.  Please read them.
1725796c8dcSSimon Schubert
173cf7f2e2dSJohn Marino`gdb-VERSION/bfd'
1745796c8dcSSimon Schubert     source for the Binary File Descriptor library
1755796c8dcSSimon Schubert
176cf7f2e2dSJohn Marino`gdb-VERSION/config*'
1775796c8dcSSimon Schubert     script for configuring GDB, along with other support files
1785796c8dcSSimon Schubert
179cf7f2e2dSJohn Marino`gdb-VERSION/gdb'
1805796c8dcSSimon Schubert     the source specific to GDB itself
1815796c8dcSSimon Schubert
182cf7f2e2dSJohn Marino`gdb-VERSION/include'
1835796c8dcSSimon Schubert     GNU include files
1845796c8dcSSimon Schubert
185cf7f2e2dSJohn Marino`gdb-VERSION/libiberty'
1865796c8dcSSimon Schubert     source for the `-liberty' free software library
1875796c8dcSSimon Schubert
188cf7f2e2dSJohn Marino`gdb-VERSION/opcodes'
1895796c8dcSSimon Schubert     source for the library of opcode tables and disassemblers
1905796c8dcSSimon Schubert
191cf7f2e2dSJohn Marino`gdb-VERSION/readline'
1925796c8dcSSimon Schubert     source for the GNU command-line interface
1935796c8dcSSimon Schubert     NOTE:  The readline library is compiled for use by GDB, but will
1945796c8dcSSimon Schubert     not be installed on your system when "make install" is issued.
1955796c8dcSSimon Schubert
196cf7f2e2dSJohn Marino`gdb-VERSION/sim'
1975796c8dcSSimon Schubert     source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)
1985796c8dcSSimon Schubert
199cf7f2e2dSJohn Marino`gdb-VERSION/texinfo'
2005796c8dcSSimon Schubert     The `texinfo.tex' file, which you need in order to make a printed
2015796c8dcSSimon Schubert     manual using TeX.
2025796c8dcSSimon Schubert
203cf7f2e2dSJohn Marino`gdb-VERSION/etc'
2045796c8dcSSimon Schubert     Coding standards, useful files for editing GDB, and other
2055796c8dcSSimon Schubert     miscellanea.
2065796c8dcSSimon Schubert
2075796c8dcSSimon Schubert   Note: the following instructions are for building GDB on Unix or
2085796c8dcSSimon SchubertUnix-like systems.  Instructions for building with DJGPP for
2095796c8dcSSimon SchubertMS-DOS/MS-Windows are in the file gdb/config/djgpp/README.
2105796c8dcSSimon Schubert
2115796c8dcSSimon Schubert   The simplest way to configure and build GDB is to run `configure'
212cf7f2e2dSJohn Marinofrom the `gdb-VERSION' directory.
2135796c8dcSSimon Schubert
214cf7f2e2dSJohn Marino   First switch to the `gdb-VERSION' source directory if you are
2155796c8dcSSimon Schubertnot already in it; then run `configure'.
2165796c8dcSSimon Schubert
2175796c8dcSSimon Schubert   For example:
2185796c8dcSSimon Schubert
219cf7f2e2dSJohn Marino      cd gdb-VERSION
2205796c8dcSSimon Schubert      ./configure
2215796c8dcSSimon Schubert      make
2225796c8dcSSimon Schubert
2235796c8dcSSimon Schubert   Running `configure' followed by `make' builds the `bfd',
2245796c8dcSSimon Schubert`readline', `mmalloc', and `libiberty' libraries, then `gdb' itself.
2255796c8dcSSimon SchubertThe configured source files, and the binaries, are left in the
2265796c8dcSSimon Schubertcorresponding source directories.
2275796c8dcSSimon Schubert
2285796c8dcSSimon Schubert   `configure' is a Bourne-shell (`/bin/sh') script; if your system
2295796c8dcSSimon Schubertdoes not recognize this automatically when you run a different shell,
2305796c8dcSSimon Schubertyou may need to run `sh' on it explicitly:
2315796c8dcSSimon Schubert
2325796c8dcSSimon Schubert      sh configure
2335796c8dcSSimon Schubert
2345796c8dcSSimon Schubert   If you run `configure' from a directory that contains source
235cf7f2e2dSJohn Marinodirectories for multiple libraries or programs, `configure' creates
236cf7f2e2dSJohn Marinoconfiguration files for every directory level underneath (unless
237cf7f2e2dSJohn Marinoyou tell it not to, with the `--norecursion' option).
2385796c8dcSSimon Schubert
2395796c8dcSSimon Schubert   You can install `gdb' anywhere; it has no hardwired paths. However,
2405796c8dcSSimon Schubertyou should make sure that the shell on your path (named by the `SHELL'
2415796c8dcSSimon Schubertenvironment variable) is publicly readable.  Remember that GDB uses the
2425796c8dcSSimon Schubertshell to start your program--some systems refuse to let GDB debug child
2435796c8dcSSimon Schubertprocesses whose programs are not readable.
2445796c8dcSSimon Schubert
2455796c8dcSSimon Schubert
2465796c8dcSSimon SchubertCompiling GDB in another directory
2475796c8dcSSimon Schubert==================================
2485796c8dcSSimon Schubert
2495796c8dcSSimon Schubert   If you want to run GDB versions for several host or target machines,
2505796c8dcSSimon Schubertyou need a different `gdb' compiled for each combination of host and
2515796c8dcSSimon Schuberttarget.  `configure' is designed to make this easy by allowing you to
2525796c8dcSSimon Schubertgenerate each configuration in a separate subdirectory, rather than in
2535796c8dcSSimon Schubertthe source directory.  If your `make' program handles the `VPATH'
2545796c8dcSSimon Schubertfeature correctly (GNU `make' and SunOS 'make' are two that should),
2555796c8dcSSimon Schubertrunning `make' in each of these directories builds the `gdb' program
2565796c8dcSSimon Schubertspecified there.
2575796c8dcSSimon Schubert
2585796c8dcSSimon Schubert   To build `gdb' in a separate directory, run `configure' with the
2595796c8dcSSimon Schubert`--srcdir' option to specify where to find the source. (You also need
2605796c8dcSSimon Schubertto specify a path to find `configure' itself from your working
2615796c8dcSSimon Schubertdirectory.  If the path to `configure' would be the same as the
2625796c8dcSSimon Schubertargument to `--srcdir', you can leave out the `--srcdir' option; it
2635796c8dcSSimon Schubertwill be assumed.)
2645796c8dcSSimon Schubert
265cf7f2e2dSJohn Marino   For example, you can build GDB in a separate
2665796c8dcSSimon Schubertdirectory for a Sun 4 like this:
2675796c8dcSSimon Schubert
268cf7f2e2dSJohn Marino     cd gdb-VERSION
2695796c8dcSSimon Schubert     mkdir ../gdb-sun4
2705796c8dcSSimon Schubert     cd ../gdb-sun4
271cf7f2e2dSJohn Marino     ../gdb-VERSION/configure
2725796c8dcSSimon Schubert     make
2735796c8dcSSimon Schubert
2745796c8dcSSimon Schubert   When `configure' builds a configuration using a remote source
2755796c8dcSSimon Schubertdirectory, it creates a tree for the binaries with the same structure
2765796c8dcSSimon Schubert(and using the same names) as the tree under the source directory.  In
2775796c8dcSSimon Schubertthe example, you'd find the Sun 4 library `libiberty.a' in the
2785796c8dcSSimon Schubertdirectory `gdb-sun4/libiberty', and GDB itself in `gdb-sun4/gdb'.
2795796c8dcSSimon Schubert
2805796c8dcSSimon Schubert   One popular reason to build several GDB configurations in separate
2815796c8dcSSimon Schubertdirectories is to configure GDB for cross-compiling (where GDB runs on
2825796c8dcSSimon Schubertone machine--the host--while debugging programs that run on another
2835796c8dcSSimon Schubertmachine--the target).  You specify a cross-debugging target by giving
2845796c8dcSSimon Schubertthe `--target=TARGET' option to `configure'.
2855796c8dcSSimon Schubert
2865796c8dcSSimon Schubert   When you run `make' to build a program or library, you must run it
2875796c8dcSSimon Schubertin a configured directory--whatever directory you were in when you
2885796c8dcSSimon Schubertcalled `configure' (or one of its subdirectories).
2895796c8dcSSimon Schubert
2905796c8dcSSimon Schubert   The `Makefile' that `configure' generates in each source directory
2915796c8dcSSimon Schubertalso runs recursively.  If you type `make' in a source directory such
292cf7f2e2dSJohn Marinoas `gdb-VERSION' (or in a separate configured directory configured with
293cf7f2e2dSJohn Marino`--srcdir=PATH/gdb-VERSION'), you will build all the required libraries,
2945796c8dcSSimon Schubertand then build GDB.
2955796c8dcSSimon Schubert
2965796c8dcSSimon Schubert   When you have multiple hosts or targets configured in separate
2975796c8dcSSimon Schubertdirectories, you can run `make' on them in parallel (for example, if
2985796c8dcSSimon Schubertthey are NFS-mounted on each of the hosts); they will not interfere
2995796c8dcSSimon Schubertwith each other.
3005796c8dcSSimon Schubert
3015796c8dcSSimon Schubert
3025796c8dcSSimon SchubertSpecifying names for hosts and targets
3035796c8dcSSimon Schubert======================================
3045796c8dcSSimon Schubert
3055796c8dcSSimon Schubert   The specifications used for hosts and targets in the `configure'
3065796c8dcSSimon Schubertscript are based on a three-part naming scheme, but some short
3075796c8dcSSimon Schubertpredefined aliases are also supported.  The full naming scheme encodes
3085796c8dcSSimon Schubertthree pieces of information in the following pattern:
3095796c8dcSSimon Schubert
3105796c8dcSSimon Schubert     ARCHITECTURE-VENDOR-OS
3115796c8dcSSimon Schubert
3125796c8dcSSimon Schubert   For example, you can use the alias `sun4' as a HOST argument or in a
3135796c8dcSSimon Schubert`--target=TARGET' option.  The equivalent full name is
3145796c8dcSSimon Schubert`sparc-sun-sunos4'.
3155796c8dcSSimon Schubert
3165796c8dcSSimon Schubert   The `configure' script accompanying GDB does not provide any query
3175796c8dcSSimon Schubertfacility to list all supported host and target names or aliases.
3185796c8dcSSimon Schubert`configure' calls the Bourne shell script `config.sub' to map
3195796c8dcSSimon Schubertabbreviations to full names; you can read the script, if you wish, or
3205796c8dcSSimon Schubertyou can use it to test your guesses on abbreviations--for example:
3215796c8dcSSimon Schubert
3225796c8dcSSimon Schubert     % sh config.sub sun4
3235796c8dcSSimon Schubert     sparc-sun-sunos4.1.1
3245796c8dcSSimon Schubert     % sh config.sub sun3
3255796c8dcSSimon Schubert     m68k-sun-sunos4.1.1
3265796c8dcSSimon Schubert     % sh config.sub decstation
3275796c8dcSSimon Schubert     mips-dec-ultrix4.2
3285796c8dcSSimon Schubert     % sh config.sub hp300bsd
3295796c8dcSSimon Schubert     m68k-hp-bsd
3305796c8dcSSimon Schubert     % sh config.sub i386v
3315796c8dcSSimon Schubert     i386-pc-sysv
3325796c8dcSSimon Schubert     % sh config.sub i786v
3335796c8dcSSimon Schubert     Invalid configuration `i786v': machine `i786v' not recognized
3345796c8dcSSimon Schubert
335cf7f2e2dSJohn Marino`config.sub' is also distributed in the GDB source directory.
3365796c8dcSSimon Schubert
3375796c8dcSSimon Schubert
3385796c8dcSSimon Schubert`configure' options
3395796c8dcSSimon Schubert===================
3405796c8dcSSimon Schubert
3415796c8dcSSimon Schubert   Here is a summary of the `configure' options and arguments that are
3425796c8dcSSimon Schubertmost often useful for building GDB.  `configure' also has several other
3435796c8dcSSimon Schubertoptions not listed here.  *note : (configure.info)What Configure Does,
3445796c8dcSSimon Schubertfor a full explanation of `configure'.
3455796c8dcSSimon Schubert
3465796c8dcSSimon Schubert     configure [--help]
3475796c8dcSSimon Schubert               [--prefix=DIR]
3485796c8dcSSimon Schubert               [--srcdir=PATH]
3495796c8dcSSimon Schubert               [--norecursion] [--rm]
3505796c8dcSSimon Schubert	       [--enable-build-warnings]
3515796c8dcSSimon Schubert               [--target=TARGET]
3525796c8dcSSimon Schubert	       [--host=HOST]
3535796c8dcSSimon Schubert	       [HOST]
3545796c8dcSSimon Schubert
3555796c8dcSSimon SchubertYou may introduce options with a single `-' rather than `--' if you
3565796c8dcSSimon Schubertprefer; but you may abbreviate option names if you use `--'.
3575796c8dcSSimon Schubert
3585796c8dcSSimon Schubert`--help'
3595796c8dcSSimon Schubert     Display a quick summary of how to invoke `configure'.
3605796c8dcSSimon Schubert
3615796c8dcSSimon Schubert`-prefix=DIR'
3625796c8dcSSimon Schubert     Configure the source to install programs and files under directory
3635796c8dcSSimon Schubert     `DIR'.
3645796c8dcSSimon Schubert
3655796c8dcSSimon Schubert`--srcdir=PATH'
3665796c8dcSSimon Schubert     *Warning: using this option requires GNU `make', or another `make'
3675796c8dcSSimon Schubert     that compatibly implements the `VPATH' feature.*
3685796c8dcSSimon Schubert     Use this option to make configurations in directories separate
3695796c8dcSSimon Schubert     from the GDB source directories.  Among other things, you can use
3705796c8dcSSimon Schubert     this to build (or maintain) several configurations simultaneously,
3715796c8dcSSimon Schubert     in separate directories.  `configure' writes configuration
3725796c8dcSSimon Schubert     specific files in the current directory, but arranges for them to
3735796c8dcSSimon Schubert     use the source in the directory PATH.  `configure' will create
3745796c8dcSSimon Schubert     directories under the working directory in parallel to the source
3755796c8dcSSimon Schubert     directories below PATH.
3765796c8dcSSimon Schubert
3775796c8dcSSimon Schubert`--host=HOST'
3785796c8dcSSimon Schubert     Configure GDB to run on the specified HOST.
3795796c8dcSSimon Schubert
3805796c8dcSSimon Schubert     There is no convenient way to generate a list of all available
3815796c8dcSSimon Schubert     hosts.
3825796c8dcSSimon Schubert
3835796c8dcSSimon Schubert`HOST ...'
3845796c8dcSSimon Schubert     Same as `--host=HOST'.  If you omit this, GDB will guess; it's
3855796c8dcSSimon Schubert     quite accurate.
3865796c8dcSSimon Schubert
3875796c8dcSSimon Schubert`--norecursion'
3885796c8dcSSimon Schubert     Configure only the directory level where `configure' is executed;
3895796c8dcSSimon Schubert     do not propagate configuration to subdirectories.
3905796c8dcSSimon Schubert
3915796c8dcSSimon Schubert`--rm'
3925796c8dcSSimon Schubert     Remove the configuration that the other arguments specify.
3935796c8dcSSimon Schubert
3945796c8dcSSimon Schubert`--enable-build-warnings'
3955796c8dcSSimon Schubert     When building the GDB sources, ask the compiler to warn about any
3965796c8dcSSimon Schubert     code which looks even vaguely suspicious.  You should only using
3975796c8dcSSimon Schubert     this feature if you're compiling with GNU CC.  It passes the
3985796c8dcSSimon Schubert     following flags:
3995796c8dcSSimon Schubert	-Wimplicit
4005796c8dcSSimon Schubert	-Wreturn-type
4015796c8dcSSimon Schubert	-Wcomment
4025796c8dcSSimon Schubert	-Wtrigraphs
4035796c8dcSSimon Schubert	-Wformat
4045796c8dcSSimon Schubert	-Wparentheses
4055796c8dcSSimon Schubert	-Wpointer-arith
4065796c8dcSSimon Schubert
4075796c8dcSSimon Schubert`--enable-werror'
4085796c8dcSSimon Schubert     Treat compiler warnings as werrors.  Use this only with GCC.  It
4095796c8dcSSimon Schubert     adds the -Werror flag to the compiler, which will fail the
4105796c8dcSSimon Schubert     compilation if the compiler outputs any warning messages.
4115796c8dcSSimon Schubert
4125796c8dcSSimon Schubert`--target=TARGET'
4135796c8dcSSimon Schubert     Configure GDB for cross-debugging programs running on the specified
4145796c8dcSSimon Schubert     TARGET.  Without this option, GDB is configured to debug programs
4155796c8dcSSimon Schubert     that run on the same machine (HOST) as GDB itself.
4165796c8dcSSimon Schubert
4175796c8dcSSimon Schubert     There is no convenient way to generate a list of all available
4185796c8dcSSimon Schubert     targets.
4195796c8dcSSimon Schubert
4205796c8dcSSimon Schubert`--with-gdb-datadir=PATH'
4215796c8dcSSimon Schubert     Set the GDB-specific data directory.  GDB will look here for
4225796c8dcSSimon Schubert     certain supporting files or scripts.  This defaults to the `gdb'
4235796c8dcSSimon Schubert     subdirectory of `datadir' (which can be set using `--datadir').
4245796c8dcSSimon Schubert
4255796c8dcSSimon Schubert`--with-relocated-sources=DIR'
4265796c8dcSSimon Schubert     Sets up the default source path substitution rule so that
4275796c8dcSSimon Schubert     directory names recorded in debug information will be
4285796c8dcSSimon Schubert     automatically adjusted for any directory under DIR.  DIR should
4295796c8dcSSimon Schubert     be a subdirectory of GDB's configured prefix, the one mentioned
4305796c8dcSSimon Schubert     in the `--prefix' or `--exec-prefix' options to configure.  This
4315796c8dcSSimon Schubert     option is useful if GDB is supposed to be moved to a different
4325796c8dcSSimon Schubert     place after it is built.
4335796c8dcSSimon Schubert
4345796c8dcSSimon Schubert`--enable-64-bit-bfd'
4355796c8dcSSimon Schubert     Enable 64-bit support in BFD on 32-bit hosts.
4365796c8dcSSimon Schubert
4375796c8dcSSimon Schubert`--disable-gdbmi'
4385796c8dcSSimon Schubert     Build GDB without the GDB/MI machine interface.
4395796c8dcSSimon Schubert
4405796c8dcSSimon Schubert`--enable-tui'
4415796c8dcSSimon Schubert     Build GDB with the text-mode full-screen user interface (TUI).
4425796c8dcSSimon Schubert     Requires a curses library (ncurses and cursesX are also
4435796c8dcSSimon Schubert     supported).
4445796c8dcSSimon Schubert
4455796c8dcSSimon Schubert`--enable-gdbtk'
4465796c8dcSSimon Schubert     Build GDB with the gdbtk GUI interface.  Requires TCL/Tk to be
4475796c8dcSSimon Schubert     installed.
4485796c8dcSSimon Schubert
449*ef5ccd6cSJohn Marino`--with-libunwind-ia64'
450*ef5ccd6cSJohn Marino     Use the libunwind library for unwinding function call stack on ia64
451*ef5ccd6cSJohn Marino     target platforms.
452*ef5ccd6cSJohn Marino     See http://www.nongnu.org/libunwind/index.html for details.
4535796c8dcSSimon Schubert
4545796c8dcSSimon Schubert`--with-curses'
4555796c8dcSSimon Schubert     Use the curses library instead of the termcap library, for
4565796c8dcSSimon Schubert     text-mode terminal operations.
4575796c8dcSSimon Schubert
4585796c8dcSSimon Schubert`--enable-profiling' Enable profiling of GDB itself.  Necessary if you
4595796c8dcSSimon Schubert     want to use the "maint set profile" command for profiling GDB.
4605796c8dcSSimon Schubert     Requires the functions `monstartup' and `_mcleanup' to be present
4615796c8dcSSimon Schubert     in the standard C library used to build GDB, and also requires a
4625796c8dcSSimon Schubert     compiler that supports the `-pg' option.
4635796c8dcSSimon Schubert
4645796c8dcSSimon Schubert`--with-system-readline'
4655796c8dcSSimon Schubert     Use the readline library installed on the host, rather than the
4665796c8dcSSimon Schubert     library supplied as part of GDB tarball.
4675796c8dcSSimon Schubert
4685796c8dcSSimon Schubert`--with-expat'
4695796c8dcSSimon Schubert     Build GDB with the libexpat library.  (Done by default if
4705796c8dcSSimon Schubert     libexpat is installed and found at configure time.)  This library
4715796c8dcSSimon Schubert     is used to read XML files supplied with GDB.  If it is
4725796c8dcSSimon Schubert     unavailable, some features, such as remote protocol memory maps,
4735796c8dcSSimon Schubert     target descriptions, and shared library lists, that are based on
4745796c8dcSSimon Schubert     XML files, will not be available in GDB.  If your host does not
4755796c8dcSSimon Schubert     have libexpat installed, you can  get the latest version from
4765796c8dcSSimon Schubert     http://expat.sourceforge.net.
4775796c8dcSSimon Schubert
4785796c8dcSSimon Schubert`--with-python[=PATH]'
4795796c8dcSSimon Schubert     Build GDB with Python scripting support.  (Done by default if
4805796c8dcSSimon Schubert     libpython is present and found at configure time.)  Python makes
4815796c8dcSSimon Schubert     GDB scripting much more powerful than the restricted CLI
4825796c8dcSSimon Schubert     scripting language.  If your host does not have Python installed,
4835796c8dcSSimon Schubert     you can find it on http://www.python.org/download/.  The oldest
4845796c8dcSSimon Schubert     version of Python supported by GDB is 2.4.  The optional argument
4855796c8dcSSimon Schubert     PATH says where to find the Python headers and libraries; the
4865796c8dcSSimon Schubert     configure script will look in PATH/include for headers and in
4875796c8dcSSimon Schubert     PATH/lib for the libraries.
4885796c8dcSSimon Schubert
4895796c8dcSSimon Schubert`--without-included-regex'
4905796c8dcSSimon Schubert     Don't use the regex library included with GDB (as part of the
4915796c8dcSSimon Schubert     libiberty library).  This is the default on hosts with version 2
4925796c8dcSSimon Schubert     of the GNU C library.
4935796c8dcSSimon Schubert
4945796c8dcSSimon Schubert`--with-sysroot=DIR'
4955796c8dcSSimon Schubert     Use DIR as the default system root directory for libraries whose
4965796c8dcSSimon Schubert     file names begin with `/lib' or `/usr/lib'.  (The value of DIR
4975796c8dcSSimon Schubert     can be modified at run time by using the "set sysroot" command.)
4985796c8dcSSimon Schubert     If DIR is under the GDB configured prefix (set with `--prefix' or
4995796c8dcSSimon Schubert     `--exec-prefix' options), the default system root will be
5005796c8dcSSimon Schubert     automatically adjusted if and when GDB is moved to a different
5015796c8dcSSimon Schubert     location.
5025796c8dcSSimon Schubert
5035796c8dcSSimon Schubert`--with-system-gdbinit=FILE'
5045796c8dcSSimon Schubert     Configure GDB to automatically load a system-wide init file.
5055796c8dcSSimon Schubert     FILE should be an absolute file name.  If FILE is in a directory
5065796c8dcSSimon Schubert     under the configured prefix, and GDB is moved to another location
5075796c8dcSSimon Schubert     after being built, the location of the system-wide init file will
5085796c8dcSSimon Schubert     be adjusted accordingly.
5095796c8dcSSimon Schubert
5105796c8dcSSimon Schubert`configure' accepts other options, for compatibility with configuring
5115796c8dcSSimon Schubertother GNU tools recursively; but these are the only options that affect
5125796c8dcSSimon SchubertGDB or its supporting libraries.
5135796c8dcSSimon Schubert
5145796c8dcSSimon Schubert
5155796c8dcSSimon SchubertRemote debugging
5165796c8dcSSimon Schubert=================
5175796c8dcSSimon Schubert
5185796c8dcSSimon Schubert   The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples
5195796c8dcSSimon Schubertof remote stubs to be used with remote.c.  They are designed to run
5205796c8dcSSimon Schubertstandalone on an m68k, i386, or SPARC cpu and communicate properly
5215796c8dcSSimon Schubertwith the remote.c stub over a serial line.
5225796c8dcSSimon Schubert
5235796c8dcSSimon Schubert   The directory gdb/gdbserver/ contains `gdbserver', a program that
524cf7f2e2dSJohn Marinoallows remote debugging for Unix applications.  GDBserver is only
5255796c8dcSSimon Schubertsupported for some native configurations, including Sun 3, Sun 4, and
5265796c8dcSSimon SchubertLinux.
527cf7f2e2dSJohn MarinoThe file gdb/gdbserver/README includes further notes on GDBserver; in
528cf7f2e2dSJohn Marinoparticular, it explains how to build GDBserver for cross-debugging
529cf7f2e2dSJohn Marino(where GDBserver runs on the target machine, which is of a different
5305796c8dcSSimon Schubertarchitecture than the host machine running GDB).
5315796c8dcSSimon Schubert
5325796c8dcSSimon Schubert   There are a number of remote interfaces for talking to existing ROM
5335796c8dcSSimon Schubertmonitors and other hardware:
5345796c8dcSSimon Schubert
5355796c8dcSSimon Schubert	remote-mips.c	 MIPS remote debugging protocol
5365796c8dcSSimon Schubert	remote-sds.c	 PowerPC SDS monitor
5375796c8dcSSimon Schubert	remote-sim.c	 Generalized simulator protocol
5385796c8dcSSimon Schubert
5395796c8dcSSimon Schubert
5405796c8dcSSimon SchubertReporting Bugs in GDB
5415796c8dcSSimon Schubert=====================
5425796c8dcSSimon Schubert
5435796c8dcSSimon Schubert   There are several ways of reporting bugs in GDB.  The prefered
5445796c8dcSSimon Schubertmethod is to use the World Wide Web:
5455796c8dcSSimon Schubert
5465796c8dcSSimon Schubert      http://www.gnu.org/software/gdb/bugs/
5475796c8dcSSimon Schubert
5485796c8dcSSimon SchubertAs an alternative, the bug report can be submitted, via e-mail, to the
5495796c8dcSSimon Schubertaddress "bug-gdb@gnu.org".
5505796c8dcSSimon Schubert
551cf7f2e2dSJohn Marino   When submitting a bug, please include the GDB version number, and
552cf7f2e2dSJohn Marinohow you configured it (e.g., "sun4" or "mach386 host,
5535796c8dcSSimon Schuberti586-intel-synopsys target").  Since GDB now supports so many
5545796c8dcSSimon Schubertdifferent configurations, it is important that you be precise about
555cf7f2e2dSJohn Marinothis.  If at all possible, you should include the actual banner
556cf7f2e2dSJohn Marinothat GDB prints when it starts up, or failing that, the actual
557cf7f2e2dSJohn Marinoconfigure command that you used when configuring GDB.
5585796c8dcSSimon Schubert
5595796c8dcSSimon Schubert   For more information on how/whether to report bugs, see the
5605796c8dcSSimon SchubertReporting Bugs chapter of the GDB manual (gdb/doc/gdb.texinfo).
5615796c8dcSSimon Schubert
5625796c8dcSSimon Schubert
5635796c8dcSSimon SchubertGraphical interface to GDB -- X Windows, MS Windows
5645796c8dcSSimon Schubert==========================
5655796c8dcSSimon Schubert
5665796c8dcSSimon Schubert   Several graphical interfaces to GDB are available.  You should
5675796c8dcSSimon Schubertcheck:
5685796c8dcSSimon Schubert
5695796c8dcSSimon Schubert	http://www.gnu.org/software/gdb/links/
5705796c8dcSSimon Schubert
5715796c8dcSSimon Schubertfor an up-to-date list.
5725796c8dcSSimon Schubert
5735796c8dcSSimon Schubert   Emacs users will very likely enjoy the Grand Unified Debugger mode;
5745796c8dcSSimon Schuberttry typing `M-x gdb RET'.
5755796c8dcSSimon Schubert
5765796c8dcSSimon Schubert
5775796c8dcSSimon SchubertWriting Code for GDB
5785796c8dcSSimon Schubert=====================
5795796c8dcSSimon Schubert
5805796c8dcSSimon Schubert   There is a lot of information about writing code for GDB in the
5815796c8dcSSimon Schubertinternals manual, distributed with GDB in gdb/doc/gdbint.texinfo.  You
5825796c8dcSSimon Schubertcan read it by hand, print it by using TeX and texinfo, or process it
5835796c8dcSSimon Schubertinto an `info' file for use with Emacs' info mode or the standalone
5845796c8dcSSimon Schubert`info' program.
5855796c8dcSSimon Schubert
5865796c8dcSSimon Schubert   If you are pondering writing anything but a short patch, especially
5875796c8dcSSimon Schuberttake note of the information about copyrights in the node Submitting
5885796c8dcSSimon SchubertPatches.  It can take quite a while to get all the paperwork done, so
5895796c8dcSSimon Schubertwe encourage you to start that process as soon as you decide you are
5905796c8dcSSimon Schubertplanning to work on something, or at least well ahead of when you
5915796c8dcSSimon Schubertthink you will be ready to submit the patches.
5925796c8dcSSimon Schubert
5935796c8dcSSimon Schubert
5945796c8dcSSimon SchubertGDB Testsuite
5955796c8dcSSimon Schubert=============
5965796c8dcSSimon Schubert
5975796c8dcSSimon Schubert   Included with the GDB distribution is a DejaGNU based testsuite
5985796c8dcSSimon Schubertthat can either be used to test your newly built GDB, or for
5995796c8dcSSimon Schubertregression testing a GDB with local modifications.
6005796c8dcSSimon Schubert
6015796c8dcSSimon Schubert   Running the testsuite requires the prior installation of DejaGNU,
6025796c8dcSSimon Schubertwhich is generally available via ftp.  The directory
6035796c8dcSSimon Schubertftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot.
6045796c8dcSSimon SchubertOnce DejaGNU is installed, you can run the tests in one of the
6055796c8dcSSimon Schubertfollowing ways:
6065796c8dcSSimon Schubert
607cf7f2e2dSJohn Marino  (1)	cd gdb-VERSION
6085796c8dcSSimon Schubert	make check-gdb
6095796c8dcSSimon Schubert
6105796c8dcSSimon Schubertor
6115796c8dcSSimon Schubert
612cf7f2e2dSJohn Marino  (2)	cd gdb-VERSION/gdb
6135796c8dcSSimon Schubert	make check
6145796c8dcSSimon Schubert
6155796c8dcSSimon Schubertor
6165796c8dcSSimon Schubert
617cf7f2e2dSJohn Marino  (3)	cd gdb-VERSION/gdb/testsuite
6185796c8dcSSimon Schubert	make site.exp	(builds the site specific file)
6195796c8dcSSimon Schubert	runtest -tool gdb GDB=../gdb    (or GDB=<somepath> as appropriate)
6205796c8dcSSimon Schubert
6215796c8dcSSimon SchubertWhen using a `make'-based method, you can use the Makefile variable
6225796c8dcSSimon Schubert`RUNTESTFLAGS' to pass flags to `runtest', e.g.:
6235796c8dcSSimon Schubert
6245796c8dcSSimon Schubert	make RUNTESTFLAGS=--directory=gdb.cp check
6255796c8dcSSimon Schubert
6265796c8dcSSimon SchubertIf you use GNU make, you can use its `-j' option to run the testsuite
6275796c8dcSSimon Schubertin parallel.  This can greatly reduce the amount of time it takes for
6285796c8dcSSimon Schubertthe testsuite to run.  In this case, if you set `RUNTESTFLAGS' then,
6295796c8dcSSimon Schubertby default, the tests will be run serially even under `-j'.  You can
6305796c8dcSSimon Schubertoverride this and force a parallel run by setting the `make' variable
6315796c8dcSSimon Schubert`FORCE_PARALLEL' to any non-empty value.  Note that the parallel `make
6325796c8dcSSimon Schubertcheck' assumes that you want to run the entire testsuite, so it is not
6335796c8dcSSimon Schubertcompatible with some dejagnu options, like `--directory'.
6345796c8dcSSimon Schubert
6355796c8dcSSimon SchubertThe last method gives you slightly more control in case of problems
6365796c8dcSSimon Schubertwith building one or more test executables or if you are using the
6375796c8dcSSimon Schuberttestsuite `standalone', without it being part of the GDB source tree.
6385796c8dcSSimon Schubert
6395796c8dcSSimon SchubertSee the DejaGNU documentation for further details.
6405796c8dcSSimon Schubert
641a45ae5f8SJohn Marino
642a45ae5f8SJohn MarinoCopyright and License Notices
643a45ae5f8SJohn Marino=============================
644a45ae5f8SJohn Marino
645a45ae5f8SJohn MarinoMost files maintained by the GDB Project contain a copyright notice
646a45ae5f8SJohn Marinoas well as a license notice, usually at the start of the file.
647a45ae5f8SJohn Marino
648a45ae5f8SJohn MarinoTo reduce the length of copyright notices, consecutive years in the
649a45ae5f8SJohn Marinocopyright notice can be combined into a single range.  For instance,
650a45ae5f8SJohn Marinothe following list of copyright years...
651a45ae5f8SJohn Marino
652a45ae5f8SJohn Marino    1986, 1988, 1989, 1991-1993, 1999, 2000, 2007, 2008, 2009, 2010, 2011
653a45ae5f8SJohn Marino
654a45ae5f8SJohn Marino... is abbreviated into:
655a45ae5f8SJohn Marino
656a45ae5f8SJohn Marino    1986, 1988-1989, 1991-1993, 1999-2000, 2007-2011
657a45ae5f8SJohn Marino
658a45ae5f8SJohn MarinoEvery year of each range, inclusive, is a copyrightable year that
659a45ae5f8SJohn Marinocould be listed individually.
660a45ae5f8SJohn Marino
6615796c8dcSSimon Schubert
6625796c8dcSSimon Schubert(this is for editing this file with GNU emacs)
6635796c8dcSSimon SchubertLocal Variables:
6645796c8dcSSimon Schubertmode: text
6655796c8dcSSimon SchubertEnd:
666