Changeset 7406 for branches/working-0710


Ignore:
Timestamp:
Oct 12, 2007, 9:42:41 AM (12 years ago)
Author:
gb
Message:

:arg, :local, :set-arg, :set-local break-loop commands.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0710/ccl/level-1/l1-readloop-lds.lisp

    r7225 r7406  
    152152    (if frame-sp
    153153      (toplevel-print (list (nth-value-in-frame frame-sp n nil))))))
     154
     155(define-toplevel-command :break arg (name frame-number) "Return value of argument named <name> in frame <frame-number>"
     156  (let* ((frame-sp (nth-raw-frame frame-number *break-frame* nil)))
     157    (when frame-sp
     158      (multiple-value-bind (lfun pc) (cfp-lfun frame-sp)
     159        (when (and lfun pc)
     160          (let* ((unavailable (cons nil nil)))
     161            (declare (dynamic-extent unavailable))
     162            (let* ((value (arg-value nil frame-sp lfun pc unavailable name)))
     163              (if (eq value unavailable)
     164                (format *debug-io* "~&;; Can't determine value of ~s in frame ~s." name frame-number)
     165                (toplevel-print (list value))))))))))
     166
     167(define-toplevel-command :break set-arg (name frame-number new) "Set value of argument named <name> in frame <frame-number> to value <new>."
     168  (let* ((frame-sp (nth-raw-frame frame-number *break-frame* nil)))
     169    (when frame-sp
     170      (multiple-value-bind (lfun pc) (cfp-lfun frame-sp)
     171        (when (and lfun pc)
     172          (or (set-arg-value nil frame-sp lfun pc name new)
     173              (format *debug-io* "~&;; Can't change value of ~s in frame ~s." name frame-number)))))))
     174   
     175
     176(define-toplevel-command :break local (name frame-number) "Return value of local denoted by <name> in frame <frame-number> <name> can either be a symbol - in which case the most recent
     177binding of that symbol is used - or an integer index into the frame's set of local bindings."
     178  (let* ((frame-sp (nth-raw-frame frame-number *break-frame* nil)))
     179    (when frame-sp
     180      (multiple-value-bind (lfun pc) (cfp-lfun frame-sp)
     181        (when (and lfun pc)
     182          (let* ((unavailable (cons nil nil)))
     183            (declare (dynamic-extent unavailable))
     184            (let* ((value (local-value nil frame-sp lfun pc unavailable name)))
     185              (if (eq value unavailable)
     186                (format *debug-io* "~&;; Can't determine value of ~s in frame ~s." name frame-number)
     187                (toplevel-print (list value))))))))))
     188
     189(define-toplevel-command :break set-local (name frame-number new) "Set value of argument denoted <name> (see :LOCAL) in frame <frame-number> to value <new>."
     190  (let* ((frame-sp (nth-raw-frame frame-number *break-frame* nil)))
     191    (when frame-sp
     192      (multiple-value-bind (lfun pc) (cfp-lfun frame-sp)
     193        (when (and lfun pc)
     194          (or (set-local-value nil frame-sp lfun pc name new)
     195              (format *debug-io* "~&;; Can't change value of ~s in frame ~s." name frame-number)))))))
     196
    154197
    155198(define-toplevel-command :break form (frame-number)
     
    272315                          (cons keyword params)
    273316                          keyword)))
    274                     (params param)))))))))))
     317                    (params (eval param))))))))))))
    275318
    276319;;; Read a form from the specified stream.
Note: See TracChangeset for help on using the changeset viewer.