Function: dape-kill

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

Signature

(dape-kill CONN &optional CB WITH-DISCONNECT)

Documentation

Kill debug session.

CB will be called after adapter termination. With WITH-DISCONNECT use disconnect instead of terminate used internally as a fallback to terminate. CONN is inferred for interactive invocations.

Key Bindings

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

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(defun dape-kill (conn &optional cb with-disconnect)
  "Kill debug session.
CB will be called after adapter termination.  With WITH-DISCONNECT use
disconnect instead of terminate used internally as a fallback to
terminate.  CONN is inferred for interactive invocations."
  (interactive (list (dape--live-connection 'parent)))
  (cond
   ((and conn (jsonrpc-running-p conn)
         (not with-disconnect)
         (dape--capable-p conn :supportsTerminateRequest))
    (dape--with-request-bind (_body error)
        (dape-request conn :terminate nil)
      ;; We have to give up trying to kill the debuggee in an correct
      ;; way if the request timeout, otherwise we might force the
      ;; user to kill the process in some other way.
      (if (and error (not (eq error dape--timeout-error)))
          (dape-kill conn cb 'with-disconnect)
        (dape--shutdown conn)
        (dape--request-continue cb))))
   ((and conn (jsonrpc-running-p conn))
    (dape--with-request
        (dape-request conn :disconnect
                      `( :restart :json-false
                         ,@(when (dape--capable-p conn :supportTerminateDebuggee)
                             '(:terminateDebuggee t))))
      (dape--shutdown conn)
      (dape--request-continue cb)))
   (t
    (dape--request-continue cb))))