All Manuals > LispWorks® User Guide and Reference Manual > 34 The DBG Package

output-backtrace Function


Prints a backtrace of the current stack. For use in exception handling routines.




output-backtrace keyword &key stream printer-bindings

Defines how verbose the output should be. It can be one of :quick, :brief, :verbose or :bug-form, in increasing order of verbosity.
An output stream designator.
A list of conses.

The function output-backtrace prints a backtrace of the current stack.

The output goes to the stream designated by stream.

printer-bindings, if supplied, must be a list of conses, where the car of each cons is a symbol. printer-bindings is ignored if keyword is :quick. Otherwise, around the actual printing it binds each symbol to the value in the cdr of the cons. This is intended to override the bindings that are used in the functions that output-backtrace uses.

output-backtrace should be used by applications in their exception handling routines to log a backtrace whenever an unexpected situation arises. In general, any application that is not intended to be used by Lisp programmers should have error handlers to deal with unexpected situations, and all these handlers should use output-backtrace.


The symbols that can be bound are not limited to "printer" symbols, so the name printer-bindings is slightly misleading.

See also


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:32