Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[CppCodeGen] Managed Exception Dispatch and Unwind #910
I suspect that you are not actually running the code using CoreRT - exception handling does not work yet with either RyuJIT or CppCodeGen.
Try following steps in Documentation\how-to-build-and-run-ilcompiler-in-visual-studio-2015.md or Documentation\how-to-build-and-run-ilcompiler-in-console-shell-prompt.md. The Visual Studio steps are more convenient for day to day development, just change the repro project to throw and catch exception to see the crash when you run the program.
The plan should be:
referenced this issue
Sep 15, 2017
I've been reading the Book of the Runtime section on stack walking and from what I can tell, in the JITed version, stack walking is implemented using a mapping of instruction pointer ranges to function definition metadata. Allowing the stack walker to unwind each frame by doing a lookup and then moving the stack pointer backwards (based on the size specified in the looked up metadata), repeatedly until it gets where it wants to.
This seems like the most performant solution to the problem, but while its possible to get the address of a function in C++, I don't see a (portable) way to get the address of the last instruction in a function. Is RIP mapping really a dead end or is there some kind of sentinel stack cookie way I'm overlooking.