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:

  1. 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.
  2. Get and install lcc.
  3. 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.

  4. Change the option() function for your target to recognize the -G option. See linux.c for an example. This option should: 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.
  5. Re-build and re-install install the lcc driver and rcc compiler.
  6. 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.