I’ve recently installed the latest Zig master version (0.15.0-dev.1092+d772c0627), and I’m having trouble getting debugging to work properly with CodeLLDB in VSCode.
When I run a debug session using command-line lldb, it shows assembly code instead of the Zig source. I suspect this is due to the self-hosted x86 backend now being the default in Zig 0.15.
Reference: Can’t print local variables when debug with lldb
I was able to get source-level debugging to work on the command line by explicitly setting:
exe.use_llvm = true;
However, CodeLLDB still does not stop at breakpoints.
With Zig 0.14.0, everything works as expected with the same project setup.
Is this a known issue? Is there any extra configuration needed for Zig 0.15 + CodeLLDB to work correctly?
I used the old version zls (0.13).
I updated zls to latest version.
So I can debug by the code-lldb.
Of course, It still requires setting ExecutableOptions.use_llvm = true.
Anybody know why that is? I really hope that’s just a temporary thing and Zig’s non-llvm backends will work with regular debuggers, and a special debugger is only needed for things like debugging comptime code.
I think the reason it is a fork instead of a type system plugin, the next step up from pretty printers, is so it can support language features that lldbs type systems cant implement.
I definitely see stuff for bit sizes/fields.
Some stuff about type values? I don’t think that’s what it sounds like.
Probably some other stuff.
That’s nice, but not required.
I think the reason its required is there is a custom DWARF parser for zig, the custom backend must be outputting debug info that normal lldb can’t use.
There is also some stuff for tls.