Hi, I’m a newbie in zig.
Today I attempted to debug a simple zig program in VSCode with CodeLLDB plugin, I got a empty list in the ‘Local’ node of variables tree after debugger running.
So, I directly ran the lldb command in the console to debug my program.
I got an error message from lldb when I print a variable:
“Could not find type system for language zig: TypeSystem for language zig doesn’t exist”
What’s wrong?
P.S:
zig version: 0.15.0-dev.643+dc6ffc28b
OS version: Ubuntu 25.04
lldb version: 20.1.2
Welcome to Ziggit @bagualing!
This sounds like a configuration issue with your editor. I can’t help with that directly, maybe someone else can. I think we’ll need more details of your setup though.
I replied to let you know that Zig has lldb pretty printers distributed with the source. I’ve found them to be fairly helpful for debugging Zig code.
Thank you for your reply.
I skipped use editor, just do all in terminal:
bgling@ubt:~/zprj$ pwd
/home/bgling/zprj
bgling@ubt:~/zprj$ mkdir demo2 && cd demo2
bgling@ubt:~/zprj/demo2$ zig init
info: created build.zig
info: created build.zig.zon
info: created src/main.zig
info: created src/root.zig
info: see `zig build --help` for a menu of options
bgling@ubt:~/zprj/demo2$ cd src
bgling@ubt:~/zprj/demo2/src$ cat > main.zig << 'EOF'
> const std = @import("std");
>
> pub fn main() !void {
> const a: i32 = 123;
> std.debug.print("{d}\n", .{a});
> }
> EOF
bgling@ubt:~/zprj/demo2/src$ cd ..
bgling@ubt:~/zprj/demo2$ zig build
bgling@ubt:~/zprj/demo2$ ./zig-out/bin/demo2
123
bgling@ubt:~/zprj/demo2$ lldb ./zig-out/bin/demo2
(lldb) target create "./zig-out/bin/demo2"
Current executable set to '/home/bgling/zprj/demo2/zig-out/bin/demo2' (x86_64).
(lldb) b main.main
Breakpoint 1: where = demo2`main.main + 8, address = 0x000000000115284b
(lldb) r
Process 19543 launched: '/home/bgling/zprj/demo2/zig-out/bin/demo2' (x86_64)
Process 19543 stopped
* thread #1, name = 'demo2', stop reason = breakpoint 1.1
frame #0: 0x000000000115284b demo2`main.main at main.zig:5:20
2
3 pub fn main() !void {
4 const a: i32 = 123;
-> 5 std.debug.print("{d}\n", .{a});
6 }
warning: This version of LLDB has no plugin for the language "zig". Inspection of frame variables will be limited.
(lldb) p a
error: Could not find type system for language zig: TypeSystem for language zig doesn't exist
(lldb) q
Quitting LLDB will kill one or more processes. Do you really want to proceed: [Y/n] y
1 Like
warning: This version of LLDB has no plugin for the language “zig”. Inspection of frame variables will be limited.
According to the above warning message, should I need to install a zig plugin in LLDB? However, I didn’t search for any useful information online.
are you using the custom backend, cause that needs a fork of lldb to work
the custom backend is default in debug mode on master zig, which you appear to be using
try using -fllvm
or .use_llvm = true
2 Likes
Ooh, Subconsciously, I always thought that Zig used llvm as the backend by default.
Thank you very much!
it did/still does, the custom backend was enabled by default for debug builds less than a month ago on master
2 Likes