-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print return stack on overflow #38
Comments
I poked around to see if I can make a proper implementation of this, but it's not trivial: the symbol table does not from survive compilation to run time, so there is no info available to generate a friendly stack trace at the time of the overflow. I can make this work, but that will require keeping information around for longer then I'd like. Not sure of that is worth the effort at this time. Any ideas on this? |
Hi @Varriount, I got a reasonable implementation for collecting and dumping a backtraces happening at NPeg parse time; its a available in the The current implementation runs the parse fucntion in a Ideally I would like to augment the original Nim stacktrace with the NPeg stackframes instead of just printing the trace, but I'm not sure if the current Nim infrastructure allows for this; NPeg would have to prepend its own backtrace to the Exceptions Example:
Output:
The last 5 lines show the NPeg part of the stacktrace including the regular lineInfo, with the NPeg rule appended for more clarity. |
let's see of nim-lang/Nim#20772 gets through, that will allow NPeg stack frames to go on the native Nim exception stack trace. |
For now, enable printing the stack trace with |
When NPeg throws a depth error due to an overflow in the return stack, it would be nice to have the exception contain a printout of the stack.
Something like
Rather than just
The text was updated successfully, but these errors were encountered: