next up previous contents
Next: 3.5.2 Source Location Availability Up: 3.5 Source Location Printing Previous: 3.5 Source Location Printing

3.5.1 How the Source is Found

If the code was defined from Common Lisp by compile or eval, then the source can always be reliably located. If the code was defined from a fasl file created by  compile-file, then the debugger gets the source forms it prints by reading them from the original source file. This is a potential problem, since the source file might have moved or changed since the time it was compiled.

The source file is opened using the truename of the source file pathname originally given to the compiler. This is an absolute pathname with all logical names and symbolic links expanded. If the file can't be located using this name, then the debugger gives up and signals an error.

If the source file can be found, but has been modified since the time it was compiled, the debugger prints this warning:

; File has been modified since compilation:
;   filename
; Using form offset instead of character position.
where filename is the name of the source file. It then proceeds using a robust but not foolproof heuristic for locating the source. This heuristic works if:

If the heuristic doesn't work, the displayed source will be wrong, but will probably be near the actual source. If the ``shape'' of the top-level form in the source file is too different from the original form, then an error will be signalled. When the heuristic is used, the the source location commands are noticeably slowed.

Source location printing can also be confused if (after the source was compiled) a read-macro you used in the code was redefined to expand into something different, or if a read-macro ever returns the same eq list twice. If you don't define read macros and don't use ## in perverted ways, you don't need to worry about this.


next up previous contents
Next: 3.5.2 Source Location Availability Up: 3.5 Source Location Printing Previous: 3.5 Source Location Printing

Raymond Toy
Mon Jul 14 09:11:27 EDT 1997