Previous: Backtrace, Up: Debugging Features


11.4 Fancy Debugging

The facilities in the previous section are normally enabled for every Guile session and as such, are relatively light-weight. You can use a more featureful debugger, with its own read-eval-print loop, by evaluating the form:

     (use-modules (ice-9 debugger))

This provides the repl's single entry point debug, which can be invoked upon an error condition. For example:

     guile> (+ 3 "five")
     
     Backtrace:
     0* [+ 3 "five"]
     
     standard input:2:1: In procedure + in expression (+ 3 "five"):
     standard input:2:1: Wrong type argument: "five"
     ABORT: (wrong-type-arg)
     
     guile> (debug)
     This is the Guile debugger; type "help" for help.
     There are 1 frames on the stack.
     
     Frame 0:    [+ 3 "five"]
     debug> help
     Type "help" followed by a command name for full documentation.
     Available commands are:
       backtrace
       down
       evaluate
       frame
       help
       info
       position
       quit
       up
     debug>

Note that the prompt changes from guile> to debug>.