[LLVMdev] x86 unwind support[MESSAGE NOT SCANNED]

Kenneth Uildriks
Mon, 20 Jul 2009 13:39:59 -0000

>
> Let's go back a bit.  Your claim is that there is no need to unwind
> frame-by-frame, an unwind simply needs to make a single jump to an
> invoke instruction and restore the context (which in x86 is just 6
> registers).  (This is, more or less, what longjmp() does.)  Duncan Sands
> explained to you why that wouldn't work, saying "if you throw an
> exception using your proposed unwind implementation, then it wouldn't
> be caught by dwarf catch/cleanup regions".
>
> He's right.  You can't just jump to the invoke instruction, you
must
> also pop any cleanups.  This is nothing to do with C++, and it has
> nothing to do with whether a language has stack-allocated objects.
>
> Andrew.

But don't all functions that require cleanups issue invokes rather
than calls?  Unwind or __cxa_throw would just go to the nearest one,
no?