无法在 vscode 上调试收到此消息:无法开始调试。 LLDB 意外退出,退出代码为 134 (0x86)

问题描述 投票:0回答:2

我使用的是旧的 2015 年 MacBook Air 版本 10.13.6 vs code 版本:1.74.0(通用) 扩展:C/C++、代码运行器 我正在学习 C++,这是我正在尝试测试的基本代码,看看我的 vscode 是否适合使用 我在 C++Projects 文件夹中执行此操作,文件名为 helloworld.cpp

#include <iostream>
using namespace std;
int main() {
    cout << "Hello World!";
    return 0;
}

当我运行我的文件时,它说构建已成功完成。 但之后却说无法开始调试

这是我弹出的其他文件

launch.json :

"configurations": [
        {
            "name": "C/C++: clang++ build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: clang++ build active file"
          }
    ]

tasks.json:

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ build active file",
            "command": "/usr/bin/clang++",
            "args": [
                "-fcolor-diagnostics",
                "-fansi-escape-codes",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

请帮助我一直在寻找这方面的答案,但似乎找不到任何答案。非常感谢!

检查是否安装了 clang。是的 更改了任务和启动文件

visual-c++ visual-studio-debugging visual-studio-code-server
2个回答
1
投票

使用以下配置安装 VS Code 扩展“code lldb”:

{
        "name": "clang++ - Build and debug active file",
        "type": "lldb",
        "request": "launch",
        "program": "${fileDirname}/${fileBasenameNoExtension}",
        "args": [],
        "cwd": "${workspaceFolder}",
        "preLaunchTask": "C/C++: clang++ build active file" //<-- your build task name 
}

-1
投票

我也有同样的问题,在新Mac(2018)上可以正常工作,但在旧Mac上,问题无法解决。

© www.soinside.com 2019 - 2024. All rights reserved.