Re:Nim Programming Language 0.14.0 released
by eudox on Wednesday June 08, 2016 @09:47AM
(#11862226)
Aside from using GCC's debugging information, you can emit code that creates its own debugging information in some run-time structure.
For example, at the beginning of each function call, you insert a function call that pushes a new stack frame into some global stack, and store the function's arguments. Then, just before every return from the function, you pop the stack frame. When the program crashes, you write the stack to a JSON file, and use a language-specific debugger to view it.
For example, at the beginning of each function call, you insert a function call that pushes a new stack frame into some global stack, and store the function's arguments. Then, just before every return from the function, you pop the stack frame. When the program crashes, you write the stack to a JSON file, and use a language-specific debugger to view it.