emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.31k stars 182 forks source link

error in process filter: list: Args out of range: 28, 1, 2 #526

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

I set the breakpoint, denoted by * for the following python code snippet:

import numpy as np
from numpy import pi, sin

a = np.array([1], dtype=bool)
if np.invert(a) == ~a:
*    print('ok')

When I use dap-python to debug it, I meet the following message:

error in process filter: Args out of range: 28, 1, 2

Any hints for this problem?

Regards, HZ

yyoncho commented 3 years ago

Please reproduce after M-x toggle-debug-on-error

hongyi-zhao commented 3 years ago
Debugger entered--Lisp error: (args-out-of-range 28 1 2)
  line-number-at-pos(28)
  (list :line (line-number-at-pos (dap-breakpoint-get-point it)))
  (let ((result (list :line (line-number-at-pos (dap-breakpoint-get-point it))))) (if condition (progn (plist-put result :condition condition))) (if log-message (progn (plist-put result :logMessage log-message))) (if hit-condition (progn (plist-put result :hitCondition hit-condition))) result)
  (let* ((it input0) (condition (plist-get it :condition)) (hit-condition (plist-get it :hit-condition)) (log-message (plist-get it :log-message))) (let ((result (list :line (line-number-at-pos (dap-breakpoint-get-point it))))) (if condition (progn (plist-put result :condition condition))) (if log-message (progn (plist-put result :logMessage log-message))) (if hit-condition (progn (plist-put result :hitCondition hit-condition))) result))
  (closure ((temp-buffer . #<buffer  *temp*>) (file-breakpoints (:point 28) (:point 1)) (file-name . "/home/werner/Desktop/work/python-test/aiida/emacs-...") cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (input0) (let* ((it input0) (condition (plist-get it :condition)) (hit-condition (plist-get it :hit-condition)) (log-message (plist-get it :log-message))) (let ((result (list :line (line-number-at-pos ...)))) (if condition (progn (plist-put result :condition condition))) (if log-message (progn (plist-put result :logMessage log-message))) (if hit-condition (progn (plist-put result :hitCondition hit-condition))) result)))((:point 28))
  mapcar((closure ((temp-buffer . #<buffer  *temp*>) (file-breakpoints (:point 28) (:point 1)) (file-name . "/home/werner/Desktop/work/python-test/aiida/emacs-...") cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (input0) (let* ((it input0) (condition (plist-get it :condition)) (hit-condition (plist-get it :hit-condition)) (log-message (plist-get it :log-message))) (let ((result (list :line (line-number-at-pos ...)))) (if condition (progn (plist-put result :condition condition))) (if log-message (progn (plist-put result :logMessage log-message))) (if hit-condition (progn (plist-put result :hitCondition hit-condition))) result))) ((:point 28) (:point 1)))
  -map((closure ((temp-buffer . #<buffer  *temp*>) (file-breakpoints (:point 28) (:point 1)) (file-name . "/home/werner/Desktop/work/python-test/aiida/emacs-...") cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (input0) (let* ((it input0) (condition (plist-get it :condition)) (hit-condition (plist-get it :hit-condition)) (log-message (plist-get it :log-message))) (let ((result (list :line (line-number-at-pos ...)))) (if condition (progn (plist-put result :condition condition))) (if log-message (progn (plist-put result :logMessage log-message))) (if hit-condition (progn (plist-put result :hitCondition hit-condition))) result))) ((:point 28) (:point 1)))
  (apply 'vector (-map #'(lambda (input0) (let* ((it input0) (condition (plist-get it :condition)) (hit-condition (plist-get it :hit-condition)) (log-message (plist-get it :log-message))) (let ((result ...)) (if condition (progn ...)) (if log-message (progn ...)) (if hit-condition (progn ...)) result))) file-breakpoints))
  (list :source (list :name (f-filename file-name) :path (if (eq system-type 'windows-nt) (s-replace "/" "\\" file-name) file-name)) :breakpoints (apply 'vector (-map #'(lambda (input0) (let* ((it input0) (condition ...) (hit-condition ...) (log-message ...)) (let (...) (if condition ...) (if log-message ...) (if hit-condition ...) result))) file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar #'(lambda (it) (ignore it) (line-number-at-pos (dap-breakpoint-get-point it))) file-breakpoints)))
  (dap--make-request "setBreakpoints" (list :source (list :name (f-filename file-name) :path (if (eq system-type 'windows-nt) (s-replace "/" "\\" file-name) file-name)) :breakpoints (apply 'vector (-map #'(lambda (input0) (let* (... ... ... ...) (let ... ... ... ... result))) file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar #'(lambda (it) (ignore it) (line-number-at-pos (dap-breakpoint-get-point it))) file-breakpoints))))
  (progn (insert-file-contents file-name) (dap--make-request "setBreakpoints" (list :source (list :name (f-filename file-name) :path (if (eq system-type 'windows-nt) (s-replace "/" "\\" file-name) file-name)) :breakpoints (apply 'vector (-map #'(lambda (input0) (let* ... ...)) file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar #'(lambda (it) (ignore it) (line-number-at-pos ...)) file-breakpoints)))))
  (unwind-protect (progn (insert-file-contents file-name) (dap--make-request "setBreakpoints" (list :source (list :name (f-filename file-name) :path (if (eq system-type 'windows-nt) (s-replace "/" "\\" file-name) file-name)) :breakpoints (apply 'vector (-map #'(lambda ... ...) file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar #'(lambda ... ... ...) file-breakpoints))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file-name) (dap--make-request "setBreakpoints" (list :source (list :name (f-filename file-name) :path (if (eq system-type ...) (s-replace "/" "\\" file-name) file-name)) :breakpoints (apply 'vector (-map #'... file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar #'... file-breakpoints))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file-name) (dap--make-request "setBreakpoints" (list :source (list :name (f-filename file-name) :path (if ... ... file-name)) :breakpoints (apply 'vector (-map ... file-breakpoints)) :sourceModified :json-false :lines (apply 'vector (mapcar ... file-breakpoints))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  dap--set-breakpoints-request("/home/werner/Desktop/work/python-test/aiida/emacs-..." ((:point 28) (:point 1)))
  (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler #'(lambda (resp) (setq finished (1+ finished)) (dap--update-breakpoints debug-session resp file-name) (if (= finished breakpoint-count) (progn (dap--set-exception-breakpoints debug-session callback))))) debug-session)
  (condition-case _err (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler #'(lambda (resp) (setq finished (1+ finished)) (dap--update-breakpoints debug-session resp file-name) (if (= finished breakpoint-count) (progn (dap--set-exception-breakpoints debug-session callback))))) debug-session) (file-missing (setq finished (1+ finished)) (remhash file-name breakpoints) (if (= finished breakpoint-count) (progn (funcall callback))) (dap--persist-breakpoints breakpoints)))
  (closure ((finished . 0) (breakpoint-count . 6) (callback . #f(compiled-function (&rest args2) #<bytecode -0xae5a9a9c3d5c51d>)) (breakpoints . #<hash-table equal 6/65 0x157aea21e9db>) (debug-session . #s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil)) cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (file-name file-breakpoints) (condition-case _err (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler #'(lambda (resp) (setq finished ...) (dap--update-breakpoints debug-session resp file-name) (if ... ...))) debug-session) (file-missing (setq finished (1+ finished)) (remhash file-name breakpoints) (if (= finished breakpoint-count) (progn (funcall callback))) (dap--persist-breakpoints breakpoints))))("/home/werner/Desktop/work/python-test/aiida/emacs-..." ((:point 28) (:point 1)))
  maphash((closure ((finished . 0) (breakpoint-count . 6) (callback . #f(compiled-function (&rest args2) #<bytecode -0xae5a9a9c3d5c51d>)) (breakpoints . #<hash-table equal 6/65 0x157aea21e9db>) (debug-session . #s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil)) cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (file-name file-breakpoints) (condition-case _err (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler #'(lambda (resp) (setq finished ...) (dap--update-breakpoints debug-session resp file-name) (if ... ...))) debug-session) (file-missing (setq finished (1+ finished)) (remhash file-name breakpoints) (if (= finished breakpoint-count) (progn (funcall callback))) (dap--persist-breakpoints breakpoints)))) #<hash-table equal 6/65 0x157aea21e9db>)
  (if (= 0 breakpoint-count) (funcall callback) (maphash #'(lambda (file-name file-breakpoints) (condition-case _err (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler #'...) debug-session) (file-missing (setq finished (1+ finished)) (remhash file-name breakpoints) (if (= finished breakpoint-count) (progn ...)) (dap--persist-breakpoints breakpoints)))) breakpoints))
  (let ((breakpoint-count (hash-table-count breakpoints)) (finished 0)) (if (= 0 breakpoint-count) (funcall callback) (maphash #'(lambda (file-name file-breakpoints) (condition-case _err (dap--send-message (dap--set-breakpoints-request file-name file-breakpoints) (dap--resp-handler ...) debug-session) (file-missing (setq finished ...) (remhash file-name breakpoints) (if ... ...) (dap--persist-breakpoints breakpoints)))) breakpoints)))
  dap--configure-breakpoints(#s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil) #<hash-table equal 6/65 0x157aea21e9db> #f(compiled-function (&rest args2) #<bytecode -0xae5a9a9c3d5c51d>))
  (let nil (dap--configure-breakpoints debug-session (dap--get-breakpoints) (apply-partially #'dap--send-configuration-done debug-session)))
  (cond ((equal event-type '"output") (let nil (let ((formatted-output (dap--output-buffer-format body))) (if formatted-output (let ((formatted-output ...)) (if formatted-output (progn ...))))))) ((equal event-type '"breakpoint") (let nil (let ((breakpoint (if body (progn ...)))) (if breakpoint (let ((id ...)) (if id (let ... ...))))))) ((equal event-type '"thread") (let nil (let* ((id (gethash "threadId" body)) (reason (gethash "reason" body))) (puthash id reason (progn (or (progn ...) (signal ... ...)) (aref debug-session 10))) (run-hooks 'dap-session-changed-hook) (dap--send-message (dap--make-request "threads") #'(lambda (input0) (let* ... ... ...)) debug-session)))) ((equal event-type '"exited") (let nil (dap--mark-session-as-terminated debug-session))) ((equal event-type '"continued") (let nil (let* ((thread-id (gethash "threadId" body))) (remhash thread-id (progn (or (progn ...) (signal ... ...)) (aref debug-session 10))) (if (and (equal thread-id (progn ... ...)) (equal debug-session (dap--cur-session))) (dap--resume-application debug-session) (run-hooks 'dap-session-changed-hook))))) ((equal event-type '"stopped") (let nil (let* ((thread-id (gethash "threadId" body)) (type (gethash "type" body)) (reason (gethash "reason" body))) (puthash thread-id (or type reason) (progn (or (progn ...) (signal ... ...)) (aref debug-session 10))) (dap--select-thread-id debug-session thread-id) (if (string= "exception" reason) (progn (dap--send-message (dap--make-request "exceptionInfo" ...) #'... debug-session))) (run-hooks 'dap-session-changed-hook)))) ((equal event-type '"terminated") (let nil (dap--mark-session-as-terminated debug-session))) ((equal event-type '"usernotification") (let nil (let* ((notification-type (gethash "notificationType" body)) (message (gethash "message" body))) (warn (format "[%s] %s" notification-type message))))) ((equal event-type '"initialized") (let nil (dap--configure-breakpoints debug-session (dap--get-breakpoints) (apply-partially #'dap--send-configuration-done debug-session)))) ((equal event-type '"loadedSource") (let nil (let* ((source (gethash "source" (gethash "body" event)))) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... debug-session))) (let* ((v debug-session)) (aset v 20 (let* ... ...)))) (run-hook-with-args 'dap-loaded-sources-changed-hook debug-session)))) ((equal event-type '"capabilities") (let nil (let* ((capabilities (gethash "capabilities" (gethash "body" event)))) (ht-update! (progn (or (progn ...) (signal ... ...)) (aref debug-session 18)) capabilities)))) (t (let nil (dap-handle-event (intern event-type) debug-session body))))
  (let* ((body (gethash "body" event)) (event-type (gethash "event" event))) (cond ((equal event-type '"output") (let nil (let ((formatted-output (dap--output-buffer-format body))) (if formatted-output (let (...) (if formatted-output ...)))))) ((equal event-type '"breakpoint") (let nil (let ((breakpoint (if body ...))) (if breakpoint (let (...) (if id ...)))))) ((equal event-type '"thread") (let nil (let* ((id (gethash "threadId" body)) (reason (gethash "reason" body))) (puthash id reason (progn (or ... ...) (aref debug-session 10))) (run-hooks 'dap-session-changed-hook) (dap--send-message (dap--make-request "threads") #'(lambda ... ...) debug-session)))) ((equal event-type '"exited") (let nil (dap--mark-session-as-terminated debug-session))) ((equal event-type '"continued") (let nil (let* ((thread-id (gethash "threadId" body))) (remhash thread-id (progn (or ... ...) (aref debug-session 10))) (if (and (equal thread-id ...) (equal debug-session ...)) (dap--resume-application debug-session) (run-hooks 'dap-session-changed-hook))))) ((equal event-type '"stopped") (let nil (let* ((thread-id (gethash "threadId" body)) (type (gethash "type" body)) (reason (gethash "reason" body))) (puthash thread-id (or type reason) (progn (or ... ...) (aref debug-session 10))) (dap--select-thread-id debug-session thread-id) (if (string= "exception" reason) (progn (dap--send-message ... ... debug-session))) (run-hooks 'dap-session-changed-hook)))) ((equal event-type '"terminated") (let nil (dap--mark-session-as-terminated debug-session))) ((equal event-type '"usernotification") (let nil (let* ((notification-type (gethash "notificationType" body)) (message (gethash "message" body))) (warn (format "[%s] %s" notification-type message))))) ((equal event-type '"initialized") (let nil (dap--configure-breakpoints debug-session (dap--get-breakpoints) (apply-partially #'dap--send-configuration-done debug-session)))) ((equal event-type '"loadedSource") (let nil (let* ((source (gethash "source" ...))) (progn (or (progn ...) (signal ... ...)) (let* (...) (aset v 20 ...))) (run-hook-with-args 'dap-loaded-sources-changed-hook debug-session)))) ((equal event-type '"capabilities") (let nil (let* ((capabilities (gethash "capabilities" ...))) (ht-update! (progn (or ... ...) (aref debug-session 18)) capabilities)))) (t (let nil (dap-handle-event (intern event-type) debug-session body)))))
  dap--on-event(#s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil) #<hash-table equal 3/65 0x157ae9b00173>)
  (let nil (dap--on-event debug-session parsed-msg))
  (cond ((equal val '"event") (let nil (dap--on-event debug-session parsed-msg))) ((equal val '"response") (let nil (let* ((callback (and t (gethash key handlers nil)))) (if callback (progn (funcall callback parsed-msg) (remhash key handlers) (run-hook-with-args 'dap-executed-hook debug-session (gethash "command" parsed-msg))) (message "Unable to find handler for %s." (pp parsed-msg)))))) ((equal val '"request") (let nil (dap--start-process debug-session parsed-msg))))
  (let* ((val (gethash "type" parsed-msg))) (cond ((equal val '"event") (let nil (dap--on-event debug-session parsed-msg))) ((equal val '"response") (let nil (let* ((callback (and t ...))) (if callback (progn (funcall callback parsed-msg) (remhash key handlers) (run-hook-with-args ... debug-session ...)) (message "Unable to find handler for %s." (pp parsed-msg)))))) ((equal val '"request") (let nil (dap--start-process debug-session parsed-msg)))))
  (condition-case _ (let* ((val (gethash "type" parsed-msg))) (cond ((equal val '"event") (let nil (dap--on-event debug-session parsed-msg))) ((equal val '"response") (let nil (let* ((callback ...)) (if callback (progn ... ... ...) (message "Unable to find handler for %s." ...))))) ((equal val '"request") (let nil (dap--start-process debug-session parsed-msg))))) (quit))
  (let* ((parsed-msg (dap--read-json m)) (key (gethash "request_seq" parsed-msg nil))) (if dap-print-io (progn (let ((inhibit-message dap-inhibit-io)) (message "Received:\n%s" (dap--json-encode parsed-msg))))) (condition-case _ (let* ((val (gethash "type" parsed-msg))) (cond ((equal val '"event") (let nil (dap--on-event debug-session parsed-msg))) ((equal val '"response") (let nil (let* (...) (if callback ... ...)))) ((equal val '"request") (let nil (dap--start-process debug-session parsed-msg))))) (quit)))
  (closure ((msg . "Content-Length: 51\15\n\15\n{\"seq\": 4, \"type\": \"event\", ...") (_ . #<process Python :: Run file (buffer)<1>>) (handlers . #<hash-table eql 5/65 0x157ae9aa0e59>) (parser . #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "")) (debug-session . #s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil)) cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (m) (let* ((parsed-msg (dap--read-json m)) (key (gethash "request_seq" parsed-msg nil))) (if dap-print-io (progn (let ((inhibit-message dap-inhibit-io)) (message "Received:\n%s" (dap--json-encode parsed-msg))))) (condition-case _ (let* ((val (gethash "type" parsed-msg))) (cond ((equal val ...) (let nil ...)) ((equal val ...) (let nil ...)) ((equal val ...) (let nil ...)))) (quit))))("{\"seq\": 4, \"type\": \"event\", \"event\": \"initialized\"...")
  mapc((closure ((msg . "Content-Length: 51\15\n\15\n{\"seq\": 4, \"type\": \"event\", ...") (_ . #<process Python :: Run file (buffer)<1>>) (handlers . #<hash-table eql 5/65 0x157ae9aa0e59>) (parser . #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "")) (debug-session . #s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil)) cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (m) (let* ((parsed-msg (dap--read-json m)) (key (gethash "request_seq" parsed-msg nil))) (if dap-print-io (progn (let ((inhibit-message dap-inhibit-io)) (message "Received:\n%s" (dap--json-encode parsed-msg))))) (condition-case _ (let* ((val (gethash "type" parsed-msg))) (cond ((equal val ...) (let nil ...)) ((equal val ...) (let nil ...)) ((equal val ...) (let nil ...)))) (quit)))) ("{\"seq\": 4, \"type\": \"event\", \"event\": \"initialized\"..."))
  (closure ((handlers . #<hash-table eql 5/65 0x157ae9aa0e59>) (parser . #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "")) (debug-session . #s(dap--debug-session :name "Python :: Run file (buffer)<1>" :last-id 6 :proc #<process Python :: Run file (buffer)<1>> :response-handlers #<hash-table eql 5/65 0x157ae9aa0e59> :parser #s(dap--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "") :output-buffer #<buffer *Python :: Run file (buffer)<1> out*> :thread-id nil :workspace nil :threads nil :thread-states #<hash-table eql 0/65 0x157ae9aa0de9> :active-frame-id nil :active-frame nil :cursor-marker nil :state pending :breakpoints #<hash-table equal 0/65 0x157ae9aa0db1> :thread-stack-frames #<hash-table eql 0/65 0x157ae9aa0d6d> :launch-args (:type "python" :request "launch" :name "Python :: Run file (buffer)<1>" :program "/home/werner/Desktop/work/python-test/ide/emacs-py..." :args [] :dap-server-path ("/home/werner/.pyenv/versions/datasci/bin/python" "-m" "debugpy.adapter")) :current-capabilities #<hash-table equal 20/65 0x157ae9aa0d35> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x157ae9aa0d05> :output-displayed nil)) cl-struct-dap--parser-tags cl-struct-dap--debug-session-tags vterm-kill-buffer-on-exit vterm-shell t) (_ msg) (mapc #'(lambda (m) (let* ((parsed-msg ...) (key ...)) (if dap-print-io (progn ...)) (condition-case _ (let* ... ...) (quit)))) (dap--parser-read parser msg)))(#<process Python :: Run file (buffer)<1>> "Content-Length: 51\15\n\15\n{\"seq\": 4, \"type\": \"event\", ...")
yyoncho commented 3 years ago

This is bug in dap-mode, you have breakpoint beyound the file ending. One way to fix it is to delete dap-breakpoints-file

hongyi-zhao commented 3 years ago

Thank you for your comment. M-x dap-breakpoint-delete-all and then re-add the breakpoint at the same position does the trick.