anchor.diff:              (setf last-layout layout))
          finally (return last-layout))))
   
  -(defun debugger-show-variables (frame)
  +(defun frame-locals (frame &key show-hidden)
     (multiple-value-bind (fn offset)
         (function-from-frame frame)
       (let* ((info (function-debug-info fn))
  -           (var-id 0))
  -      (format t "Locals:~%")
  +           (var-id 0)
  +           (result '()))
         (loop
            for (name location repr . plist) in (local-variables-at-offset fn offset)
            do (destructuring-bind (&key hidden)
                   plist
  -              (when (not hidden)
  -                (format t "  ~D ~S: ~S~%" (incf var-id) name (read-frame-slot frame location repr)))))
  -      (multiple-value-bind (env-slot env-layout)
  -          (sys.int::debug-info-closure-layout info)
  -        (when env-slot
  -          (format t "Closed-over variables:~%")
  -          (let ((env-object (read-frame-slot frame env-slot)))
  -            (dolist (level env-layout)
  -              (loop
  -                 for i from 1
  -                 for name in level
  -                 when name
  -                 do (format t "  ~D ~S: ~S~%" (incf var-id) name (svref env-object i)))
  -              (setf env-object (svref env-object 0))))))
  -      (multiple-value-bind (env-var env-layout)
  -          (sys.int::debug-info-precise-closure-layout info)
  -        (when env-var
  -          (let ((env-slot (second (find env-var (local-variables-at-offset fn offset)
  -                                        :key #'first))))
  -            (when env-slot
  -              (format t "Closed-over variables:~%")
  -              (let ((env-object (read-frame-slot frame env-slot)))
  -                (dolist (level env-layout)
  -                  (loop
  -                     for i from 1
  -                     for name in level
  -                     when name
  -                     do (format t "  ~D ~S: ~S~%" (incf var-id) name (svref env-object i)))
  -                  (setf env-object (svref env-object 0)))))))))))
  -
  -(defun debugger-read-variable (frame id)
  -  (multiple-value-bind (fn offset)
  -      (function-from-frame frame)
  -    (let* ((info (function-debug-info fn))
  -           (var-id 0))
  -      (loop
  -         for (name location repr . plist) in (local-variables-at-offset fn offset)
  -         do (destructuring-bind (&key hidden)
  -                plist
  -              (when (not hidden)
  -                (when (eql (incf var-id) id)
  -                  (return-from debugger-read-variable
  -                    (values (read-frame-slot frame location repr) name))))))
  +              (when (or show-hidden (not hidden))
  +                (push (list name (incf var-id) location repr) result))))
         (multiple-value-bind (env-slot env-layout)
             (sys.int::debug-info-closure-layout info)
           (when env-slot
  
positive.code:               (loop
                   for i from 1
                   for name in level
                   when (and name
                             (eql (incf var-id) id))
                   do
                     (return-from debugger-read-variable
                       (values (svref env-object i) name)))
                (setf env-object (svref env-object 0))))))
        (multiple-value-bind (env-var env-layout)
            (sys.int::debug-info-precise-closure-layout info)
  
negative.code:     (return-address-to-function return-address)))
  
  (defun read-frame-slot (frame slot &optional (repr :value))
    (typecase slot
      (integer
       ;; Stack frame index.
       (let ((address (+ (memref-unsigned-byte-64 (second frame) 0)
                         (* (- (1+ slot)) 8))))
         (case repr
           (:value
            (memref-t address))
           (:single-float
            (%integer-as-single-float (memref-unsigned-byte-32 address)))
           (:double-float
            (%integer-as-double-float (memref-unsigned-byte-64 address)))
           (t
            :$inaccessible-value$))))
      (cons
       ;; Environment vector/index pair.
       (if (eql repr :value)
           (elt (car slot) (cdr slot))
           :$inaccessible-value$))
      (t
       ;; A register?
       :$inaccessible-value$)))
  
  (defun write-frame-slot (frame slot value &optional (repr :value))
    (typecase slot
      (integer
       ;; Stack frame index.
       (let ((address (+ (memref-unsigned-byte-64 (second frame) 0)
                         (* (- (1+ slot)) 8))))
         (case repr
           (:value
            (setf (memref-t address) value))
           (:single-float
            (setf (memref-unsigned-byte-32 address) (%single-float-as-integer value)))
           (:double-float
            (setf (memref-unsigned-byte-64 address) (%double-float-as-integer value)))
           (t
            (error "Cannot write to this variable. Unknown representation ~S." repr)))))
      (cons
       ;; Environment vector/index pair.
       (if (eql repr :value)
           (elt (car slot) (cdr slot))
           (error "Cannot write to this variable. Unsupported representation ~S for environment access" repr)))
      (t
       ;; A register?
       (error "Cannot write to this variable. Unsupported location ~S" slot))))
  
  (defun show-debug-frame ()
    (multiple-value-bind (function offset)
  