GDB Internals

Node:Porting GDB, Next:Releasing GDB, Previous:Coding, Up:Top

## Porting GDB

Most of the work in making GDB compile on a new machine is in specifying the configuration of the machine. This is done in a dizzying variety of header files and configuration scripts, which we hope to make more sensible soon. Let's say your new host is called an xyz (e.g., `sun4`), and its full three-part configuration name is ``arch`-`xvend`-`xos`` (e.g., `sparc-sun-sunos4`). In particular:

- In the top level directory, edit `config.sub` and add arch, xvend, and xos to the lists of supported architectures, vendors, and operating systems near the bottom of the file. Also, add xyz as an alias that maps to ``arch`-`xvend`-`xos``. You can test your changes by running

                ./config.sub xyz

  and

                ./config.sub arch-xvend-xos

  which should both respond with ``arch`-`xvend`-`xos`` and no error messages.

  You need to port BFD, if that hasn't been done already. Porting BFD is beyond the scope of this manual.

- To configure GDB itself, edit `gdb/configure.host` to recognize your system and set `gdb_host` to xyz, and (unless your desired target is already available) also edit `gdb/configure.tgt`, setting `gdb_target` to something appropriate (for instance, xyz).

  Maintainer's note: Work in progress. The file `gdb/configure.host` originally needed to be modified when either a new native target or a new host machine was being added to GDB. Recent changes have removed this requirement. The file now only needs to be modified when adding a new native configuration. This will likely changed again in the future.

- Finally, you'll need to specify and define GDB's host-, native-, and target-dependent `.h` and `.c` files used for your configuration.

### Configuring GDB for Release

From the top level directory (containing `gdb`, `bfd`, `libiberty`, and so on):

         make -f Makefile.in gdb.tar.gz

This will properly configure, clean, rebuild any files that are distributed pre-built (e.g. `c-exp.tab.c` or `refcard.ps`), and will then make a tarfile. (If the top level directory has already been configured, you can just do `make gdb.tar.gz` instead.)

This procedure requires:

- symbolic links;
- `makeinfo` (texinfo2 level);
- TeX;
- `dvips`;
- `yacc` or `bison`.

... and the usual slew of utilities (`sed`, `tar`, etc.).

#### TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION

`gdb.texinfo` is currently marked up using the texinfo-2 macros, which are not yet a default for anything (but we have to start using them sometime).

For making paper, the only thing this implies is the right generation of `texinfo.tex` needs to be included in the distribution.

For making info files, however, rather than duplicating the texinfo2 distribution, generate `gdb-all.texinfo` locally, and include the files `gdb.info*` in the distribution. Note the plural; `makeinfo` will split the document into one overall file and five or so included files.