Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
libunwind: fix X86 register numbers for FreeBSD/i386
Browse files Browse the repository at this point in the history
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


git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@280099 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
emaste committed Aug 30, 2016
1 parent 17473fd commit 85e3961
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/libunwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 85e3961

Please sign in to comment.