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
        ;; The `base' frame is the one that gets index 0 and it is the entry to
        ;; the debugger, so drop it with `cdr'.
        (cdr (backtrace-get-frames (debugger--backtrace-base))))
  (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)))