- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 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"
]
}
]
}
谢谢
最佳答案
这可能是“justMyCode”配置选项的结果,因为它默认为 true。
虽然提供者的描述是“...仅对用户编写的代码进行调试。设置为 False 还可以启用对标准库函数的调试。”,我认为他们的意思是站点包中的任何内容对于当前的python环境不会调试。
我想调试 Django 堆栈以确定源 self 的代码的异常在何处被吞噬而不浮出水面,因此我对 VSCode 调试器的启动配置执行了此操作:
{
// 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": "Control Center",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": [
"runserver",
"--noreload"
],
"justMyCode": false, // I want to debug through Django framework code sometimes
"django": true
}
]
}
我一这样做,调试器就删除了“未验证断点”消息,并允许我调试我正在处理的虚拟环境的站点包中的文件,其中包含 Django。
我应该注意到,调试器的断点部分给了我关于为什么断点未被验证以及对启动配置进行哪些调整的提示:
另外一个注意事项:“--noreload”参数也很重要。在使用 Flask 调试不同的应用程序时,调试器不会在任何断点处停止,直到我将它添加到启动配置中。
关于python - 调试期间 VSCode python 'Unverified breakpoint'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50601935/
使用Eclipse PDT和Xdebug调试PHP应用程序的当前状态是什么。有没有人最终使它工作,即停止在Eclipse中定义的断点(不使用xdebug_break())? 我读过this over
我想用 lldb 设置一个条件断点。这通常使用 -c 完成选项 : breakpoint set -f myFile.cpp -l 123 -c 'a==3' 但是,就我而言,我想测试是否 std::
The breakpoints do not hit, not even one断点没有命中,甚至一个都没有 I have tried:我尝试过: Restarting U
我有一个基于VSCode上运行的electron-hello-world项目的基本HelloWorld应用程序,能够启动调试 session ,并且该应用程序可以正常启动。 我在main.js上设置了
我只是无法理解 Eclipse 中菜单的 Run 按钮下的两个选项。通常断点不是指一行吗?我意识到可能存在这种情况: if (x >= 0 && x = 0 && y < 4) source
我正在 Visual Studio 代码中使用 chrome 调试器扩展来调试我的主干应用程序。 launch.json文件是这样的; { "version": "0.2.0", "c
最近,Edge 脚本调试支持已添加到 Visual Studio,这使您可以在附加 VS 调试器的情况下启动 Edge。所以我正是这样做的,并在启用脚本调试的情况下开始了我的解决方案: 唉,当我开始这
从帮助文档中,设置数据访问断点,我们可以使用 var.break /READWRITE 但是,这只有在我们输入该变量的上下文时才有效。 因为我想写一个PRACTICE脚本来做自动调试,所以我想在程序
模式.txt ^[\s]*set breakpoint.*if ^[\s]*set breakpoint.*in ^[\s]*set breakpoint.*skip 脚本.txt set break
我在哪里可以找到有关移动和桌面屏幕尺寸的统计信息? 我正在制作一个响应式网站,特别是我试图找出的天气是大多数手机与台式机和平板电脑用户之间的大小差距,我可以在其中设置断点。我认为应该有,但我知道我应该
在开放的互联网上找到答案应该非常简单,但显然不是。你如何在 spyder (anaconda) 中设置条件断点? 例如这里是代码的一小部分: if elem.name == "p":
一直在使用 Pycharm 编写服务器。 我有一些使用 Python 中的“unittest”库的单元测试。 我只是在运行测试,一切都很好,我可以在代码的任何地方设置断点。 昨天我开始通过调试器运行服
我正在使用一些定义了两个断点的响应式设计: Mobile > max-width 320px Tablet portrait > max-width 767px 在桌面上,我有很多动画 + Javas
是否有可能安装 ipdb(或一些其他明确编写的包)将导致 breakpoint() 运行 ipdb pdb 没有绑定(bind) sys.breakpointhook() 到 ipdb? https:
有没有一种优雅的方法可以在容器的高度上设置各种断点。 示例: 假设您有一个 div,最小高度设置为 100px。一旦内容太多,它不仅会增长,还会增长 100px,当内容最终到达 200px 的底部时,
使用分段包创建分段线性回归我在尝试设置自己的断点时看到错误;似乎只有当我尝试设置两个以上时。 (编辑)这是我正在使用的代码: # data bullard <- structure(list(Rt =
在互联网上很难找到关于此的信息,因为神奇的单词“GameShark”,“ Action 重播”,“内存编辑器”和“内存培训师”触发了很多BS,所以我认为我应该在某个论坛上提问。 我将在本周末前得到任天
我目前正在研究调试器。我读到调试器有软件断点(apparently 这些是最常用的断点)。这些通过将操作码的第一个字节替换为 Int 3(操作码 0xcc)来工作。 我已经读过程序的文本(/code)
在 Chrome 开发者工具中,在一个 JavaScript 文件中添加两个断点并执行整个代码后,有没有办法测量它们之间耗时? 最佳答案 您可以使用 time and timeEnd methods用
根据内存中的值在lldb中设置条件断点的语法是什么? 就像是: breakpoint modify -c "memory read -Gx $esp+4 == 0" 或者,如果条件为假,我想我可以设置
我是一名优秀的程序员,十分优秀!