timotheecour / Nim

Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
http://nim-lang.org/
Other
2 stars 0 forks source link

docs: add debugging page describing various flags / strategies to help debugging compiler or a program #785

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

lots of debugging tools can help understand and debugging the compiler or other programs:

stacktraces

misc

print data structures

instrument compiler

tracing

links

juancarlospaco commented 3 years ago

repr for stuff without $

--experimental:strictFuncs can help to find unwanted mutations.

-d:stressOrc ?.

-d:danger for JavaScript targets, because in debug mode, it contains too much noise for run-time checking.

{.exportc.} to skip name manglings of symbols, for debug only.

Styled debug messages to paint bugs red

jsAssert for JS-native assert

Debugger to set debug breakpoints

Temporarily mark symbols with {.deprecated.} to see where is used on the code base.

--expandArc

--expandMacro

not nil may help with read-from-nil bugs.

{.explain.}

Using stricter types, at least temporarily.