xmake-io / xmake-vscode

🍩 A XMake integration in Visual Studio Code
https://xmake.io
Apache License 2.0
228 stars 55 forks source link

VSCode 无法使用 CodeLLDB 调试程序 #159

Closed atship closed 1 year ago

atship commented 1 year ago

Xmake 版本

v2.7.5+dev.d3fc1bb51

操作系统版本和架构

Windows 10 64位 家庭中文版 19044.2364

描述问题

VSCode 版本:1.74.2 xmake-vscode 版本:1.9.2 llvm 版本:15.0.6 x86 版本 我的工程使用了 llvm 工具链,vscode 安装了 CodeLLDB 和 clangd 插件,卸载了微软的 c++ 插件,因为它和 clangd 冲突 我的 launch.json 文件

{
    "version": "0.2.0",
    "configurations": [
    {
        "name": "XMake Debug",
        "type": "xmake",
        "request": "launch",
        "target": "game",
        "stopAtEntry": true
    }
    ]
}

点击 F5 启动调试的时候,提示让我安装 "cppvsdbg" 插件 点击状态栏的 debug 的时候,提示 Visual Studio 实时调试器启动失败 无论我将工程架构改成 x86 还是 x64 都是同样的结果

期待的结果

点击 F5 启动调试的时候,没有安装 cppvsdgb 的话,应该会启动 CodeLLDB 来调试吧?我看插件 xmake-vscode 首次启动的时候提示我安装 cppvsdgb 或者 CodeLLDB,因为我的 toolchain 用的 llvm ,所以选择了 CodeLLDB

工程配置

No response

附加信息和错误日志

No response

waruqi commented 1 year ago

CodeLLDB 之前可以,现在我这里也不行,这应该是 codelldb 的问题,你可以到 codelldb 那边提 issues ,或者改用 cpptools

A2va commented 1 year ago

Something that is worth adding, if you create a launch.json configurations, the F5 keybinding will take the target selected in the status bar (This is a behavior that can be changed once the launch debug is stabilized). For debugging with your launch.json, you need to click on Run then Debug, or in the Debug Panel next to your current debug configuration.

Also, for debug with codelldb you need to set xmake.debugConfigType config to codelldb.

Translated: 值得补充的是,如果你创建了一个launch.json配置,F5键绑定将采取状态栏中选择的目标(这是一个行为,可以在启动调试稳定后改变)。对于用你的launch.json进行调试,你需要点击运行然后调试,或者在调试面板上点击你当前的调试配置旁边。

另外,为了用codelldb进行调试,你需要将xmake.debugConfigType配置为codelldb

atship commented 1 year ago

另外,为了用codelldb进行调试,你需要将xmake.debugConfigType配置为codelldb。

没错,我设置了这个标志以后就可以了,只是这个配置项没有任何文档说明,是从源代码找到的