So apparently Apple messed up the register numbering, or at least chose to be different:
https://reviews.llvm.org/D22508 Fixes the exception handling regression tests on i386 with clang. ok? Index: lib/libunwind/include/libunwind.h =================================================================== RCS file: /cvs/src/lib/libunwind/include/libunwind.h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 libunwind.h --- lib/libunwind/include/libunwind.h 3 Sep 2016 18:42:12 -0000 1.1.1.1 +++ lib/libunwind/include/libunwind.h 2 Aug 2017 18:42:08 -0000 @@ -151,8 +151,13 @@ enum { UNW_X86_ECX = 1, UNW_X86_EDX = 2, UNW_X86_EBX = 3, +#ifdef __OpenBSD__ + UNW_X86_ESP = 4, + UNW_X86_EBP = 5, +#else UNW_X86_EBP = 4, UNW_X86_ESP = 5, +#endif UNW_X86_ESI = 6, UNW_X86_EDI = 7 };
