Go to the first, previous, next, last section, table of contents.


Debugging dll applications

The data structure used by the dll package contains both forward and backward pointers. The primitives in Emacs, such as print, know nothing about dlls, so when Emacs tries to print out a dll it will think that it found a circular structure. Fortunately it detects this situation and gives an error message, instead of getting stuck in an eternal loop.

The error message can be quite annoying when you are developing an application that uses dlls. Suppose your code has an error, and you type `(setq debug-on-error t)' to try to figure out exactly what the error is. If any function in the backtrace has a dll as an argument, Emacs will abort printing the entire backtrace and only respond with a "Back at top level" message (or something similar, depending on exactly what you are doing) in the echo area.

There are two solutions to this problem: patch your emacs so that it detects circular structures (there have been patches for this floating around the net) or use `dll-debug.el'.

The file `dll-debug.el' implements all of the functionality that are present in `dll.el', but it uses a normal, singly linked list instead. This makes some operations, like `dll-previous', dreadfully slow, but it makes it possible to debug dll applications. `dll-debug.el' also has more built-in sanity tests than `dll.el'.

NOTE: To use the debug package, you must load the library `dll-debug' before you load any of the libraries (such as cookie) or your program that use dll. You must also make sure that you don't load any byte-compiled version of any file that was compiled with the normal dll library. Since it contains some macros very strange results will occur otherwise...

When the debug package is loaded, you simply run your code normally, and any bugs should be easier to trace.


Go to the first, previous, next, last section, table of contents.