Debugging in emacs (doom)


since a week I try to setup the debugger for emacs (MacOS Arm) and as I do not have so much experiences with lisp I do not know what I am doing wrong.

I have try to follow the following ressources without success:

My current configuration (config.el):

(require 'dap-gdb-lldb)
(setq dap-auto-configure-features '(sessions locals controls tooltip))

Path to lldb

which lldb

Path to lldb-mi:

which lldb-mi

Path to rust-lldb:

which rust-lldb

Path to rust-analyser:

which rust-analyzer

The problem:

I can start the debugger with the standard configuration and go line by line(1) but I am not able to see the values of the variables.

(1) some times this does not work and some time I jump from line 2 to 4 for example.

I have tried to put this configuration in the config.el but when I start the the debugger with dap-debug emacs show me the following message:

dap-debug: Have you loaded the ‘lldb’ specific dap package? 


(use-package exec-path-from-shell
  :init (exec-path-from-shell-initialize))

(when (executable-find "lldb-mi")
  (use-package dap-mode
    (dap-ui-controls-mode 1)

    (require 'dap-lldb)
    (require 'dap-gdb-lldb)
    ;; installs .extension/vscode
     "Rust::LLDB Run Configuration"
     (list :type "lldb"
           :request "launch"
           :name "LLDB::Run"
           :gdbpath "rust-lldb"
           ;; uncomment if lldb-mi is not in PATH
           ;; :lldbmipath "path/to/lldb-mi"

Thank you for your support!

1 Like

I found the solution!

I was missing dap-codelldb.

Now I get the value of the variables :

I have configured the dap-mode as follow in the file config.el:

(after! dap-mode
  (require 'dap-codelldb)

  (setq dap-auto-configure-features '(sessions locals controls tooltip))

   "LLDB::Run Rust"
   (list :type "lldb"
         :request "launch"
         :name "LLDB::Run"
         :miDebuggerPath "~/.cargo/bin/rust-lldb"
         :target nil
         :cwd nil
         :program "~/my_app/target/debug/my_app"

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.