Extract the distribution into its own directory.
(All paths below are relative to this directory.)
Installation proceeds as follows:
- If you don't have it already, get and install
Icon.
You don't need the Icon compiler; icont is sufficient, so you
can probably pick up a binary distribution.
- If you don't have it already, get and install noweb.
Since you'll have Icon, you might as well use the Icon library
option when building noweb.
- If you don't have it already, get and install
SRC Modula-3.
Make sure the directory containing the Modula-3 binaries is on
your search path, since the ldb binaries will also be
installed there.
Take note of the default directory where m3ship installs
packages, since ldb and lcc will install and
look for code in such packages. We refer to that directory below
as $PKG_INSTALL.
You'll need to know the name of the subdirectory where m3build
puts machine-dependent stuff; there are lots of possibilities,
like SPARC, SOLgnu, LINUXELF, etc.
You'll also need to know where m3ship puts binaries; we'll call
that directory $BIN_INSTALL.
You'll need at least version 3.5.4-B, and unless you have a
later version you'll need to fix the quake code for derived_c.
- Get and install lcc.
ldb requires version 3.4b, but the patches supplied may work
with more recent versions.
- From the root directory of the lcc distribution,
apply the patches in lcc-3.4b-patch of the ldb distribution.
The current patches apply to lcc version 3.4b; if you have a
later version of lcc, you may have to apply one or more
patches by hand.
The patches change the lcc driver and sources so that
lcc -G
makes lcc generate symbol tables for
ldb. They should also create the files
src/ldbstab.c and src/ldbstab.h in the lcc
distribution.
They also change src/makefile and the bind table
src/bind.c.
- If you are using the Linux distribution, unpack the additional
Linux files on top of the patched lcc, then apply
lcc-3.4b-linux-patch. I have tested this patch against Ken
Yap's Linux ELF distribution, not the Linux a.out distribution.
- Change the option() function for your target to recognize
the
-G
option. See etc/linux.c or etc/labrador.c
for an examples.
This option should:
- Use the linker in $BIN_INSTALL/ldb-ld
instead of ld (in ld[0]).
- Use the startup code in $PKG_DIR/ldb-nub/$TARGET/crt0.o
- Load the ``debug nub'' in
$PKG_DIR/ldb-nub/BUILD/Cnub.o with every program.
You should be able to make most of this stuff work just by
changing libprefix in the sample code.
You may need to add an extra empty string to the ld[] command.
- Re-build and re-install install the lcc driver and rcc compiler.
- Now return to the ldb distribution directory and change to the
pkg subdirectory. If all goes well, you should be able
to type `make debugger' and go out for a long lunch while your machine
builds and ships one package after another.
Among the many files created and shipped is the debugger
ldb and the standalone PostScript interpreter
m3ps. They are actually the same executable, but it does
different things depending on its name.
If anything goes wrong, you will have to consult the
guide to the source to determine what package
failed to build and hazard a guess why.
You only need to build a debugger on one machine; from that
machine, you should be able to teledebug to any machine supported
by ldb (all two of them).
- You also have to build a debug nub on every machine you want to
run target programs on.
At the moment, the debug nub makes strongly BSD-ish assumptions,
especially about signal handling.
It definitely works under SunOS 4.1, and it might work on DEC ULTRIX.
I hope a good person will do a POSIX version soon.
To build the debug nub, type `make debugger', also in the pkg
subdirectory of the ldb distribution.
Even though the debug nub is written entirely in C and assembly
language, it still uses the Modula-3 m3build program to do
the building and installation, so you'll need that on your platform.
With luck, you can now run programs compiled with