-
Hello all! Perhaps you can help me cause I don't knwo how I can debug something like Thanks a lot in advance. Uwe |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There is indeed a way to have VSCode listen for connections and for the clients to connect - use "listen" in your launch.json and However, you should be able to debug both scripts at once using your original setup if you use two separate debug configurations (one for each port) and attach to both processes sequentially. That is, you'd need to select your first debug config, do F5 on that (thus attaching to the first process), then switch debug config to the other one, and do F5 again. Another possibility would be to try to utilize subprocess debugging support. The problem there is that it needs to somehow know that you're starting a Python subprocess in order to intercept the command line and insert debugpy there. It does that for all common ways of launching processes, including low-level APIs like calling |
Beta Was this translation helpful? Give feedback.
The problem is that at the moment, when you press F5, this always corresponds to a single debug session with possible child subprocesses. So if your main script spins up another Python instance, that will actually connect to the same port for debugging, and things will work - but it works because it reports itself as a subprocess of the main process. If a new connection comes in on the same port but is not a related process, the debug adapter rejects it. Fundamentally this is because the current implementation of adapter assumes that there's only one root process in the session, and some of its logic would break if that is not the case.
But in principle, we could implement multi-rooted pr…