mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-09 07:00:23 +02:00
Program sources are always pre-retire now
* module/system/repl/debug.scm (<debug>): Remove for-trap?. Backtraces with RTL will always happen pre-retire on the top frame, source info is pre-retire, and continuations will always have a source-marked receive or receive-values or whatever with the right source marking, so we can remove this complication. (print-frame): Use frame-source. (print-frames): Remove for-trap? kw. * module/system/repl/command.scm (define-stack-command, backtrace) (up, down, frame): Remove for-trap? introduced local, and its uses. (repl-pop-continuation-resumer): Adapt to make-debug change. * module/system/repl/error-handling.scm (call-with-error-handling): Adapt to make-debug change. * module/system/vm/frame.scm (frame-next-source): Remove. RTL sources are pre-retire. * module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Adapt to use frame-source. Still some work to do here.
This commit is contained in:
parent
0128bb9c38
commit
e15aa02284
5 changed files with 23 additions and 43 deletions
|
@ -1,6 +1,6 @@
|
|||
;;; Guile VM debugging facilities
|
||||
|
||||
;;; Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||
;;; Copyright (C) 2001, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
|
||||
;;;
|
||||
;;; This library is free software; you can redistribute it and/or
|
||||
;;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -31,7 +31,7 @@
|
|||
#:use-module (system vm program)
|
||||
#:export (<debug>
|
||||
make-debug debug?
|
||||
debug-frames debug-index debug-error-message debug-for-trap?
|
||||
debug-frames debug-index debug-error-message
|
||||
terminal-width
|
||||
print-registers print-locals print-frame print-frames frame->module
|
||||
stack->vector narrow-stack->vector
|
||||
|
@ -55,7 +55,7 @@
|
|||
;;; accessors, and provides some helper functions.
|
||||
;;;
|
||||
|
||||
(define-record <debug> frames index error-message for-trap?)
|
||||
(define-record <debug> frames index error-message)
|
||||
|
||||
|
||||
|
||||
|
@ -125,7 +125,7 @@
|
|||
(if source
|
||||
(or (source:file source) "current input")
|
||||
"unknown file"))
|
||||
(let* ((source ((if next-source? frame-next-source frame-source) frame))
|
||||
(let* ((source (frame-source frame))
|
||||
(file (source:pretty-file source))
|
||||
(line (and=> source source:line-for-user))
|
||||
(col (and=> source source:column)))
|
||||
|
@ -141,7 +141,7 @@
|
|||
(define* (print-frames frames
|
||||
#:optional (port (current-output-port))
|
||||
#:key (width (terminal-width)) (full? #f)
|
||||
(forward? #f) count for-trap?)
|
||||
(forward? #f) count)
|
||||
(let* ((len (vector-length frames))
|
||||
(lower-idx (if (or (not count) (positive? count))
|
||||
0
|
||||
|
@ -155,12 +155,9 @@
|
|||
(if (<= lower-idx i upper-idx)
|
||||
(let* ((frame (vector-ref frames i)))
|
||||
(print-frame frame port #:index i #:width width #:full? full?
|
||||
#:last-source last-source
|
||||
#:next-source? (and (zero? i) for-trap?))
|
||||
#:last-source last-source)
|
||||
(lp (+ i inc)
|
||||
(if (and (zero? i) for-trap?)
|
||||
(frame-next-source frame)
|
||||
(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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue