CodeLLDB doesn't stop at breakpoints with Zig 0.15 (master)

Hi everyone,

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?

Environment
OS: MacOS Ventura 13.6.9
Zig: 0.15.0-dev.1092+d772c0627
VSCode: Version: 1.102.0
CodeLLDB: 1.11.5

Thanks in advance!

If you’re on Apple silicon it’s probably this:

2 Likes

Thank you for you response.
My machine is x86-64 CPU, but this issue might not depend on the CPU.

its probably the custom x86_64 backend, it requires a fork of lldb to debug it. or forcing zig to use llvm as you have discovered

1 Like

looks like codelldb might be able to use the fork

1 Like

I’ve resolved this issue.

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.

Environment:

  • Zig: 0.16.0-dev.218+1872c85ac
  • VsCode: Version: 1.103.2
  • CodeLLDB: 1.11.5

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 assume it is temporary.

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.

1 Like