%W% %G%

This is "TDB" -- Tom's incredible source linked prolog DeBugger!!!

To use it, run a version of XEmacs (formerly known as Lucid Emacs) that
has a release number greater than or equal to 19.9.

To determine the version of emacs you are running, look at the variable

	emacs-version's value is "19.11 XEmacs Lucid"

XEmacs can be downloaded from cs.uiuc.edu:/pub/xemacs

To debug Prolog: at the Prolog prompt, issue the command
['tdb/tdb']. Then the next time you start debugging, you'll be debugging
with the source zooming by.

** customizing TDB

TDB uses the XEmacs "face" facility for indicating where you are in the
source. At this writing, tdb-face is simply

	(set-face-foreground 'tdb-face "black")
	(set-face-background 'tdb-face "LightYellow")

If you haven't a color machine, try putting in your .emacs

	(set-face-underline-p 'tdb-face t)

** TDB as a client

You do not have to be running Prolog under XEmacs, or even running
Prolog on the same machine. In these situations, TDB uses the program
"gnuserv", which is distributed with the 19.11 release of XEmacs, to
establish a network connection to XEmacs. This way, your Prolog process
becomes a client to XEmacs.

To do this, your XEmacs session will have to be running "gnuserv". You
might want to try something like the following to your .emacs

    (defun maybe-load-gnuserv (process output)
      (cond
       ((string-match (getenv "GNU_HOST") output)

	(require 'gnuserv)
	(server-start))))

    (set-process-filter (start-process "uname" nil "uname" "-n")
			'maybe-load-gnuserv)

Notice that this requires that you have an environment variable GNU_HOST
defined. "GNU_HOST" should be the name of the machine on which "gnuserv"
is running. TDB uses this environment variable as well.

If your XEmacs was installed correctly, and your MANPATH is right, you
should be able to read more about "gnuserv" by issuing the command

	man gnuserv

** Future work

Create an ancestors window, which will be similar to a dired window. From
this we can do "retry" and "up/down" operations.

Should probably be using tooltalk instead of tcp.

- Tom Howland (tom@rahul.net)
