1
0
mirror of synced 2026-01-17 17:13:19 +00:00

57 lines
1.9 KiB
XML

;; Definition To Be Tested: debug
;;
;; Source: Xerox LIsp Manual
;; Chapter 24: ERROR SYSTEM Handling Conditions
;;
;; Created By: Kirk Kelley
;;
;; Creation Date: 21 November 86
;;
;; Last Update: >> day month << 86
;;
;; Filed As: {eris}<lispcore>cml>test>24-debug.ux
;;
;;
;; Syntax: debug &optional datum &rest arguments [macro]
;;
;; Function Description: Enters the debugger with a given condition. When the debugger is entered, it will announce the condition by invoking the condition's report function.
;;
;; If datum is a condition, then that condition is used directly. In this case, it is an error for arguments to be non-NIL.
;;
;; If datum is a condition type, then the condition used is the result of doing (apply #'make-condition datum arguments).
;;
;; If datum is a string, then the condition is used is the result of doing (make-condition 'simple-condition :format-string datum :format-arguments arguments).
;;
;; If datum is not specified, it defaults to "Break".
;;
;; Argument(s): datum -- condition | condition type | string | NIL
;; arguments -- for condition
;;
;; Returns: This function will never directly return to its caller. Return can occur only by a special transfer of control, such as to a proceed-case or catch-abort.
;;
(do-test "advise debugger"
(when nil
;; should check to see if already advised first. Also cant
;; use until advise is fixed to work with nlambda
;; no-spread fns.
(il:advise 'debugger 'before 'first
'(if
(and
(typep brkcond
'simple-condition)
(equal
(simple-condition-format-string brkcond)
"Debug test. Please select PROCEED"))
(invoke-proceed-case
(if
(find-proceed-case
'use-food
brkcond)
'use-food
'proceed)
brkcond)))
(il:advise 'enter-debugger-p 'around t)) t)
(do-test "debug simple"
(proceed-case (debug "Simple debug test. Please select PROCEED")
(proceed (condition) :test true :report "Select this."
condition)))