Previous: Introduction Up: A Programmer's Guide for AKCL and MAXIMA Next: Converting Franz Lisp Programs to AKCL

Tracing and Debugging

To debug your programs written in CL, for Maxima or otherwise, you can use the trace command to put traces on functions.


(trace fn1 fn2 ...)
If trace is given no argument, it displays all functions currently traced. untrace removes traces. You can also use the more elaborate form

(trace (fn1 :keyword form)   ...)
For example,

(trace (fn1 :cond (prog2 (break) t) ))
will break after fn1 is called allowing you a break loop in the environment where si::arglist holds the arguments passed to the traced function fn1. This also gives to a chance to install/remove traces (and breaks). We made the :cond condition return true to trigger the default trace :entry and :exit display.

Furthermore, at a break point the full set of break loop commands (:r, ":b", etc.) are available. Other keywords are available ({\bf akclman} \verbtrace?).

From Maxima top level, type ^C to enter the CL level and a CL break loop. From the CL level type :t to reenter Maxima top level.

farrell@mcs.kent.edu