For historical reasons i386 has ebp and esp swapped in the eh_frame
register numbering on at least Darwin. That is:
Darwin FreeBSD
Reg # eh_frame eh_frame DWARF
===== ======== ======== =====
4 ebp esp esp
5 esp ebp ebp
Although the UNW_X86_* constants are not intended to be coupled with
DWARF / eh_frame numbering they are currently conflated in libunwind.
Differential Revision: https://reviews.llvm.org/D22508
llvm-svn: 280099
UNW_X86_ECX = 1,
UNW_X86_EDX = 2,
UNW_X86_EBX = 3,
+#ifdef __FreeBSD__
+ 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
};