【问题标题】:setup lldb debugging with cpp extension in vscode linux在 vscode linux 中使用 cpp 扩展设置 lldb 调试
【发布时间】:2020-09-20 10:37:43
【问题描述】:

我主要使用 gdb 来调试 vscode 中的 c++ 单个文件,但现在想尝试 lldb,但在为 vscode 设置它时遇到了问题。

我首先创建默认的launch.json表单调试选项卡,选择cpp gdb/lldb,然后选择clang++进行配置。

调试开始时..它显示以下错误:

然后在launch.json中我将miDebuggerPath路径形式/usr/bin/lldb-mi更改为/usr/bin/lldb

然后,当我启动调试器时,它什么也不做,只是在终端的顶部和以下几行中调试控件:

warning: ignoring unknown option: --interpreter=mi
warning: ignoring unknown option: --tty=/dev/pts/1

我在这里缺少什么?

我的整个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": "clang++ - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: clang++ build active file",
            "miDebuggerPath": "/usr/bin/lldb"
        }
    ]
}

【问题讨论】:

    标签: c++ visual-studio-code vscode-debugger


    【解决方案1】:

    lldb-mi 不是 LLDB 项目的一部分。见lists.llvm.org

    您仍然可以从项目的github repo 自己构建它。您需要先构建 LLDB/Clang/LLVM,因为lldb-micompilation 需要头文件和编译库,才能按照自述文件中所述的信息进行构建。

    【讨论】:

      猜你喜欢
      • 2022-07-12
      • 2018-11-03
      • 1970-01-01
      • 1970-01-01
      • 2017-08-31
      • 1970-01-01
      • 1970-01-01
      • 2023-02-26
      • 1970-01-01
      相关资源
      最近更新 更多