From: Ed Maste Date: Tue, 30 Aug 2016 15:10:08 +0000 (+0000) Subject: libunwind: fix X86 register numbers for FreeBSD/i386 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0abba5c329a4a8c8349c8945cf31ba5e9fe4675;p=platform%2Fupstream%2Fllvm.git libunwind: fix X86 register numbers for FreeBSD/i386 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 --- diff --git a/libunwind/include/libunwind.h b/libunwind/include/libunwind.h index bda561a..3233bfb 100644 --- a/libunwind/include/libunwind.h +++ b/libunwind/include/libunwind.h @@ -151,8 +151,13 @@ enum { 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 };