我在一个使用VSCode和Python扩展的Python多线程项目中工作。 一切都正常工作,直到突然(我没有更改任何设置),它停止显示调用堆栈中正在运行的进程和线程。调用堆栈现在是空的,直到它在断点上停止
这只适用于Python。对于C++,例如,它工作,如下面的图像:
以下是我的配置文件:
settings.json:
{
"python.pythonPath": "C:\\Users\\tiago\\AppData\\Local\\Programs\\Python\\Python38\\python.exe",
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.pylamaEnabled": false,
"python.linting.flake8Enabled": true
}
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}",
"console": "externalTerminal"
}
]
}
之所以发生这种情况,是因为我将“GEVENT\u SUPPORT”环境变量设置为True,并且as @fabioz said,“在GEVENT模式下,调试器希望线程模块由GEVENT进行猴子补丁,因此它不会跟踪这些模块(在GEVENT模式下,您只需要有一个主线程)。”
相关问题 更多 >
编程相关推荐