Next: , Previous: , Up: Debugger Programmer’s Interface   [Contents][Index]


11.8 Debug-sources

Debug-sources represent how to get back the source for some code. The source is either a file (compile-file or load), a lambda-expression (compile, defun, defmacro), or a stream (something particular to CMUCL, compile-from-stream).

When compiling a source, the compiler counts each top-level form it processes, but when the compiler handles multiple files as one block compilation, the top-level form count continues past file boundaries. Therefore code-location-top-level-form-offset returns an offset that does not always start at zero for the code-location’s debug-source. The offset into a particular source is code-location-top-level-form-offset minus debug-source-root-number.

Inside a top-level form, a code-location’s form number indicates the subform corresponding to the code-location.

Function: debug-source-from debug-source

This function returns an indication of the type of source. The following are the possible values:

:file

from a file (obtained by compile-file if compiled).

:lisp

from Lisp (obtained by compile if compiled).

:stream

from a non-file stream (CMUCL supports compile-from-stream).

Function: debug-source-name debug-source

This function returns the actual source in some sense represented by debug-source, which is related to debug-source-from:

:file

the pathname of the file.

:lisp

a lambda-expression.

:stream

some descriptive string that’s otherwise useless.

Function: debug-source-created debug-source

This function returns the universal time someone created the source. This may be nil if it is unavailable.

Function: debug-source-compiled debug-source

This function returns the time someone compiled the source. This is nil if the source is uncompiled.

Function: debug-source-root-number debug-source

This returns the number of top-level forms processed by the compiler before compiling this source. If this source is uncompiled, this is zero. This may be zero even if the source is compiled since the first form in the first file compiled in one compilation, for example, must have a root number of zero—the compiler saw no other top-level forms before it.


Next: Source Translation Utilities, Previous: Code-locations, Up: Debugger Programmer’s Interface   [Contents][Index]