Function: dape-select-stack

dape-select-stack is an interactive and natively compiled function defined in dape.el.

Signature

(dape-select-stack CONN STACK-ID)

Documentation

Select current active stack.

With prefix argument stack is selected by index starting at 1. The stack is identified by STACK-ID under adapter CONN.

Key Bindings

ctl-x-map C-a S dape-global-map S global-map C-x C-a S help-quick-use-map C-x C-a S

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(defun dape-select-stack (conn stack-id)
  "Select current active stack.
With prefix argument stack is selected by index starting at 1.
The stack is identified by STACK-ID under adapter CONN."
  (interactive
   (let* ((conn (dape--live-connection 'stopped))
          (current-thread (dape--current-thread conn))
          (collection
           ;; Only one stack frame is guaranteed to be available,
           ;; so we need to reach out to make sure we got the full set.
           ;; See `dape--stack-trace'.
           (let ((dape--request-blocking t))
             (dape--with-request
                 (dape--stack-trace conn current-thread dape-stack-trace-levels))
             (mapcar (lambda (stack) (cons (plist-get stack :name)
                                           (plist-get stack :id)))
                     (plist-get current-thread :stackFrames))))
          (stack-name
           (if (numberp current-prefix-arg)
               (car (nth (1- current-prefix-arg) collection))
             (completing-read (format "Select stack (current %s): "
                                      (plist-get (dape--current-stack-frame conn) :name))
                              collection nil t))))
     (list conn (alist-get stack-name collection nil nil #'equal))))
  (setf (dape--stack-id conn) stack-id)
  (dape--update conn nil t))