This project has moved and is read-only. For the latest updates, please go here.

Attach to Process

Jan 21, 2013 at 11:31 AM
Edited Jan 21, 2013 at 5:38 PM

Sorry if this is explained somewhere, but I just couldn't find any special info that would allow me to do this, so I'm basically assuming that the feature is not working so well?

I'm trying to attach to a very simple python program, via MSVS 2012 using the "Python Debugging" as code type.

I locate the process via the "os.getpid()" which was suggested in one of the threads, but when MSVS attaches, the "symbols" won't really load proparly (I guess).

If I look at the modules window, it's empty. This is very different from when the debugger is launched via F5.

Also, the suggested "Break All" method won't work. It says "Unable to break execution. This process is not currently executing the type of code that you selected to debug"

The breakpoints are "valid" in the sense that they are red (as opposed to hollow with a warning on them)

The program itself looks like this:


import os
import time

print "PID", os.getpid()

for i in range(100):
    print "i", i

print "DONE!"


And it's invoked by c:\python27_64\python.exe

If I debug the program via the F5 key, the breakpoints work fine.

Any advice on how to get this working?



It just occurred to me to test the 32-bit version. And lo and behold, it worked fine!

So it's apparently a 64-bit issue.

It seems to behave similarly to this issue

Jan 21, 2013 at 6:26 PM

Thanks for the report, we'll take a look.

Mar 19, 2013 at 10:06 AM
I just tried it with PTVS 2.0 alpha and the issue seems to be fixed now.