Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode debugger auto attach to subprocess

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.
like image 655
Black Frog Avatar asked May 05 '18 14:05

Black Frog


1 Answers

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"
   }

]

like image 124
Troy Witthoeft Avatar answered Sep 20 '22 00:09

Troy Witthoeft