Function: dape

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

Signature

(dape CONFIG &optional SKIP-COMPILE)

Documentation

Start debugging session with selected configuration.

When called interactively, the command prompts for a alist KEY from dape-configs, followed by additional property-value pairs. These pairs override the properties in the plist associated with the key in dape-configs.

For example, interactively invoking:
  launch :program "bin"
executes the launch configuration from dape-configs, overriding the :program option with "bin".

CONFIG is an keyword-value plist, see VALUEs in dape-config alist. SKIP-COMPILE argument is used internally for recursive calls and should not be specified manually.

For more information see dape-configs.

Key Bindings

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

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
;;;###autoload
(defun dape (config &optional skip-compile)
  "Start debugging session with selected configuration.
When called interactively, the command prompts for a alist KEY from
`dape-configs', followed by additional property-value pairs.  These
pairs override the properties in the plist associated with the key
in `dape-configs'.

For example, interactively invoking:
  launch :program \"bin\"
executes the `launch' configuration from `dape-configs', overriding
the `:program' option with \"bin\".

CONFIG is an keyword-value plist, see VALUEs in `dape-config' alist.
SKIP-COMPILE argument is used internally for recursive calls
and should not be specified manually.

For more information see `dape-configs'."
  (interactive
   (let* ((config (dape--read-config)))
     (when-let* ((live (dape--live-connections-root)))
       (let (;; XXX Save and restore `last-command-event' to ignore
             ;; yes/no inputs to keep transient `repeat-mode' map.
             (saved-event last-command-event))
         (when (yes-or-no-p
                (format "Session(s) %s running; kill? "
                        (mapconcat
                         (lambda (c)
                           (string-remove-prefix "dape-" (jsonrpc-name c)))
                         live ", ")))
           (dape--kill-busy-wait))
         (setq last-command-event saved-event)))
     (list config)))
  (dape--config-ensure config t)
  (when-let* ((fn (or (plist-get config 'fn) 'identity))
              (fns (or (and (functionp fn) (list fn))
                       (and (listp fn) fn))))
    (setq config
          (seq-reduce (lambda (config fn) (funcall fn config))
                      (append fns dape-default-config-functions)
                      (copy-tree config))))
  (if (and (not skip-compile) (plist-get config 'compile))
      (dape--compile config (lambda () (dape config 'skip-compile)))
    ;; Run start hooks before connection creation so that the REPL
    ;; buffer exists when `dape--create-connection' emits messages.
    (run-hooks 'dape-start-hook)
    (let ((conn (dape--create-connection config)))
      (push conn dape--connections)
      (setq dape--connection-selected conn)
      (dape--start-debugging conn))))