Installing ldb
Norman Ramsey
Department of Computer Science, Princeton University
Princeton, NJ 08544
ldb is a prototype of a
retargetable debugger for the lcc ANSI C compiler.
Extract the distribution into its own directory.
(All paths below are relative to this directory.)
Installation proceeds as follows:
- 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_DIR.
- Get and install lcc.
- From the root directory of the lcc distribution,
apply the patches in lcc-3.2-patch of the ldb distribution.
The current patches apply to lcc version 3.2; if you have a
different 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.
- Change the option() function for your target to recognize
the
-G option. See linux.c for an example.
This option should:
- Use the linker in $PKG_DIR/ldb-ld/BUILD/ldb-ld
instead of ld (in ld[0]).
- Use the startup code in $PKG_DIR/ldb-nub/BUILD/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' and go out for a long lunch while your machine
builds and ships one package after another.
If anything goes wrong, you will have to consult the
README file to determine what package
failed to build and hazard a guess why.
Please report problems to
nr@princeton.edu.