PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

Automatically attach to subprocesses when debugging

Open anathan opened this issue 9 years ago • 8 comments

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?

anathan avatar May 12 '15 16:05 anathan

You can already manually attach to a child process via Debug -> Attach to Process. But we do need to support automatic attaching.

int19h avatar May 12 '15 16:05 int19h

@int19h Worth doing this for 3.0? How hard do you think it'll be?

zooba avatar Aug 24 '15 22:08 zooba

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.

int19h avatar Aug 24 '15 22:08 int19h

The milestone here is set to 3.0 which is already out, is there any update on the timeline for this feature? Thanks!

alexpilotti avatar Oct 26 '17 12:10 alexpilotti

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.

zooba avatar Oct 26 '17 15:10 zooba

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.

alexpilotti avatar Oct 26 '17 16:10 alexpilotti

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.

int19h avatar Jun 13 '22 17:06 int19h

Need to investigate if VS has the extensibility points needed to light this up.

AdamYoblick avatar Feb 02 '23 22:02 AdamYoblick