comparison lisp/loadup.el @ 4841:3465c3161fea

when `debug', abort when lisp error during loadup loadup.el: When featurep `debug-xemacs' (configure --with-debug), set debug-on-error, so that we get an exit-to-debugger/assertion failure upon Lisp error during loadup. Unset before dumping. cmdloop.c: During really-early-error-handler, exit to the debugger and abort if an error occurs and lisp.h: extern Vdebug_on_error.
author Ben Wing <ben@xemacs.org>
date Wed, 13 Jan 2010 01:55:56 -0600
parents 061e030e3270
children aa8197436fdb
comparison
equal deleted inserted replaced
4840:17b3dc5500b0 4841:3465c3161fea
1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs. 1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs.
2 2
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1996 Richard Mlynarik. 4 ;; Copyright (C) 1996 Richard Mlynarik.
5 ;; Copyright (C) 1995, 1996, 2003 Ben Wing. 5 ;; Copyright (C) 1995, 1996, 2003, 2005 Ben Wing.
6 6
7 ;; Maintainer: XEmacs Development Team 7 ;; Maintainer: XEmacs Development Team
8 ;; Keywords: internal, dumped 8 ;; Keywords: internal, dumped
9 9
10 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
42 ;;; Code: 42 ;;; Code:
43 43
44 ;; Help debug problems. 44 ;; Help debug problems.
45 (setq stack-trace-on-error t 45 (setq stack-trace-on-error t
46 load-always-display-messages t) 46 load-always-display-messages t)
47 (when (featurep 'debug-xemacs)
48 ;; Immediately dump core upon an unhandled error, rather than just quitting
49 ;; the program. This can also be achieved by setting an environment variable
50 ;; XEMACSDEBUG to contain '(setq debug-on-error t)', e.g.
51 ;; export XEMACSDEBUG='(setq debug-on-error t)'
52 (setq debug-on-error t))
47 53
48 ;(princ (format "command-line-args: %s\n" command-line-args)) 54 ;(princ (format "command-line-args: %s\n" command-line-args))
49 ;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory)) 55 ;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory))
50 ;(princ (format "configure-data-directory: %S\n" configure-data-directory)) 56 ;(princ (format "configure-data-directory: %S\n" configure-data-directory))
51 ;(princ (format "lisp-directory: %S\n" lisp-directory)) 57 ;(princ (format "lisp-directory: %S\n" lisp-directory))
237 ;; (condition-case () (delete-file "xemacs") (file-error nil)) 243 ;; (condition-case () (delete-file "xemacs") (file-error nil))
238 (when (fboundp 'really-free) 244 (when (fboundp 'really-free)
239 (really-free)) 245 (really-free))
240 ;; Make sure we don't dump with debugging messages turned on. 246 ;; Make sure we don't dump with debugging messages turned on.
241 (setq stack-trace-on-error nil 247 (setq stack-trace-on-error nil
242 load-always-display-messages nil) 248 load-always-display-messages nil
249 debug-on-error nil)
243 (dump-emacs 250 (dump-emacs
244 (cond 251 (cond
245 ((featurep 'infodock) "infodock") 252 ((featurep 'infodock) "infodock")
246 ;; #### BILL!!! 253 ;; #### BILL!!!
247 ;; If we want to dump under a name other than `xemacs', do that here! 254 ;; If we want to dump under a name other than `xemacs', do that here!