Introduce with-inspector-handler to turn an exception into a value for the inspector

part of darcs patch Thu Sep 22 14:13:30 EEST 2005  Martin Gasbichler <gasbichl@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 16:33:27 +00:00
parent 7488bcdf18
commit 85a258237c
4 changed files with 16 additions and 16 deletions

View File

@ -17,17 +17,13 @@
(read string-port))) (read string-port)))
(define (eval-string str) (define (eval-string str)
(with-fatal-and-capturing-error-handler (with-inspector-handler
(lambda (condition raw-continuation continuation decline)
raw-continuation)
(lambda () (lambda ()
(eval (read-sexp-from-string str) (eval (read-sexp-from-string str)
(evaluation-environment))))) (evaluation-environment)))))
(define (eval-s-expr s-expr) (define (eval-s-expr s-expr)
(with-fatal-and-capturing-error-handler (with-inspector-handler
(lambda (condition raw-continuation continuation decline)
raw-continuation)
(lambda () (lambda ()
(eval s-expr (evaluation-environment))))) (eval s-expr (evaluation-environment)))))

View File

@ -207,9 +207,6 @@
(else (else
(debug-message "inspector did not handle message " message)))))) (debug-message "inspector did not handle message " message))))))
(register-plugin!
(make-view-plugin make-inspector
exception-continuation?))
(define-record-type inspection-object :inspection-object (define-record-type inspection-object :inspection-object
(make-inspection-object val) (make-inspection-object val)
@ -220,3 +217,9 @@
(make-view-plugin (lambda (iv buffer) (make-view-plugin (lambda (iv buffer)
(make-inspector (inspection-object-val iv) buffer)) (make-inspector (inspection-object-val iv) buffer))
inspection-object?)) inspection-object?))
(define (with-inspector-handler thunk)
(with-fatal-and-capturing-error-handler
(lambda (condition raw-continuation continuation decline)
(make-inspection-object (cons condition raw-continuation)))
thunk))

View File

@ -288,9 +288,7 @@
(define (eval-command-in-scheme-mode command-line) (define (eval-command-in-scheme-mode command-line)
(with-fatal-and-capturing-error-handler (with-inspector-handler
(lambda (condition raw-continuation continuation decline)
raw-continuation)
(lambda () (lambda ()
(if (scheme-command-line? command-line) (if (scheme-command-line? command-line)
(process-scheme-command command-line) (process-scheme-command command-line)

View File

@ -433,7 +433,8 @@
;;; inspector ;;; inspector
(define-interface inspection-objects-interface (define-interface inspection-objects-interface
(export make-inspection-object (export with-inspector-handler
make-inspection-object
inspection-object?)) inspection-object?))
(define-structures (define-structures
@ -451,6 +452,7 @@
(subset srfi-13 (string-join)) (subset srfi-13 (string-join))
debug-data debug-data
(subset disclosers (template-debug-data)) (subset disclosers (template-debug-data))
inspect-exception
focus-table focus-table
ncurses ncurses
@ -499,7 +501,7 @@
(open scheme (open scheme
srfi-6 srfi-6
inspect-exception inspection-objects
rt-modules) rt-modules)
(files eval-environment)) (files eval-environment))
@ -912,7 +914,7 @@
srfi-8 srfi-8
srfi-13 srfi-13
debugging debugging
inspect-exception inspection-objects
tty-debug tty-debug
threads threads
rendezvous rendezvous
@ -928,6 +930,7 @@
initial-tty initial-tty
nuit-windows nuit-windows
modal-window modal-window
inspect-exception
configuration configuration
command-line-parser command-line-parser