I use GDB to debug my Nim code, but by default Nim doesn't output enough
information to be usable. I pass --debuginfo --linedir:on
to the nim command
to fix that.
There is some name mangling, but in most cases things are still understandable.
proc
s have an integer appended to the name, so when setting a breakpoint is
done like this: b foo_431313
. It's also possible to just line number for
breakpoints, which is exactly as you might expect: b mymodule.nim:321
.
Inspecting strings is a bit of work, you have to do print str->data
. Seqs are
the same, the contents can be found at print myseq->data[n]
.
GDB shows you each line as it executes it, so it's easy to tell where in the code you are.