首页 > 解决方案 > 在 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++visual-studio-codevscode-debugger

解决方案


我觉得您的问题可能与此有关(您没有提供完整的平台信息):https ://github.com/microsoft/vscode-cpptools/issues/3829

LLDB 本身仍然有效,只是在 VS Code 中被破坏,但根据链接正在修复。

重新生成 launch.json 并尝试一下也是值得的。


推荐阅读