I'm not aware of any issues specifically with attaching. One problem that I know of with PyQt is that if its classes (rather than Python's standard thread/threading modules) are used to spawn threads, then debugger won't see those threads. But it should
still see the main thread on which interpreter is initialized.
Beyond that, it would probably need investigating specifically with that product. Feel free to file a bug in the tracker, and I'll try to get a local repro and look at it once I get to it.
In the meantime, there are some workarounds that might help. First of all, try using
. When the Python side can explicitly set up
, attaching to it is much more reliable than the normal Debug -> Attach to Process path, especially with a custom host.
If that still doesn't help, then I would suggest that you try attaching with
mixed mode debugging
. Basically, when attaching, instead of letting VS detect the code type, select it manually, and mark C++ along with Python. The mixed-mode engine is very different from the regular one, and one thing in particular that it generally
does more reliably is attaching to a running process. This comes at a price - the Python part of the mixed debugger is much more limited in what it can do compared to the regular Python debugger (there is a list of limitations in the doc page). But it's better
than nothing, and generally just "good enough" for many common cases.