GDB on Lites


Summary

GDB 4.14 support on Lites is now available, with source and binaries for x86 and PA-RISC provided. To run it, Lites-1.1.u2 is required as well.

Details
Thanks primarily to Jukka Virtanen (jtv@hut.fi), there was already a GDB configuration for Mach which interacts directly with the kernel and requires very little support in the OS personality server on which the debugged binary is running. Additionally, it is thread and task savvy, making it much nicer in the Mach environment.

Adapting it to Lites required some changes to both the Lites emulator/server and GDB itself. The technical changes are all related to allowing GDB to gain control of a Lites process at exec time. This is done by GDB interposing itself between the emulator and server in the debugged process. The mechanics of how the interposition is done are what differs between Lites and, say, CMU's UX server or OSF's OSF/1 server. The change to Lites itself was the addition of a new interface routine bsd_exec_done whose sole purpose is to allow an interposing GDB to gain control at the correct time (the existing bsd_exec routines are called before the address space is set up). The GDB changes had to do with getting the fake request port correctly set up and removed in the debugged process (task).

Other changes were made so that a single GDB x86 binary can recognize and support all of netbsd, FreeBSD, and Linux binaries. New configuration files were also required for building in (or targeting) a Lites environment. More details, including some installation details, are available in a README accompanying the binaries.

Availability
In order to run GDB on Lites you need the Utah Lites Release 1.1.u2 and the modified version of GDB, gdb-4.14.u5. Source and binaries for both are available for FTP from flux.cs.utah.edu (currently same machine as ``jaguar''). Our Lites release page contains links to these ftp locations.


Build Instructions

If you feel the need to rebuild GDB, here's how to do it.

On the 386:
Assuming that you've got a suitable build environment (you'll need a libc, libmachid, libnetname and a modified crt0 at least), you should be able to do this:

	cd <gdb-directory>
	configure i386-lites
	gmake MAKE=gmake
A patch to the NetBSD-1.0/FreeBSD's crt0.c so it can be used with Mach can be found at:
flux.cs.utah.edu:/flux/binaries/i386/netbsd/netbsd-crt0-patch.
flux.cs.utah.edu:/flux/binaries/i386/freebsd/freebsd-crt0-patch.

To build on the PA under Lites:

	cd <gdb-directory>
	configure hppa1.1-hp-lites
	gmake MAKE=gmake
This should build a version of GDB that knows about ELF (the Lites native format on the PA) and SOM (the Utah HPBSD and HP HP-UX format). The major known problem with GDB on the PA is that it cannot correctly back trace when debugging from ELF format files. This is due to bugs in our ELF tool chain which should be fixed at some point in the future.
Mike Hibler <mike@cs.utah.edu>
Steve Clawson <sclawson@cs.utah.edu>
September 18, 1995