well I did something in that direction on a branch. I have a problem with the nim compiler to crash here and there. How do I enable debug information again in the compiler? And why is is such a hassle in nim to get debug information? Debug builds should have them.
I have a stack trace, but unfortunately the bug non deterministic, and since I can't inspect anything with gdb, yea I don't know what to do.
Hint: used config file '/home/arne/proj/nim/Nim/config/nim.cfg' [Conf]
Hint: used config file '/home/arne/.config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: scratch [Processing]
Traceback (most recent call last)
/home/arne/proj/nim/Nim/compiler/nim.nim(121) nim
/home/arne/proj/nim/Nim/compiler/nim.nim(77) handleCmdLine
/home/arne/proj/nim/Nim/compiler/main.nim(163) mainCommand
/home/arne/proj/nim/Nim/compiler/main.nim(75) commandCompileToC
/home/arne/proj/nim/Nim/compiler/cgen.nim(1429) cgenWriteModules
/home/arne/proj/nim/Nim/compiler/cgen.nim(1357) writeModule
/home/arne/proj/nim/Nim/compiler/cgen.nim(1130) genModule
/home/arne/proj/nim/Nim/compiler/cgen.nim(885) getFileHeader
/home/arne/proj/nim/Nim/compiler/cgen.nim(882) getCopyright
/home/arne/proj/nim/Nim/compiler/extccomp.nim(578) getCompileCFileCmd
/home/arne/proj/nim/Nim/lib/system/gc.nim(488) newObjNoInit
/home/arne/proj/nim/Nim/lib/system/alloc.nim(561) rawAlloc
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
If I understood your question correctly, you want to build a compiler with debugging info?
# this generate an additional compiler with debuging info
# and all checks enabled that will run quite a bit slower.
./koch temp --debugger:native
# run nim file with this debug compiler
nim_temp c -r --debugger:native --verbosity:3 (additional args) nimfile.nim