3 ms·
Dinosaur here. The VAX architecture had call stack as well as exception handling essentially implemented in silicon: there was a place for an exception handler
by m3047 4y ago
Dinosaur here. The VAX architecture had call stack as well as exception handling essentially implemented in silicon: there was a place for an exception handler in each call frame (at least that's how the kernel implemented it for VMS).
It would go up the stack looking for a handler, call it, and then return to executing code where the exception was thrown; or at least that was an option. (Some page faults were handled this way.)
I've looked for this in a language implementation ever since, in vain. Why isn't "I fixed it, try again" ever an option?
(And I consider myself a C programmer, not a C++ programmer, although I acknowledge that most C compilers these days are really C++ compilers.)
- jasomill 4y agoThe Common Lisp condition system[1] supports this. [1] https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node312.html https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node312.html
- jasomill 4y agoAs a more direct analogue of your VMS example, Windows provides system-level support for handling exceptions without unwinding the stack. Here's an example of page fault handling, using Microsoft C/C++ compiler extensions to access Windows' built-in exception handling, https://docs.microsoft.com/en-us/windows/win32/memory/reserving-and-committing-memory#code-try-0 https://docs.microsoft.com/en-us/windows/win32/memory/reserv...