Function: dape--info-stack-buffer-insert

dape--info-stack-buffer-insert is a natively compiled function defined in dape.el.

Signature

(dape--info-stack-buffer-insert CONN CURRENT-STACK-FRAME STACK-FRAMES)

Documentation

Helper for inserting stack info into stack buffer.

Create table from CURRENT-STACK-FRAME and STACK-FRAMES and insert into current buffer with CONN config.

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(defun dape--info-stack-buffer-insert (conn current-stack-frame stack-frames)
  "Helper for inserting stack info into stack buffer.
Create table from CURRENT-STACK-FRAME and STACK-FRAMES and insert into
current buffer with CONN config."
  (cl-loop with table = (make-gdb-table) with selected-line
           for line from 1 for frame in stack-frames do
           (when (eq current-stack-frame frame)
             (setq selected-line line))
           (gdb-table-add-row
            table
            `(,(format "%s" line)
              ,(concat
                (plist-get frame :name)
                (when-let* ((dape-info-stack-buffer-locations)
                            (filename
                             (thread-first
                               frame (plist-get :source) (plist-get :path)))
                            (filename (dape--file-name-local conn filename)))
                  (concat " of "
                          (dape--format-file-name-line
                           filename (plist-get frame :line))))
                (when-let* ((dape-info-stack-buffer-addresses)
                            (ref (plist-get frame
                                            :instructionPointerReference)))
                  (concat " at " ref))
                " "))
            `( dape--frame ,frame
               dape--selected ,(eq current-stack-frame frame)
               mouse-face highlight
               help-echo "mouse-2, RET: select frame"))
           finally do
           (insert (gdb-table-string table " "))
           (when selected-line
             (gdb-mark-line selected-line dape--info-stack-position))))