#!/usr/bin/guile \ --debug -e main -s !# (use-modules (ice-9 debug)) (debug-enable 'trace) (trace-stack #t) ;;(debug-enable 'backtrace) ;;(format #t "~s~%" (debug-options)) ;;(format #t "~s~%" (traps)) ;;(format #t "~s~%" (evaluator-traps-interface)) ;;(format #t "~s~%" (list (@@(ice-9 debug) ;; trace-exit) ;; (@@(ice-9 debug) trace-entry))) ;;(evaluator-traps-interface `( exit-frame-handler ,(@@(ice-9 debug) trace-exit ))) ;;(evaluator-traps-interface `(apply-frame-handler ,(@@(ice-9 debug) trace-entry))) ;;(format #t "~s~%" (evaluator-traps-interface)) ;; ;;(format (current-error-port) "This message appears on the current error port.~%") ;;(format #t "traced-stack-ids: ~s~%" (@@(ice-9 debug) traced-stack-ids)) ;;(format #t "trace-all-stacks? ~s~%" (@@(ice-9 debug) trace-all-stacks?)) (define (something arg) (if (not (positive? arg)) 0 (+ arg (something (- arg 1))))) (define (main . args) ;; (trace something) (something (string->number (list-ref (car args) 1)))) (trace something) (with-traps (lambda () (something 9)))