Changeset 11154


Ignore:
Timestamp:
02/23/07 10:07:06 (15 years ago)
Author:
piso
Message:

INVOKE-DEBUGGER: bind *SAVED-BACKTRACE*.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/debug.lisp

    r10356 r11154  
    11;;; debug.lisp
    22;;;
    3 ;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: debug.lisp,v 1.33 2005-11-04 20:06:33 piso Exp $
     3;;; Copyright (C) 2003-2007 Peter Graves
     4;;; $Id: debug.lisp,v 1.34 2007-02-23 10:07:06 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    1616;;; You should have received a copy of the GNU General Public License
    1717;;; along with this program; if not, write to the Free Software
    18 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     18;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1919
    2020;;; Adapted from SBCL.
     
    8989
    9090(defun invoke-debugger (condition)
    91   (when *debugger-hook*
    92     (let ((hook-function *debugger-hook*)
    93           (*debugger-hook* nil))
    94       (funcall hook-function condition hook-function)))
    95   (invoke-debugger-report-condition condition)
    96   (unless (fboundp 'tpl::repl)
    97     (quit))
    98   (let ((original-package *package*))
    99     (with-standard-io-syntax
    100       (let ((*package* original-package)
    101             (*print-readably* nil) ;; Top-level default.
    102             (*print-structure* nil)
    103             (*debug-condition* condition)
    104             (level *debug-level*))
    105         (clear-input)
    106         (if (> level 0)
    107             (with-simple-restart (abort "Return to debug level ~D." level)
    108               (debug-loop))
    109             (debug-loop))))))
     91  (let ((*saved-backtrace* (backtrace-as-list)))
     92    (when *debugger-hook*
     93      (let ((hook-function *debugger-hook*)
     94            (*debugger-hook* nil))
     95        (funcall hook-function condition hook-function)))
     96    (invoke-debugger-report-condition condition)
     97    (unless (fboundp 'tpl::repl)
     98      (quit))
     99    (let ((original-package *package*))
     100      (with-standard-io-syntax
     101        (let ((*package* original-package)
     102              (*print-readably* nil) ; Top-level default.
     103              (*print-structure* nil)
     104              (*debug-condition* condition)
     105              (level *debug-level*))
     106          (clear-input)
     107          (if (> level 0)
     108              (with-simple-restart (abort "Return to debug level ~D." level)
     109                (debug-loop))
     110              (debug-loop)))))))
    110111
    111112(defun break (&optional (format-control "BREAK called") &rest format-arguments)
    112   (let ((*debugger-hook* nil) ; Specifically required by ANSI.
    113         (*saved-backtrace* (backtrace-as-list)))
     113  (let ((*debugger-hook* nil)) ; Specifically required by ANSI.
    114114    (with-simple-restart (continue "Return from BREAK.")
    115115      (invoke-debugger
Note: See TracChangeset for help on using the changeset viewer.