summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-10-12 13:09:48 +0200
committerAndy Wingo <wingo@pobox.com>2010-10-12 13:09:48 +0200
commita36c3a458ef7d11b40b95394c0ab7bb6f54a0d51 (patch)
tree8a9aad80c4a9e1eb4fe18ac69d6e02f2763870be
parent767dbb1af30500cc0ad44d6bd0e0e179a1191ec6 (diff)
downloadguile-a36c3a458ef7d11b40b95394c0ab7bb6f54a0d51.tar.gz
debug has for-trap? field
* module/system/repl/debug.scm (<debug>): New field, `for-trap?'. True if the stack is for a trap, and thus the top frame should use frame-next-source instead of frame-source. * module/system/repl/command.scm (repl-pop-continuation-resumer) (repl-next-resumer): * module/system/repl/error-handling.scm (call-with-error-handling): Update callers.
-rw-r--r--module/system/repl/command.scm4
-rw-r--r--module/system/repl/debug.scm5
-rw-r--r--module/system/repl/error-handling.scm4
3 files changed, 7 insertions, 6 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index ef2c5a633..0ec31e4d8 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -617,7 +617,7 @@ Note that the given source location must be inside a procedure."
(format #t "Return values:~%")
(for-each (lambda (x) (repl-print repl x)) vals))))
((module-ref (resolve-interface '(system repl repl)) 'start-repl)
- #:debug (make-debug stack 0 msg))))))
+ #:debug (make-debug stack 0 msg #t))))))
(define-stack-command (finish repl)
"finish
@@ -641,7 +641,7 @@ Resume execution, breaking when the current frame finishes."
(k (frame->stack-vector frame)))))))
(format #t "~a~%" msg)
((module-ref (resolve-interface '(system repl repl)) 'start-repl)
- #:debug (make-debug stack 0 msg)))))
+ #:debug (make-debug stack 0 msg #t)))))
(define-stack-command (step repl)
"step
diff --git a/module/system/repl/debug.scm b/module/system/repl/debug.scm
index e3beee110..61ecf84bb 100644
--- a/module/system/repl/debug.scm
+++ b/module/system/repl/debug.scm
@@ -30,7 +30,8 @@
#:use-module ((system vm inspect) #:select ((inspect . %inspect)))
#:use-module (system vm program)
#:export (<debug>
- make-debug debug? debug-frames debug-index debug-error-message
+ make-debug debug?
+ debug-frames debug-index debug-error-message debug-for-trap?
print-registers print-locals print-frame print-frames frame->module
stack->vector narrow-stack->vector
frame->stack-vector))
@@ -53,7 +54,7 @@
;;; accessors, and provides some helper functions.
;;;
-(define-record <debug> frames index error-message)
+(define-record <debug> frames index error-message for-trap?)
diff --git a/module/system/repl/error-handling.scm b/module/system/repl/error-handling.scm
index 58317a80d..737eadfff 100644
--- a/module/system/repl/error-handling.scm
+++ b/module/system/repl/error-handling.scm
@@ -76,7 +76,7 @@
(error-msg (if trap-idx
(format #f "Trap ~d: ~a" trap-idx trap-name)
trap-name))
- (debug (make-debug stack 0 error-msg)))
+ (debug (make-debug stack 0 error-msg #t)))
(with-saved-ports
(lambda ()
(if trap-idx
@@ -145,7 +145,7 @@
;; the start-stack thunk has its own frame too.
0 (and tag 1)))
(error-msg (error-string stack key args))
- (debug (make-debug stack 0 error-msg)))
+ (debug (make-debug stack 0 error-msg #f)))
(with-saved-ports
(lambda ()
(format #t "~a~%" error-msg)