svaante / dape

Debug Adapter Protocol for Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to pass arguments to dape?

wybryk-ananasa opened this issue · comments

I would like to debug simple c++ with dape, but I have no idea how to pass arguments to dape. I was trying something like this:

(global-set-key (kbd "C-1") (lambda ()
                              (interactive)
                              (dape '(type "codelldb-cc"
                                      command-cwd "~/emacs"
                                      request "launch"
                                      program "test"
                                      cwd "."))))

Can anybody give me a simple example how to run it?

Call the dape command then codelldb-cc :args ["first-arg" "second-arg"]' :program "a.out"

Can I store config in variable and call dape like this?

(defvar config "codelldb...")
(dape config)

The recommended way is to (setq dape-command '(codelldb-cc :args ["my-arg"]) in dir locals. Then execute the dape command and the contents of dape-command will be inserted into the minibuffer. You can always do dape-restart to run the last configuration again.

Thanks for explanation!