mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
deprecate the-last-stack
* libguile/backtrace.h (scm_the_last_stack_fluid_var) * libguile/backtrace.c (scm_init_backtrace): No more scm_the_last_stack_fluid_var. The replacement is to resolve `the-last-stack' in (ice-9 stack-catch). (scm_backtrace_with_highlights): Accordingly, instead of backtracing the last stack, backtrace the current stack. * libguile/throw.h: * libguile/throw.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_internal_stack_catch): Deprecate this function. * module/ice-9/save-stack.scm (the-last-stack): Move here from boot-9. * module/ice-9/debug.scm: * module/ice-9/debugger.scm: Use (ice-9 save-stack) for the-last-stack. * module/ice-9/deprecated.scm (the-last-stack): Add deprecated shim.
This commit is contained in:
parent
a0d57eedfa
commit
ec16eb7847
10 changed files with 89 additions and 92 deletions
|
@ -1,4 +1,4 @@
|
|||
;;;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2006 Free Software Foundation
|
||||
;;;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2006, 2010 Free Software Foundation
|
||||
;;;;
|
||||
;;;; This library is free software; you can redistribute it and/or
|
||||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -20,7 +20,8 @@
|
|||
|
||||
|
||||
(define-module (ice-9 debug)
|
||||
:export (frame-number->index trace untrace trace-stack untrace-stack))
|
||||
#:use-module (ice-9 save-stack)
|
||||
#:export (frame-number->index trace untrace trace-stack untrace-stack))
|
||||
|
||||
|
||||
;;; {Misc}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#:use-module (ice-9 debugger utils)
|
||||
#:use-module (ice-9 debugging traps)
|
||||
#:use-module (ice-9 scm-style-repl)
|
||||
#:use-module (ice-9 save-stack)
|
||||
#:use-module (ice-9 format)
|
||||
#:export (debug-stack
|
||||
debug
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
default-pre-unwind-handler
|
||||
handle-system-error
|
||||
stack-saved?
|
||||
the-last-stack
|
||||
save-stack)
|
||||
|
||||
#:replace (module-ref-submodule module-define-submodule!))
|
||||
|
@ -654,6 +655,16 @@ the `(system repl common)' module.")
|
|||
(identifier? #'id)
|
||||
#'(@ (ice-9 save-stack) stack-saved?))))))
|
||||
|
||||
(define-syntax the-last-stack
|
||||
(lambda (x)
|
||||
(issue-deprecation-warning
|
||||
"`the-last-stack' is deprecated. Use it from `(ice-9 save-stack)'
|
||||
if you need it.")
|
||||
(syntax-case x ()
|
||||
(id
|
||||
(identifier? #'id)
|
||||
#'(@ (ice-9 save-stack) the-last-stack)))))
|
||||
|
||||
(define (save-stack . args)
|
||||
(issue-deprecation-warning
|
||||
"`save-stack' is deprecated. Use it from `(ice-9 save-stack)' if you need
|
||||
|
|
|
@ -32,11 +32,14 @@
|
|||
(define-module (ice-9 save-stack)
|
||||
;; Replace deprecated root-module bindings, if present.
|
||||
#:replace (stack-saved?
|
||||
the-last-stack
|
||||
save-stack))
|
||||
|
||||
;; FIXME: stack-saved? is broken in the presence of threads.
|
||||
(define stack-saved? #f)
|
||||
|
||||
(define the-last-stack (make-fluid))
|
||||
|
||||
(define (save-stack . narrowing)
|
||||
(if (not stack-saved?)
|
||||
(begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue