VS 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
VS 插件版本:
ms-vscode.cmake-tools:1.3.0
ms-vscode.cpptools: 0.26.3
編譯工具:
clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
lldb --version
lldb-1000.11.38.2
Swift-4.2
cmake --version
cmake version 3.16.3
Mac OS 版本
10.14.6
對於如下的launch.json,debug的時候可能會掛起,表現爲點vscode的任何調試相關按鈕都沒反應,打印變量也毫無反應,只能結束調試,CPU在lldb-mi進程上的使用率會超過100%,看日誌是掛在create var上面。日誌是這樣:
1: (2550) <-1035-var-create - * "desc"
{
// 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": "(lldb) 啓動",
"type": "cppdbg",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
//"program":"/Users/admin/Downloads/trojan-1.14.1/build/trojan",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"logging": {
"trace": true
,"traceResponse": true
,"engineLogging": true
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
,"miDebuggerPath":"/Users/admin/.vscode/extensions/ms-vscode.cpptools-0.26.3/debugAdapters/lldb/bin/lldb-mi"
}
]
}
解決
辦法是把上面文件的其中一個屬性改成
”MIMode“:"lldb"