Open hhstore opened 2 years ago
zig + vscode debug 断点调试
的完整配置教程.关于如何配置 zig+zls+vscode, 请看此篇: #361
示例:
zig
build.zig
构建脚本修改:
dev@dev:~/D/i/b/ziglings-solutions|solutions✓
➤ zig build 15
Compiling 015_for.zig...
Checking 015_for.zig...
Zig Build Result: /xxx/ziglings-solutions/zig-cache/o/a9333ffcfddf7b471e7e17163202b638/015_for
PASSED:
vscode 配置:
.vscode/
添加: launch.json
, 内容如下:program
, 是 zig build
编译结果完整路径. (需要先编译 zig 项目代码, 再手动指定){
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug ex002",
// "program": "${workspaceFolder}/<executable file>",
"program": "${workspaceFolder}/zig-cache/o/61ece68b736d12a98d44010040aab147/002_std",
"args": [
"exercises/002_std.zig"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug ex015",
// "program": "${workspaceFolder}/<executable file>",
"program": "${workspaceFolder}/zig-cache/o/a9333ffcfddf7b471e7e17163202b638/015_for",
"args": [
"exercises/015_for.zig"
],
"cwd": "${workspaceFolder}"
}
]
}
截图效果:
全局变量/常量
. (修改此例)1
1
1
1
1
related: