4 ms·
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 begi
by eudox 10y ago
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.