Aleod
September 11, 2026, 8:17pm
1
Hello, I’m trying to figure out how to setup debugging for zig and I cannot figure out how to get it to work.
For the record I’m not very familiar with the whole debugging. Was too lazy and print debugging kinda worked.
Now I’ve tried lldb with the pretty printers and I cannot inspect variables but I can step through the program and see the source code.
With gdb I can somewhat inspect the variables, globals it seems and a few things , but not very much. And the stepping is very broken.
Am I unaware of the options to set for the compiler or isn’t release mode Debug enough?
Ps: I’m also on nixos if that can mess anything.
Also been lurking here for a while and it’s my first post
MeKaLu
September 11, 2026, 8:22pm
2
My goto debugger on linux is nnd . It is a TUI debugger and works very well with zig.
You can also try to use LLVM -fllvm which might help
1 Like
Aleod
September 11, 2026, 8:48pm
3
Hum I think I tried that but didn’t know what to give it to and tried to pass it as a cli argument to zig build . Its to the build-exe or the compile step you have to set it.
Thx for the help.
1 Like
MeKaLu
September 11, 2026, 9:52pm
4
Yeah sorry I was not specific on how to use that. Glad that you figured it out
Aleod
September 11, 2026, 10:05pm
5
Yeah no worries I’m familiar with zig but what is needed for debugging not so much. So once I knew I needed that I knew where to look.
Anyways thanks that helped me solve a nasty off by one in my parser xD
1 Like