X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdebug.lisp;h=165a874c86a6f416e7e932d79ebdba8e692218c5;hb=db97ea04895820f70c90bdeb0399aa0229410b5d;hp=ecbf3e8e809c01c1bc54f9e4a2fa418962c92d17;hpb=76f3e23c8ad6f98d60ff97233e11082a41faf894;p=sbcl.git diff --git a/src/code/debug.lisp b/src/code/debug.lisp index ecbf3e8..165a874 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -806,9 +806,21 @@ reset to ~S." (t (funcall cmd-fun)))))))))))) +(defvar *auto-eval-in-frame* t + #!+sb-doc + "When set (the default), evaluations in the debugger's command loop occur + relative to the current frame's environment without the need of debugger + forms that explicitly control this kind of evaluation.") + +(defun debug-eval (expr) + (if (and (fboundp 'compile) *auto-eval-in-frame*) + (sb!di:eval-in-frame *current-frame* expr) + (eval expr))) + (defun debug-eval-print (expr) (/noshow "entering DEBUG-EVAL-PRINT" expr) - (let ((values (multiple-value-list (interactive-eval expr)))) + (let ((values (multiple-value-list + (interactive-eval expr :eval #'debug-eval)))) (/noshow "done with EVAL in DEBUG-EVAL-PRINT") (dolist (value values) (fresh-line *debug-io*)