u/barrowburnerin r/Zig • Recommends
On “Zig, VSCode debugging, and Linux”
I'm using `gdb` and it works great. Takes a bit to get used to if you're not at home in text user interfaces, but it's incrediby powerful. Seriously, compared to graphical debugging front-ends, this is like escaping the matrix.
compile with `zig build`, optionally with an `@breakpoint()`, and then enter `gdb`:
```
$ gdb /path/to/executable
```
or
```
$ gdb --tui /path/to/executable
```
If you don't include a breakpoint in source, then when you start the program in gdb, it'll ask you if you want to add temporary breakpoint to `main()`.
The `tui` displays code lines in a text window above your CLI. It is a bit glitchy, but if the display glitches out on you, use `ctrl + l` to reset it and c…