emacs-lsp / lsp-treemacs

lsp-mode :heart: treemacs
GNU General Public License v3.0
396 stars 46 forks source link

Error when debugging code with dap-mode #114

Open sdwolfz opened 2 years ago

sdwolfz commented 2 years ago
Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  next-button(nil)
  treemacs--do-expand-generic(#<marker at 1 in *dap-ui-sessions*>)
  treemacs-GENERIC-extension()
  lsp-treemacs-initialize()
  lsp-treemacs-render(((:label #("Ruby::Run" 0 9 (face dap-ui-sessions-active-session-face)) :key "Ruby::Run" :session #s(dap--debug-session :name "Ruby::Run" :last-id 5 :proc #<process Ruby::Run> :response-handlers #<hash-table eql 0/65 0x15829afdbef7> :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 *Ruby::Run out*> :thread-id 2 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x15829afdbfaf> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x15829afddbc9> :thread-stack-frames #<hash-table eql 0/65 0x15829afdbfcf> :launch-args (:type "Ruby" :cwd "/home/me/Workspace/Personal/experimental/dap-debug..." :request "launch" :program "/home/me/Workspace/Personal/experimental/dap-debug..." :name "Ruby::Run" :dap-server-path ("node" "/home/me/.emacs.d/.extension/vscode/rebornix.Ruby/...")) :current-capabilities #<hash-table equal 2/65 0x15829afdbfef> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x158299e216c1> :output-displayed nil) :ret-action dap-ui-session-select :icon session-started :actions (["Select" dap-ui-session-select] ["Disconnect" dap-ui-disconnect] ["Delete Session" dap-ui-delete-session] "--" ["Delete All Sessions" dap-delete-all-sessions]) :children-async #f(compiled-function (node callback) #<bytecode -0x1e1fcad58f6dec47>))) " Debug Sessions " nil "*dap-ui-sessions*" (["Delete All Sessions" dap-delete-all-sessions]))
  dap-ui-sessions()
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_60>(sessions)
  mapc(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_60> (sessions locals breakpoints expressions controls tooltip))
  seq-do(#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_60> (sessions locals breakpoints expressions controls tooltip))
  dap-ui--show-many-windows(#s(dap--debug-session :name "Ruby::Run" :last-id 5 :proc #<process Ruby::Run> :response-handlers #<hash-table eql 0/65 0x15829afdbef7> :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 *Ruby::Run out*> :thread-id 2 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x15829afdbfaf> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x15829afddbc9> :thread-stack-frames #<hash-table eql 0/65 0x15829afdbfcf> :launch-args (:type "Ruby" :cwd "/home/me/Workspace/Personal/experimental/dap-debug..." :request "launch" :program "/home/me/Workspace/Personal/experimental/dap-debug..." :name "Ruby::Run" :dap-server-path ("node" "/home/me/.emacs.d/.extension/vscode/rebornix.Ruby/...")) :current-capabilities #<hash-table equal 2/65 0x15829afdbfef> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x158299e216c1> :output-displayed nil))
  dap--select-thread-id(#s(dap--debug-session :name "Ruby::Run" :last-id 5 :proc #<process Ruby::Run> :response-handlers #<hash-table eql 0/65 0x15829afdbef7> :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 *Ruby::Run out*> :thread-id 2 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x15829afdbfaf> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x15829afddbc9> :thread-stack-frames #<hash-table eql 0/65 0x15829afdbfcf> :launch-args (:type "Ruby" :cwd "/home/me/Workspace/Personal/experimental/dap-debug..." :request "launch" :program "/home/me/Workspace/Personal/experimental/dap-debug..." :name "Ruby::Run" :dap-server-path ("node" "/home/me/.emacs.d/.extension/vscode/rebornix.Ruby/...")) :current-capabilities #<hash-table equal 2/65 0x15829afdbfef> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x158299e216c1> :output-displayed nil) 2)
  dap--on-event(#s(dap--debug-session :name "Ruby::Run" :last-id 5 :proc #<process Ruby::Run> :response-handlers #<hash-table eql 0/65 0x15829afdbef7> :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 *Ruby::Run out*> :thread-id 2 :workspace nil :threads nil :thread-states #<hash-table eql 1/65 0x15829afdbfaf> :active-frame-id nil :active-frame nil :cursor-marker nil :state running :breakpoints #<hash-table equal 1/65 0x15829afddbc9> :thread-stack-frames #<hash-table eql 0/65 0x15829afdbfcf> :launch-args (:type "Ruby" :cwd "/home/me/Workspace/Personal/experimental/dap-debug..." :request "launch" :program "/home/me/Workspace/Personal/experimental/dap-debug..." :name "Ruby::Run" :dap-server-path ("node" "/home/me/.emacs.d/.extension/vscode/rebornix.Ruby/...")) :current-capabilities #<hash-table equal 2/65 0x15829afdbfef> :error-message nil :loaded-sources nil :program-proc nil :metadata #<hash-table eql 0/65 0x158299e216c1> :output-displayed nil) #<hash-table equal 4/65 0x158299eaaca7>)
  #f(compiled-function (m) #<bytecode -0x9d8769b5dc0145>)("{\"seq\":7,\"type\":\"event\",\"event\":\"stopped\",\"body\":{...")
  mapc(#f(compiled-function (m) #<bytecode -0x9d8769b5dc0145>) ("{\"seq\":6,\"type\":\"response\",\"request_seq\":5,\"comman..." "{\"seq\":7,\"type\":\"event\",\"event\":\"stopped\",\"body\":{..."))
  #f(compiled-function (_ msg) #<bytecode 0x1fc22dd828ce651a>)(#<process Ruby::Run> "Content-Length: 88\15\n\15\n{\"seq\":6,\"type\":\"response\",\"...")

I've encountered this with a simple ruby script:

# frozen_string_literal: true

print 'Hello'

Adding a breakpoint at line 3 with dap-breakpoint-add and running dap-debug.

This is part of multiple other errors in the interaction between dap-mode, lsp-mode, and treemacs as killing the session and re-running dap-debug produces other messages, without stacktraces even if deubg-on-error is turned on, and the dap UI gradually activates with the left and right vertical bars displaying the dap-ui-breakpoints and dap-locals buffers.

treemacs--do-expand-generic: Wrong type argument: integer-or-marker-p, nil
Error running timer ‘dap-ui-locals--refresh’: (wrong-type-argument integer-or-marker-p nil)
Debug session process exited with status: killed
treemacs--do-expand-generic: Wrong type argument: integer-or-marker-p, nil
treemacs-expand-node: Wrong type argument: integer-or-marker-p, nil
treemacs-expand-node: Wrong type argument: integer-or-marker-p, nil

My spacemacs config is here: https://gitlab.com/sdwolfz/dotfiles/-/blob/master/.spacemacs and I'm running emacs in the terminal.

Let me know if you need more information. I was unable to debug it further.