Notes on making gdb 4.5 under Linux
-----------------------------------

Compiler used: gcc 2.11c beta (May 20 1992)
Kernel used: 0.96a, patchlevel 3 (plus core dump patches, 
attach/detach patches )

This version of gdb is identical to the previous version except that
it is capable of reading core dump files that the kernel has now been patched
to make.  It is also has the attach/detach functions enabled.

a. System includes

  gdb uses sys/reg.h, which doesn't exist in
  Linux.  The workaround is to do the following:

  ln -s /usr/include/sys/ptrace.h /usr/include/sys/reg.h

  gdb also needs the include file /usr/include/sys/user.h, which
  should be identical to the file /usr/src/linux/include/sys/user.h.

b. Library changes/additions

  The libc that comes with gcc 2.11c contains the correct
  ptrace and wait functions to work with gdb.  Previous versions
  needed replacement functions.  A 0.96 kernel is required for
  gdb to work properly.

c. Kernel patches

  Note that you will need a kernel subsequent to 0.96a,patchlevel3
  for core dumping and attach/detach to take place.

d. gdb patches (gdb-4.5.diffs)

  These patches are based essentially on Ross Biro's patches to
  gdb 4.5, but include modifications for the new gcc 2.1 compiler,
  allowance for various filename changes made between the two
  releases, some additional patches to bfd/aout-target.h
  which allow for Linux's unique a.out header, patches
  to enable the "trad-core" style of core dump, and
  a patch to enable the attach/detach function.

e. info and man page

  The subdirectory 'info' contains the formated info files for
  gdb, which I find far more helpful to have around than the
  man pages (although the latter is also here too).  To install
  these so that they're automatically accessible without requiring
  command line arguments to 'info' and accessible from within
  GNU Emacs' "info" command, move these to /usr/local/emacs/info
  and insert a menu node which references "gnu.info" into the
  'dir' file.

f. Tricks that gdb does not know how to do under linux.

    gdb cannot do a 'info float' under linux.  More functionality
    needs to be added to the ptrace(3,...) function before this
    can be a reality.  Also, much of the code that performs the
    'info float' command has been commented out in the gdb-4.5
    distribution, probably for some good reason.


-Eric Youngdale

eric@tantalus.nrl.navy.mil     or     youngdale@v6550c.nrl.navy.mil
