GDB and Valgrind work quite well, see for example:
- https://hookrace.net/blog/what-makes-nim-practical/#debuggin...
- https://hookrace.net/blog/writing-an-async-logger-in-nim/#op...
Edit: You can of course also change the program itself, using echo and writeStackTrace to figure out what's going on.