diff options
author | Andy Wingo <wingo@pobox.com> | 2010-07-10 12:21:50 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-07-10 12:21:50 +0200 |
commit | 5273854080c0536563ca1538716a1e18dfde187b (patch) | |
tree | 260d25c331504b94c29b5aac6a44160ed205b33d /module/system/repl/error-handling.scm | |
parent | dc3b2661183786587350b19b97aefeec556cc54e (diff) | |
download | guile-5273854080c0536563ca1538716a1e18dfde187b.tar.gz |
finally, backtraces only showing frames for the computation
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
prompt, similar to the default prompt. Gives proper backtraces.
* module/system/repl/error-handling.scm (call-with-error-handling):
Narrow one more outer frame, for the %start-stack thunk invocation.
* module/ice-9/boot-9.scm (%start-stack): Reindent.
Diffstat (limited to 'module/system/repl/error-handling.scm')
-rw-r--r-- | module/system/repl/error-handling.scm | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/module/system/repl/error-handling.scm b/module/system/repl/error-handling.scm index d7d43bd71..28b542830 100644 --- a/module/system/repl/error-handling.scm +++ b/module/system/repl/error-handling.scm @@ -88,15 +88,19 @@ (format #t " or `,q' to return to the old prompt.\n") (let ((debug (make-debug - (narrow-stack->vector - stack - ;; Cut three frames from the top of the stack: - ;; make-stack, this one, and the throw handler. - 3 - ;; Narrow the end of the stack to the most recent - ;; start-stack. - (and (pair? (fluid-ref %stacks)) - (cdar (fluid-ref %stacks)))) + (let ((tag (and (pair? (fluid-ref %stacks)) + (cdar (fluid-ref %stacks))))) + (narrow-stack->vector + stack + ;; Cut three frames from the top of the stack: + ;; make-stack, this one, and the throw handler. + 3 + ;; Narrow the end of the stack to the most recent + ;; start-stack. + tag + ;; And one more frame, because %start-stack invoking + ;; the start-stack thunk has its own frame too. + 0 (and tag 1))) 0))) ((@ (system repl repl) start-repl) #:debug debug))))))) ((pass) |