From: Nikodemus Siivola Date: Sat, 19 Nov 2011 16:41:39 +0000 (+0200) Subject: make RESTART-FRAME debugger command at least try to restart anon frames X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=76a4d3c300f4fbf5f3fa770b0c5fddf377cf7748;p=sbcl.git make RESTART-FRAME debugger command at least try to restart anon frames Try to grab the debug-fun-fun and call it. This /is/ an iffy proposition, though, so don't advertise it, and caution the user before going ahead. --- diff --git a/src/code/debug.lisp b/src/code/debug.lisp index 5a5b0f3..014103c 100644 --- a/src/code/debug.lisp +++ b/src/code/debug.lisp @@ -1601,15 +1601,33 @@ and LDB (the low-level debugger). See also ENABLE-DEBUGGER." (!def-debug-command "RESTART-FRAME" () (if (frame-has-debug-tag-p *current-frame*) - (let* ((call-list (frame-call-as-list *current-frame*)) - (fun (fdefinition (car call-list)))) - (unwind-to-frame-and-call *current-frame* - (lambda () - (apply fun (cdr call-list))))) + (multiple-value-bind (fname args) (frame-call *current-frame*) + (multiple-value-bind (fun arglist ok) + (if (and (legal-fun-name-p fname) (fboundp fname)) + (values (fdefinition fname) args t) + (values (sb!di:debug-fun-fun (sb!di:frame-debug-fun *current-frame*)) + (frame-args-as-list *current-frame*) + nil)) + (when (and fun + (or ok + (y-or-n-p "~@"))) + (unwind-to-frame-and-call *current-frame* + (lambda () + ;; Ensure TCO. + (declare (optimize (debug 0))) + (apply fun arglist)))) + (format *debug-io* + "Can't restart ~S: no function for frame." + *current-frame*))) (format *debug-io* - "~@"))) + "~@" + *current-frame*))) (defun frame-has-debug-tag-p (frame) #!+unwind-to-frame-and-call-vop