Changeset 6618


Ignore:
Timestamp:
May 28, 2007, 12:43:55 AM (18 years ago)
Author:
Gary Byers
Message:

VARIABLES-IN-SCOPE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/lib/backtrace.lisp

    r6031 r6618  
    309309
    310310
    311 
     311(defun variables-in-scope (lfun pc)
     312  (declare (fixnum pc))
     313  ;; Return a list of all symbol names "in scope" in the function lfun
     314  ;; at relative program counter PC, using the function's symbol map.
     315  ;; The list will be ordered so that least-recent bindings appear first.
     316  (let* ((map (function-symbol-map lfun))
     317         (names (car map))
     318         (info (cdr map)))
     319    (when map
     320      (let* ((vars ()))
     321        (dotimes (i (length names) vars)
     322          (let* ((start-pc (aref info (1+ (* 3 i))))
     323                 (end-pc (aref info (+ 2 (* 3 i)))))
     324            (declare (fixnum start-pc end-pc))
     325            (when (and (>= pc start-pc)
     326                       (< pc end-pc))
     327              (push (svref names i) vars))))))))
    312328
    313329(defun safe-cell-value (val)
Note: See TracChangeset for help on using the changeset viewer.