VSCode python“未验证的断点”在调试期间?

洛克14

我正在使用VSCode调试python应用程序。

我从启动调试器的地方有一个主要的python文件。我可以在该文件中放置断点,但是如果要将断点放置在主文件调用的其他文件中,则将它们作为“未验证的断点”来获取,调试器将忽略它们。

如何更改我的位置,launch.json以便能够在项目中的所有文件上设置断点?

这是我目前的情况launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}"
        },
        {
            "name": "Python: Attach",
            "type": "python",
            "request": "attach",
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "${workspaceFolder}",
            "port": 3000,
            "secret": "my_secret",
            "host": "localhost"
        },
        {
            "name": "Python: Terminal (integrated)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        },
        {
            "name": "Python: Terminal (external)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal"
        },
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/manage.py",
            "args": [
                "runserver",
                "--noreload",
                "--nothreading"
            ],
            "debugOptions": [
                "RedirectOutput",
                "Django"
            ]
        },
        {
            "name": "Python: Flask (0.11.x or later)",
            "type": "python",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "${workspaceFolder}/app.py"
            },
            "args": [
                "run",
                "--no-debugger",
                "--no-reload"
            ]
        },
        {
            "name": "Python: Module",
            "type": "python",
            "request": "launch",
            "module": "nf.session.session"
        },
        {
            "name": "Python: Pyramid",
            "type": "python",
            "request": "launch",
            "args": [
                "${workspaceFolder}/development.ini"
            ],
            "debugOptions": [
                "RedirectOutput",
                "Pyramid"
            ]
        },
        {
            "name": "Python: Watson",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/console.py",
            "args": [
                "dev",
                "runserver",
                "--noreload=True"
            ]
        },
        {
            "name": "Python: All debug Options",
            "type": "python",
            "request": "launch",
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "module": "module.name",
            "env": {
                "VAR1": "1",
                "VAR2": "2"
            },
            "envFile": "${workspaceFolder}/.env",
            "args": [
                "arg1",
                "arg2"
            ],
            "debugOptions": [
                "RedirectOutput"
            ]
        }
    ]
}

谢谢

洛克14

其他模块的导入位于字符串内部,并使用execute函数进行调用。这就是为什么VSCode不能在其他文件中设置断点的原因,因为它不知道主文件使用了这些其他文件。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

VSCode 未绑定断点

使用VSCode在Python调试期间读取输入

vscode(Win 10)中的断点“未验证”,并且在远程调试Linux Docker容器(Hyper-V)中的Go app时不会出现断点

VSCode调试器条件断点

Xdebug + VSCode + PHP + WampServer:调试会话开始时未命中断点

远程调试-未验证的断点

在VSCode中调试本机

无法在 vscode 中调试

VSCode调试Celery Worker

未解决的 VSCode for Python 导入

在 vscode 中调试 python 文件时,启动程序似乎在第一个断点暂停之前运行完整文件

从外部脚本使用 vscode 调试 python

VSCode:如何使用参数调试Python脚本

vscode在docker实例中运行/调试python

VSCode Python写入调试控制台

VSCode Python调试器FileNotFoundError

调试器差异:VSCode /终端(Python)

VSCode:调试配置中的 Python 路径无效

VSCode 调试在调试 Rust 库时为所有断点显示“Locations: 0”

VSCode中的Python Azure Function(HTTPTrigger)上的调试未启动Func Host正确启动

vscode中的Python

VSCode Python语言扩展

无法在VSCode中调试Typescript

使用vscode调试电子。runtimeExecutable

.vscode中的调试问题

在 VsCode 中调试 Jupyter notebook

每当在 VSCode/Python 中遇到断点时运行代码

无法使用安装了自定义 PHP 7.2 的 Vagrant 和使用 Firefox 的 VSCode 进行调试,VSCode 无法进入断点

如何使用VSCode / PHP XDebug / PHP Debug Extension正确设置VSCode和Wampserver以在断点行上进行调试和暂停?