#When debugging variable is optimized away and not available
1 messages · Page 1 of 1 (latest)
are they consts?
Yup, same thing happens with parameters.
Or other global variables sometimes.
Not 100% sure in all cases though.
consts can probably be fixed by making them var and discarding the mutability with _ = &myvar;
is it all parameters or just parameters holding structs? if it's just structs, making them *const Struct might fix them
there's still stuff missing from zig debug info, it's slowly getting worked on
If I have to change the code, that defeats the point of debugging because I can't just step through my program, I have to change the code and recompile, and get back to that state before recompiling.
Do others just not use the debugger?
Maybe I'm missing something, because I thought that's what everyone is doing.
debug info might be better on linux
if you're on windows you can try using wsl and see if there's an improvement
I don't use a debugger so I don't know why I'm answering this, someone else probably has more information
Okay so there are a few issues I've found all about debugging:
https://github.com/ziglang/zig/issues/16529
https://github.com/ziglang/zig/issues/15095
https://github.com/ziglang/zig/issues/20259
https://github.com/ziglang/zig/issues/20258