dape icon indicating copy to clipboard operation
dape copied to clipboard

Configuration for golang remote attach (kube pod)

Open venkateshks opened this issue 1 year ago • 3 comments

Hi, I need to make dape attach to a remote dlv session which has a local tunnel at port 40000. I tried the following configs to attach to, but without any success. If anyone has a working config OR if you have some ideas on how to make this work please let me know. The former uses the vscode debugAdapter, the latter is an attempt to use dape's default, perhaps dlv based adapter. The latter attaches to the tunnel, but doesnt trigger the dap adapter, rather directly attaches.

(add-to-list
   'dape-configs
   `(delve-remote-new-headless26
     modes (go-mode go-ts-mode)
     command "node"
     command-args ("/Users/xxx/.emacs.d/debug-adapters/extension/dist/debugAdapter.js")
     :request "attach"
     :mode "remote"
     :type "go"
     :debugAdapter: "dlv-dap"
     :port 40000
     :showLog "true"
     :substitutePath [(:from "/Users/xxx/src/project/" :to "/src/project/")]
     ))
  (add-to-list
   'dape-configs
   `(delve-remote-new-headless3
     modes (go-mode go-ts-mode)
     hostname "localhost"
     port 40000
     :request "attach"
     :mode "remote"
     :type "go"
     :port 40000
     :showLog "true"
     :substitutePath [(:from "/Users/xxx/src/project/" :to "/src/project/")]
     ))

venkateshks avatar Apr 25 '24 05:04 venkateshks

Hey sorry for the late response, I have not gotten dlv attach to process with pid to work on my machine, so I can't test it with dape.

But if it's not an requirement to attach to process but if its fine that dape starts the process https://github.com/svaante/dape/issues/109#issuecomment-2118831286 will work.

svaante avatar May 18 '24 14:05 svaante

Thanks, It is a requirement to attach. If there is some pointers, I can try to help with a PR. I would like to try vscode debugadapter and dlv and see which works

venkateshks avatar May 23 '24 04:05 venkateshks

Your contributions are highly appreciated!

svaante avatar May 26 '24 12:05 svaante