c++ - 在 Visual Studio Code C++ 调试器中设置断点时出错
问题描述
直到上周,我才能够在 VSCode 中的 C++ 代码中设置断点。由于前两天我尝试将调试器附加到远程进程,断点灰显。
将鼠标指针置于灰色断点上时,消息显示:
设置断点错误。调试引擎抛出异常。
,如下图所示:
我的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": "prgAttach",
"type": "cppdbg",
"request": "attach",
"program": "~/JBL/SC-253/bin/azg",
"processId": "${command:pickProcess}",
"MIMode": "lldb"
},
//Followed by other debug configurations...
]
}
我从 Code > About Visual Studio Code 获得的平台信息是:
Version: 1.41.1
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:57:51.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 18.7.0
还有其他熟悉这个问题的人吗?有什么建议/解决方法吗?
我有:
- 尝试卸载 C/C++ 扩展并重新安装它们。没有效果。
- 验证我附加到正确的过程。
- 也重新启动了该过程,以进行新的附加。
解决方案
我觉得您的问题可能与此有关(您没有提供完整的平台信息):https ://github.com/microsoft/vscode-cpptools/issues/3829
LLDB 本身仍然有效,只是在 VS Code 中被破坏,但根据链接正在修复。
重新生成 launch.json 并尝试一下也是值得的。
推荐阅读
- spring - 删除弹性搜索响应中 doc_count 为零的存储桶
- javascript - 如何在 phpMyAdmin 的世界地图上显示人口统计数据?
- mongodb - 在 Handlebars 304 错误中嵌套 {{#each}}
- reactjs - 当我单击仪表板中的菜单时,React 路由器显示空白页面
- java - 为什么直接同步一个 ArrayList 可以确保它对其他线程的可见性
- c# - 使用 C# 的类型(反射)是不好的做法吗?
- windows - 使用 PowerShell 创建 Windows 计划任务时停止现有实例选项
- python - 如何在 Python 中模拟一系列用户输入
- mariadb - MariaDB 的默认端口号是多少?
- html - 一个小小的 CSS 边距问题