Function: debugger-setup-buffer
debugger-setup-buffer is a byte-compiled function defined in
debug.el.gz.
Signature
(debugger-setup-buffer ARGS)
Documentation
Initialize the *Backtrace* buffer for entry to the debugger.
That buffer should be current already and in debugger-mode.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/debug.el.gz
(defun debugger-setup-buffer (args)
"Initialize the `*Backtrace*' buffer for entry to the debugger.
That buffer should be current already and in `debugger-mode'."
(setq backtrace-frames (nthcdr
;; Remove debug--implement-debug-on-entry and the
;; advice's `apply' frame.
(if (eq (car args) 'debug) 3 1)
(backtrace-get-frames 'debug)))
(when (eq (car-safe args) 'exit)
(setq debugger-value (nth 1 args))
(setf (cl-getf (backtrace-frame-flags (car backtrace-frames))
:debug-on-exit)
nil))
(setq backtrace-view (plist-put backtrace-view :show-flags t)
backtrace-insert-header-function (lambda ()
(debugger--insert-header args))
backtrace-print-function debugger-print-function)
(backtrace-print)
;; Place point on "stack frame 0" (bug#15101).
(goto-char (point-min))
(search-forward ":" (line-end-position) t)
(when (and (< (point) (line-end-position))
(= (char-after) ?\s))
(forward-char)))