emacs-lsp / dap-mode

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

`rust-gdb` has error with the configuration in doc. #594

Open ccqpein opened 2 years ago

ccqpein commented 2 years ago

I have gdb and rust-gdb installed in my macOS. I have tried both of them inside the terminal, and it usually works.

But when I M-x dap-debug, it shows the icons at the head of the window and that's it, nothing more. I check the *GDB:Run stderr buffer and find the error message:

(node:31253) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (Use node --trace-deprecation ... to show where the warning was created) attempt to send more than one response for command launch Failed to unlink debug server

(dap-register-debug-template
   "Rust::GDB Run Configuration"
   (list :type "gdb"
         :request "launch"
         :name "GDB::Run"
         :gdbpath "rust-gdb"
         :target nil
         ;; these lines copy form somewhere else and no matter they are here or not
         ;; don't change anything
         :dap-compilation "cargo build" 
         :dap-compilation-dir "${workspaceFolder}"
         :cwd "${workspaceFolder}"))

Is anyone know what/why are the problems? How can I fix it?

daym commented 1 month ago

I'd suggest you uses (require 'dap-gdb) if your gdb is new enough (>= 14), then "node" (from your error message) is out of the picture entirely.

ccqpein commented 1 month ago

@daym Thanks, let me try