[slime-devel] Inspecting return value at breakpoints (patch included)
Utz-Uwe Haus
haus+slime at mail.math.uni-magdeburg.de
Tue Jan 18 12:37:52 UTC 2005
Hi,
I found that when I stop on a breakpoint set with sldb-break-on-return,
I am often interested in inspecting the return value. That is printed in
the sldb buffer, but not inspectable.
Currently I am using the following modifications to signal-breakpoint in
the CMUCL case, which make en entry in the breakpoint condition. Then,
inspecting the condition yields the information I'm interested in. This
is not very beautiful, and it only works with CMUCL, but in case someone
can make use of it...
later,
Utz
-----
Index: swank-cmucl.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-cmucl.lisp,v
retrieving revision 1.136
diff -u -r1.136 swank-cmucl.lisp
--- swank-cmucl.lisp 13 Jan 2005 23:17:02 -0000 1.136
+++ swank-cmucl.lisp 18 Jan 2005 12:29:19 -0000
@@ -1727,7 +1727,8 @@
(c::compiled-debug-function-returns cdfun)))
(define-condition breakpoint (simple-condition)
- ((message :initarg :message :reader breakpoint.message))
+ ((message :initarg :message :reader breakpoint.message)
+ (values :initarg :values :reader breakpoint.values))
(:report (lambda (c stream) (princ (breakpoint.message c) stream))))
(defimplementation condition-extras ((c breakpoint))
@@ -1740,13 +1741,18 @@
(flet ((brk (fstring &rest args)
(let ((msg (apply #'format nil fstring args))
(debug:*stack-top-hint* frame))
- (break 'breakpoint :message msg))))
+ (break 'breakpoint :message msg)))
+ (brk-with-values (values fstring &rest args)
+ (let ((msg (apply #'format nil fstring args))
+ (debug:*stack-top-hint* frame))
+ (break 'breakpoint :values values :message msg))) )
(with-struct (di::breakpoint- kind what) breakpoint
(case kind
(:code-location
(case (di:code-location-kind what)
((:single-value-return :known-return :unknown-return)
- (brk "Return value: ~{~S ~}" (breakpoint-values breakpoint)))
+ (brk-with-values (breakpoint-values breakpoint)
+ "Return value: ~{~S ~}" (breakpoint-values breakpoint)))
(t
(brk "Breakpoint: ~S ~S"
(di:code-location-kind what)
-----
--
Utz-Uwe Haus haus at mail.math.uni-magdeburg.de
Inst. f. Mathemat. Optim. utz at uuhaus.de
Uni Magdeburg PGP keys 1024/6AD23BE1 and 2048/5D0B72A1
GERMANY available via keyservers or email request
More information about the slime-devel
mailing list