gdbint.info: Porting GDB

Go forward to Releasing GDB
Go backward to Coding
Go up to Top
Go to the top op gdbint

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.