[slime-devel] Simplifying backtraces in the debugger

Helmut Eller heller at common-lisp.net
Mon Oct 27 19:21:36 UTC 2008


* Steven E. Harris [2008-10-27 00:37+0100] writes:

[...]
> If I ran across this output in a large program, I'd probably be most
> interested in frame 14, where the division operator is being
> evaluated. Expanding it shows that "N" was bound to 3.
>
> Is there some way to configure SLIME to sift through these frames and
> reduce them to something more "interesting"? For instance, by my
> criteria, everything in frames 1 through 12 above is irrelevant to the
> debugging intent, unless I was trying to debug the debugger.

Not unless you are willing to improve the CLISP backend.  E.g. the
backend could skip over the top frames until the frame for
invoke-debugger, break, or something like that.  There is also a
function swank-backend::boring-frame-p which could possibly be
customized.

Problem is, CLISP doesn't have a debugger API (or something that would
be worth the name API), and currently the backend only prints the
"frames" to strings and does some regexp matching on those strings.
That's no fun.

> As an aside, I'd appreciate any comparison in the output to other
> implementations besides CLISP. Are they less chatty?

CMUCL:

  Arithmetic error division-by-zero signalled.
  Operation was kernel::division, operands (3 0).
     [Condition of type division-by-zero]
  
  Restarts:
   0: [retry] Retry SLIME REPL evaluation request.
   1: [abort] Return to SLIME's top level.
   2: [abort] Return to Top-Level.
  
  Backtrace:
    0: (kernel::integer-/-integer 3 0)
    1: (/ 3 0)
    2: (swank::eval-region "(foo 0)\n")
    3: ("defun repl-eval")
    4: (swank::track-package #<Closure Over Function "defun repl-eval" {587FA8B1}>)
    5: (swank::call-with-retry-restart "Retry SLIME REPL evaluation request." #<Closure Over Function "defun repl-eval" {587FA841}>)
    ...


Lispworks:

  Division-by-zero caused by / of (3 0).
     [Condition of type division-by-zero]
  
  Restarts:
   0: [value] Return a value to use.
   1: [new-args] Supply new arguments to use.
   2: [retry] Retry SLIME REPL evaluation request.
   3: [abort] Return to SLIME's top level.
   4: [abort] Quit process.
  
  Backtrace:
    0: conditions::conditions-error (:invisiblep t #<division-by-zero 200B8AA7> nil)
    1: system::division-by-zero-error (/ 3 0)
    2: / (3 &rest (0))
    3: foo nil
    4: system::*%apply-interpreted-function-proper-function (:invisiblep t &rest (0))
    5: system::%invoke nil
    6: system::%eval ((foo 0))
    7: eval ((foo 0))
    8: swank::eval-region ("(foo 0)\n")
    9: (subfunction 1 swank::repl-eval) nil
   10: swank::track-package (#<Closure (swank::repl-eval . 1) 200B071A>)
   11: swank::call-with-retry-restart ("Retry SLIME REPL evaluation request." #<Closure (swank::repl-eval . 1) 200B0702>)
  ...
 

Clozure CL:

  DIVISION-BY-ZERO detected
     [Condition of type DIVISION-BY-ZERO]
  
  Restarts:
   0: [RETRY] Retry SLIME REPL evaluation request.
   1: [ABORT] Return to SLIME's top level.
   2: [ABORT-BREAK] Reset this process
   3: [ABORT] Kill this process
  
  Backtrace:
    0: (CCL::%FIXNUM-TRUNCATE)
    1: (CCL::INTEGER-/-INTEGER 3 0)
    2: (CCL::CALL-CHECK-REGS FOO 0)
    3: (SWANK::EVAL-REGION "(foo 0)\n")
    4: ((:INTERNAL SWANK::REPL-EVAL))
    5: (SWANK::TRACK-PACKAGE #<COMPILED-LEXICAL-CLOSURE (:INTERNAL SWANK::REPL-EV$
    6: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<C$





More information about the slime-devel mailing list