调试器附加到本地进程

调试器附加到本地进程

本文介绍了VSCode 调试器附加到本地进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PyCharm 的一大特色是它允许调试器附加到本地(和 IDE 外部)运行的 Python 进程.

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).

当我尝试转向 VSCode 以在 Python 中工作时,我正在努力配置 launch.json 以模拟 PyCharm 附加到本地进程功能.

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

当我为调试器选择 Python: attach 选项时,默认情况下会创建此配置,但我确信这是用于远程调试(带有端口和所有),并且大多数 Google 搜索结果只讨论远程使用 VSCode 调试 Python.

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.

有人成功地将一个或两个本地调试器附加到本地运行的多个 python 进程吗?

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

推荐答案

目前不支持本地附加,但正在处理中.

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

这篇关于VSCode 调试器附加到本地进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:11