Node:Debugger options, Next:, Previous:Printing options, Up:Runtime Options



33.3.7 Debugger options

Here is the list of print options generated by typing (debug-options 'full) in Guile. You can also see the default values.

stack           20000   Stack size limit (0 = no check).
debug           yes     Use the debugging evaluator.
backtrace       no      Show backtrace on error.
depth           20      Maximal length of printed backtrace.
maxdepth        1000    Maximal number of stored backtrace frames.
frames          3       Maximum number of tail-recursive frames in backtrace.
indent          10      Maximal indentation in backtrace.
backwards       no      Display backtrace in anti-chronological order.
procnames       yes     Record procedure names at definition.
trace           no      *Trace mode.
breakpoints     no      *Check for breakpoints.
cheap           yes     *Flyweight representation of the stack at traps.
33.3.7.1 Stack overflow

Stack overflow errors are caused by a computation trying to use more stack space than has been enabled by the stack option. They are reported like this:

(non-tail-recursive-factorial 500)
-|
ERROR: Stack overflow
ABORT: (stack-overflow)

If you get an error like this, you can either try rewriting your code to use less stack space, or increase the maximum stack size. To increase the maximum stack size, use debug-set!, for example:

(debug-set! stack 200000)
=>
(show-file-name #t stack 200000 debug backtrace depth 20 maxdepth 1000 frames 3 indent 10 width 79 procnames cheap)

(non-tail-recursive-factorial 500)
=>
122013682599111006870123878542304692625357434...

If you prefer to try rewriting your code, you may be able to save stack space by making some of your procedures tail recursive. For a description of what this means, see Proper tail recursion.