What is going on in the background in PyCharm whenever you run these PyCharm instructions to "attach to a local process", that makes it possible to then set breakpoints and debug. (A Chalice/Flask app lets say...)
Asked
Active
Viewed 154 times
1 Answers
0
Often the PyCharm debugger pydev.py will be launched first and spawn the process that runs the code you want to debug.
When an application/process is launched separately "Attach to Process" means the debugger process will be launched in parallel and be attached to an already running process that the debugger did not spawn (like Chalice/Flask or other applications that use their own spawning process).

bad_coder
- 11,289
- 20
- 44
- 72
-
what is the process of "attaching" look like? is it wrapping the process somehow? re-launching the process? – Back2Basics May 01 '22 at 05:43
-
@Back2Basics it uses an [OS-level API](https://stackoverflow.com/a/216837) so it depends on the OS you're using. The whole point of using the IDE's interface is making those specifics transparent and a non-concern for the developer. – bad_coder May 01 '22 at 11:24