11

In the console output below, it clearly say breakpoints won't work in new process. Where is this debugger settings for attaching to sub-process?

pydev debugger: starting

pydev debugger: New process is launching (breakpoints won't work in the new process).
pydev debugger: To debug that process please enable 'Attach to subprocess automatically while debugging?' option in the debugger settings.

Bottle v0.12.13 server starting up (using WSGIRefServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-C to quit.
Black Frog
  • 11,595
  • 1
  • 35
  • 66

2 Answers2

3

Yes. As of late 2018, VSCode can debug a python subprocess. We just need to set the configuration correctly. In Visual Studio Code, edit the launch.json file and add a "subProcess": true key value pair to the debugging configuration you are using. Here is an example.

"configurations": [
   {
       "name": "Python: Current File",
       "type": "python",
       "request": "launch",
       "subProcess": true,
       "program": "${file}",
       "console": "integratedTerminal"
   }

]

Troy Witthoeft
  • 2,498
  • 2
  • 28
  • 37
0

I don't know how to attach to sub-process. However, I was facing the same problem while debugging my python flask, and I noticed that the pydev debugger: New process is launching ... problem correlated to my use of use_reloader=True in my app.run. When I removed that, the breakpoints worked fine!

pdhoolia
  • 11
  • 2