mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 15:00:21 +02:00
Remove frame->module
* module/system/repl/debug.scm (frame->module): Remove. Has been broken for a while, had no callers, and was calling frame-procedure. We can revive again in a better way, like ice-9 local-eval.
This commit is contained in:
parent
dfbe869e24
commit
a7e1c392c2
1 changed files with 1 additions and 28 deletions
|
@ -34,7 +34,7 @@
|
||||||
make-debug debug?
|
make-debug debug?
|
||||||
debug-frames debug-index debug-error-message
|
debug-frames debug-index debug-error-message
|
||||||
terminal-width
|
terminal-width
|
||||||
print-registers print-locals print-frame print-frames frame->module
|
print-registers print-locals print-frame print-frames
|
||||||
stack->vector narrow-stack->vector
|
stack->vector narrow-stack->vector
|
||||||
frame->stack-vector))
|
frame->stack-vector))
|
||||||
|
|
||||||
|
@ -164,33 +164,6 @@
|
||||||
(lp (+ i inc)
|
(lp (+ i inc)
|
||||||
(frame-source frame)))))))
|
(frame-source frame)))))))
|
||||||
|
|
||||||
;; Ideally here we would have something much more syntactic, in that a set! to a
|
|
||||||
;; local var that is not settable would raise an error, and export etc forms
|
|
||||||
;; would modify the module in question: but alack, this is what we have now.
|
|
||||||
;; Patches welcome!
|
|
||||||
(define (frame->module frame)
|
|
||||||
(let ((proc (frame-procedure frame)))
|
|
||||||
(if #f
|
|
||||||
;; FIXME: program-module does not exist.
|
|
||||||
(let* ((mod (or (program-module proc) (current-module)))
|
|
||||||
(mod* (make-module)))
|
|
||||||
(module-use! mod* mod)
|
|
||||||
(for-each
|
|
||||||
(lambda (binding)
|
|
||||||
(let* ((x (frame-local-ref frame (binding-slot binding)
|
|
||||||
(binding-representation binding)))
|
|
||||||
(var (if (variable? x) x (make-variable x))))
|
|
||||||
(format #t
|
|
||||||
"~:[Read-only~;Mutable~] local variable ~a = ~70:@y\n"
|
|
||||||
(not (variable? x))
|
|
||||||
(binding-name binding)
|
|
||||||
(if (variable-bound? var) (variable-ref var) var))
|
|
||||||
(module-add! mod* (binding-name binding) var)))
|
|
||||||
(frame-bindings frame))
|
|
||||||
mod*)
|
|
||||||
(current-module))))
|
|
||||||
|
|
||||||
|
|
||||||
(define (stack->vector stack)
|
(define (stack->vector stack)
|
||||||
(let* ((len (stack-length stack))
|
(let* ((len (stack-length stack))
|
||||||
(v (make-vector len)))
|
(v (make-vector len)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue