Fix a test on #-sb-unicode.
[sbcl.git] / src / interpreter / debug.lisp
blob9af371f2e88f90b19d7038032121eab9e8f01bbd
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package "SB-INTERPRETER")
12 (defun list-locals (env)
13 (do ((env env (env-parent env)))
14 ((null env))
15 (when (or (var-env-p env) (lambda-env-p env))
16 (with-environment-vars (symbols end) env
17 (let ((values (the simple-vector (env-payload env))))
18 (dotimes (i (min end (length values)))
19 (unless (logbitp i (frame-special-b (env-contour env)))
20 (format t "~S = ~S~%"
21 (car (svref symbols i))
22 (svref values i)))))))))
24 (defun flush-macros () (atomic-incf *globaldb-cookie*))
26 ;; This is for SAVE-LISP-AND-DIE. It removes all accumulated stuff
27 ;; that can be recreated in the normal course of evaluation.
28 (defun flush-everything ()
29 (sb-vm::map-allocated-objects
30 (lambda (obj type size)
31 (declare (ignore type size))
32 (when (typep obj 'interpreted-function)
33 (let ((proto-fn (interpreted-function-proto-fn obj)))
34 (setf (proto-fn-%frame proto-fn) nil
35 (proto-fn-cookie proto-fn) nil
36 (proto-fn-type proto-fn) nil
37 (interpreted-function-frame obj) nil
38 (interpreted-function-cookie obj) nil))))
39 :dynamic))