【问题标题】:Visual Studio Code debugger failing on (M1, 2020, macOS Monterey, ARM64) with C application使用 C 应用程序的 Visual Studio Code 调试器在(M1、2020、macOS Monterey、ARM64)上失败
【发布时间】:2022-01-23 18:45:37
【问题描述】:

我正在尝试在(M1,2020,macOS Monterey)上的 Visual Studio Code 中调试 C 程序,并在调试控制台中不断收到相同的错误。

"ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed ((os/kern) invalid argument)"

我的 launch.json 看起来像:

    "version": "0.2.0",
    "configurations": [
        {
            "name": "gcc - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: gcc build active file"
        }
    ]
}```

Any suggestions?

【问题讨论】:

    标签: c arm64 macos-monterey


    【解决方案1】:

    拿回来,解决了!

    必须将 VSC 的 launch.json 文件中的“type”字段更改为 -->“lldb”。

        // Use IntelliSense to learn about possible attributes.
        "version": "0.2.0",
        "configurations": [
            {
                "name": "gcc - Build and debug active file",
                "type": "lldb",
                "request": "launch",
                "program": "${fileDirname}/${fileBasenameNoExtension}",
                "args": [],
                "stopAtEntry": false,
                "cwd": "${fileDirname}",
                "environment": [],
                "externalConsole": false,
                "MIMode": "lldb",
                "preLaunchTask": "C/C++: gcc build active file"
            }
        ]
    }```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-12
      • 1970-01-01
      • 1970-01-01
      • 2022-09-23
      相关资源
      最近更新 更多