Function: dape--set-function-breakpoints

dape--set-function-breakpoints is a natively compiled function defined in dape.el.

Signature

(dape--set-function-breakpoints CONN &optional CB)

Documentation

Set function breakpoints for adapter CONN.

See dape-request for expected CB signature.

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(defun dape--set-function-breakpoints (conn &optional cb)
  "Set function breakpoints for adapter CONN.
See `dape-request' for expected CB signature."
  (let ((function-breakpoints (cl-remove-if-not #'dape--function-breakpoint-p
                                                dape--breakpoints)))
    (if (dape--capable-p conn :supportsFunctionBreakpoints)
        (dape--with-request-bind
            ((&key breakpoints &allow-other-keys) error)
            (dape-request conn :setFunctionBreakpoints
                          `(:breakpoints
                            ,(cl-map 'vector
                                     (lambda (b)
                                       `(:name ,(dape--function-breakpoint-name b)))
                                     function-breakpoints)))
          (when error
            (dape--warn "Failed to set function breakpoints: %s" error))
          (cl-loop
           for breakpoint in function-breakpoints
           for res across (or breakpoints [])
           do (setf (dape--breakpoint-id breakpoint)
                    (plist-put (dape--breakpoint-id breakpoint) conn
                               (plist-get res :id))
                    (dape--breakpoint-verified breakpoint)
                    (plist-put (dape--breakpoint-verified breakpoint) conn
                               (eq (plist-get res :verified) t))))
          (dape--request-continue cb error))
      (dape--request-continue cb))))