I wanted to gain in-depth understanding of how programming languages implements exception handling and how exactly it works inside the hood. I have try to phrase this in many sub-questions as below.

  1. What is the mechanism used by programing languages to implement try { } catch { } blocks (under the hood)?
  2. How exactly stack unwinding works inside?
  3. What are the key differences between try { } / catch {} implementations between different languages like C++ and Java? Do they offer differ significantly or are they same?
  4. Is setjump/longjump method of stack rewinding in C is similar to try/throw/catch block?
  5. Why do people say that "stack unwinding" is costly?
  6. What exactly is SEH (Structured Exception Handling?)
Edit
Report