Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode debugger attach to local process

One of the great features of PyCharm is that it allows its debugger to attach to python processes running locally (and outside of the IDE).

As I am trying to move to VSCode to work in Python, I am struggling to configure launch.json to simulate PyCharm's attach to local process feature.

{
    "name": "Python: Attach",
    "type": "python",
    "request": "attach",
    "localRoot": "${workspaceFolder}",
    "remoteRoot": "${workspaceFolder}",
    "port": 8001,
    "secret": "my_secret",
    "host": "localhost"
},

This configuration is created by default when I select Python: attach option for debugger but I am convinced this is for remote debugging (with port and all), and most Google search results just talk about remote debugging for Python with VSCode.

Anyone had success in attaching a local debugger or two to multiple python processes running locally?

like image 476
Jun Park Avatar asked Apr 13 '18 14:04

Jun Park


People also ask

How do you attach a debugger to a process in Visual Studio?

You can attach the Visual Studio debugger to a running process on a local or remote computer. After the process is running, select Debug > Attach to Process or press Ctrl+Alt+p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process.


1 Answers

Local attach is currently not supported but is being worked on.

like image 96
Brett Cannon Avatar answered Sep 22 '22 15:09

Brett Cannon