From: Michel T. <ta...@lp...> - 2025-07-21 10:30:02
|
Le 19/07/2025 à 18:36, Robert Dodier a écrit : > Setting breakpoints isn't straightforward, from what I know. Here's my > clumsy workaround. Like Robert i have not found the lisp debugger of gcl usable. I think the first step to debug something in maxima is to use a maxima compiled with sbcl. Then to set breakpoints at entry of a function one can use the sbcl extension of the trace function such as: :lisp (trace 'some-function' :break true) If one wants to single step the program one must first recompile it setting some (declaim (optimize (debug 3))) at its beginning. The at the breakpoint one can say first: start which starts tracing and the commands like step to single step, etc. One then gets something very close to what gdb allows. Here are some extracts from sbcl documentation: (describe 'trace) :BREAK Form :BREAK-AFTER Form :BREAK-ALL Form If specified, and Form evaluates to true, then the debugger is invoked at the start of the function, at the end of the function, or both, according to the respective option. and for the debugger, printing *DEBUG-HELP-STRING* Inspecting frames: BACKTRACE [n] shows n frames going down the stack. LIST-LOCALS, L lists locals in current frame. PRINT, P displays function call for current frame. SOURCE [n] displays frame's source form with n levels of enclosing forms. Stepping: START Selects the CONTINUE restart if one exists and starts single-stepping. Single stepping affects only code compiled with under high DEBUG optimization quality. See User Manual for details. STEP Steps into the current form. NEXT Steps over the current form. OUT Stops stepping temporarily, but resumes it when the topmost frame that was stepped into returns. STOP Stops single-stepping. -- Michel Talon |