PTVS
PTVS copied to clipboard
Automatically attach to subprocesses when debugging
The debugger attach code seems to be hardwired to support only a single process, which breaks support for debugging applications using the multiprocessing library. Perhaps one fix is to allow manual attachment to the child process?
You can already manually attach to a child process via Debug -> Attach to Process. But we do need to support automatic attaching.
@int19h Worth doing this for 3.0? How hard do you think it'll be?
Adding a command from debugger to VS to attach to a new process is easy enough. It's catching all the various ways of spawning those processes from Python that I think might prove tricky. If most of this is pure Python, we should be able to do the same thing we do with threads, and hijack the class responsible.
The milestone here is set to 3.0 which is already out, is there any update on the timeline for this feature? Thanks!
No timeline (and the milestone was un-set a while ago), but we're very aware of this limitation and want to address it. We have more significant debugger work going on first, though.
Thanks, looking forward for it! Unfortunately since almost every significant Python app relies on multiple processes for parallel workloads (os.fork / multiprocessing, etc), remote debugging is not very useful without this feature.
This is supported in debugpy, but requires cooperation from PTVS to light up. Since this is something that shows up quite a lot in web dev (most frameworks use subprocesses to implement auto-reload), we should take another look at this in triage.
Need to investigate if VS has the extensibility points needed to light this up.