this post was submitted on 20 Oct 2023
1 points (100.0% liked)

Emacs

311 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

https://github.com/svaante/dape#

Given that eglot has been part of the core emacs, I believe this is a long lasting wish for a lot of emacsers that has finally been fulfilled. (a stand alone DAP implementation that does not rely on LSP-mode)

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago (9 children)

How would you attach a DAP python debugger to a running instance of (i)Python? Is there some import debugpy; debugpy.start() command or similar?

[–] [email protected] 1 points 1 year ago (2 children)

There is

In python:

import debugpy
debugpy.listen(5678) # debugpy will open 5678

Then add the following configuration to dape

(add-to-list 'dape-configs
`(debugpy-attach
  modes ()
  host "localhost"
  port ,(lambda () (read-number "Port: "))
  :type "debugpy"
  :request "attach"))

Supposedly there is a way to attach by pid with python3 -m debugpy --listen localhost:5678 --pid 12345, but that failed, both on osx and linux.

[–] [email protected] 1 points 1 year ago (1 children)

Yes, I also tried to use --pid to attach to a python process, and failed too.

[–] [email protected] 1 points 1 year ago

Did you either succeed with debugpy.listen()? Is that suitable to call interactively then quit (like iPDB)?

load more comments (6 replies)