mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 06:20:23 +02:00
fix backtraces with compiled boot-9
* module/ice-9/boot-9.scm (default-pre-unwind-handler): Since we were tail-called by pre-unwind-handler-dispatch, we can't use pre-unwind-handler-dispatch as a narrowing argument. Instead just narrow by one frame. (pre-unwind-handler-dispatch): Deprecate. (error-catching-loop): Remove crack comment and code, and just use default-pre-unwind-handler as our pre-unwind handler. * module/ice-9/stack-catch.scm (stack-catch): * module/system/repl/repl.scm (call-with-backtrace): Use default-pre-unwind-handler directly.
This commit is contained in:
parent
9d07bb7276
commit
1351c2dba5
3 changed files with 7 additions and 14 deletions
|
@ -2443,11 +2443,12 @@ module '(ice-9 q) '(make-q q-length))}."
|
||||||
(define (set-repl-prompt! v) (set! scm-repl-prompt v))
|
(define (set-repl-prompt! v) (set! scm-repl-prompt v))
|
||||||
|
|
||||||
(define (default-pre-unwind-handler key . args)
|
(define (default-pre-unwind-handler key . args)
|
||||||
(save-stack pre-unwind-handler-dispatch)
|
(save-stack 1)
|
||||||
(apply throw key args))
|
(apply throw key args))
|
||||||
|
|
||||||
(define (pre-unwind-handler-dispatch key . args)
|
(begin-deprecated
|
||||||
(apply default-pre-unwind-handler key args))
|
(define (pre-unwind-handler-dispatch key . args)
|
||||||
|
(apply default-pre-unwind-handler key args)))
|
||||||
|
|
||||||
(define abort-hook (make-hook))
|
(define abort-hook (make-hook))
|
||||||
|
|
||||||
|
@ -2524,15 +2525,7 @@ module '(ice-9 q) '(make-q q-length))}."
|
||||||
(else
|
(else
|
||||||
(apply bad-throw key args)))))))
|
(apply bad-throw key args)))))))
|
||||||
|
|
||||||
;; Note that having just `pre-unwind-handler-dispatch'
|
default-pre-unwind-handler)))
|
||||||
;; here is connected with the mechanism that
|
|
||||||
;; produces a nice backtrace upon error. If, for
|
|
||||||
;; example, this is replaced with (lambda args
|
|
||||||
;; (apply pre-unwind-handler-dispatch args)), the stack
|
|
||||||
;; cutting (in save-stack) goes wrong and ends up
|
|
||||||
;; saving no stack at all, so there is no
|
|
||||||
;; backtrace.
|
|
||||||
pre-unwind-handler-dispatch)))
|
|
||||||
|
|
||||||
(if next (loop next) status)))
|
(if next (loop next) status)))
|
||||||
(set! set-batch-mode?! (lambda (arg)
|
(set! set-batch-mode?! (lambda (arg)
|
||||||
|
|
|
@ -40,4 +40,4 @@ this call to @code{catch}."
|
||||||
(catch key
|
(catch key
|
||||||
thunk
|
thunk
|
||||||
handler
|
handler
|
||||||
pre-unwind-handler-dispatch))
|
default-pre-unwind-handler))
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
(catch #t
|
(catch #t
|
||||||
(lambda () (%start-stack #t thunk))
|
(lambda () (%start-stack #t thunk))
|
||||||
default-catch-handler
|
default-catch-handler
|
||||||
pre-unwind-handler-dispatch))
|
default-pre-unwind-handler))
|
||||||
|
|
||||||
(define-macro (with-backtrace form)
|
(define-macro (with-backtrace form)
|
||||||
`(call-with-backtrace (lambda () ,form)))
|
`(call-with-backtrace (lambda () ,form)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue