[LLVMdev] One way to support unwind on x86

Anton Korobeynikov anton at korobeynikov.info
Tue Mar 3 11:35:01 PST 2009


Hello,

> still don't see the complexities in stack unwinding: Restore caller
> registers, remove the frame, lookup next frame, etc.
This is not enough for C++, for example. You would need to run  
destructors, be able to propagate exception object upper, do a type- 
based catch, etc.
You might want to read http://www.codesourcery.com/public/cxx-abi/abi-eh.html
Also, studying libgcc unwinding runtime and different personality  
functions is a good start.

> It would be nice with a suite of test cases that use invoke/unwind in
> various situations (complex stack frames, simple stack frames, unwind
> as the first thing/last thing/middle of function, unwind few/many
> frames, etc.) I can run this suite to see if and where my runtime
> fails. I'm not sure such a thing exists?
gcc testsuite has some amount of such tests.

---
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-dev mailing list