1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 12:03:41 +01:00

Handle register nums > 16 on x86_64

gcc generates them when using ms-abi. Support disabled by
default since it increases the cache footprint of the library.
This commit is contained in:
Arun Sharma 2011-06-18 20:16:13 -07:00
parent 7d43108f9c
commit e09f9701ff
4 changed files with 57 additions and 6 deletions

View file

@ -228,6 +228,15 @@ if test x$enable_conservative_checks = xyes; then
fi fi
AC_MSG_RESULT([$enable_conservative_checks]) AC_MSG_RESULT([$enable_conservative_checks])
AC_MSG_CHECKING([whether to enable msabi support])
AC_ARG_ENABLE(msabi_support,
[ --enable-msabi-support Enables support for Microsoft ABI extensions ],
[enable_msabi_support=$enableval], [enable_msabi_support=no])
if test x$enable_msabi_support = xyes; then
AC_DEFINE([CONFIG_MSABI_SUPPORT], [], [Support for Microsoft ABI extensions])
fi
AC_MSG_RESULT([$enable_msabi_support])
LIBUNWIND___THREAD LIBUNWIND___THREAD
AC_MSG_CHECKING([for Intel compiler]) AC_MSG_CHECKING([for Intel compiler])

View file

@ -32,6 +32,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
extern "C" { extern "C" {
#endif #endif
#include <config.h>
#include <sys/types.h> #include <sys/types.h>
#include <inttypes.h> #include <inttypes.h>
#include <ucontext.h> #include <ucontext.h>
@ -72,14 +73,33 @@ typedef enum
UNW_X86_64_R14, UNW_X86_64_R14,
UNW_X86_64_R15, UNW_X86_64_R15,
UNW_X86_64_RIP, UNW_X86_64_RIP,
#ifdef CONFIG_MSABI_SUPPORT
UNW_X86_64_XMM0,
UNW_X86_64_XMM1,
UNW_X86_64_XMM2,
UNW_X86_64_XMM3,
UNW_X86_64_XMM4,
UNW_X86_64_XMM5,
UNW_X86_64_XMM6,
UNW_X86_64_XMM7,
UNW_X86_64_XMM8,
UNW_X86_64_XMM9,
UNW_X86_64_XMM10,
UNW_X86_64_XMM11,
UNW_X86_64_XMM12,
UNW_X86_64_XMM13,
UNW_X86_64_XMM14,
UNW_X86_64_XMM15,
UNW_TDEP_LAST_REG = UNW_X86_64_XMM15,
#else
UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
#endif
/* XXX Add other regs here */ /* XXX Add other regs here */
/* frame info (read-only) */ /* frame info (read-only) */
UNW_X86_64_CFA, UNW_X86_64_CFA,
UNW_TDEP_LAST_REG = UNW_X86_64_RIP,
UNW_TDEP_IP = UNW_X86_64_RIP, UNW_TDEP_IP = UNW_X86_64_RIP,
UNW_TDEP_SP = UNW_X86_64_RSP, UNW_TDEP_SP = UNW_X86_64_RSP,
UNW_TDEP_BP = UNW_X86_64_RBP, UNW_TDEP_BP = UNW_X86_64_RBP,

View file

@ -32,9 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define dwarf_config_h #define dwarf_config_h
/* XXX need to verify if this value is correct */ /* XXX need to verify if this value is correct */
#ifdef CONFIG_MSABI_SUPPORT
#define DWARF_NUM_PRESERVED_REGS 33
#else
#define DWARF_NUM_PRESERVED_REGS 17 #define DWARF_NUM_PRESERVED_REGS 17
#endif
#define DWARF_REGNUM_MAP_LENGTH 17 #define DWARF_REGNUM_MAP_LENGTH DWARF_NUM_PRESERVED_REGS
/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ /* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */
#define dwarf_is_big_endian(addr_space) 0 #define dwarf_is_big_endian(addr_space) 0

View file

@ -33,7 +33,7 @@ HIDDEN int tdep_needs_initialization = 1;
/* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */ /* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */
HIDDEN uint8_t dwarf_to_unw_regnum_map[17] = HIDDEN uint8_t dwarf_to_unw_regnum_map[DWARF_NUM_PRESERVED_REGS] =
{ {
UNW_X86_64_RAX, UNW_X86_64_RAX,
UNW_X86_64_RDX, UNW_X86_64_RDX,
@ -51,7 +51,25 @@ HIDDEN uint8_t dwarf_to_unw_regnum_map[17] =
UNW_X86_64_R13, UNW_X86_64_R13,
UNW_X86_64_R14, UNW_X86_64_R14,
UNW_X86_64_R15, UNW_X86_64_R15,
UNW_X86_64_RIP UNW_X86_64_RIP,
#ifdef CONFIG_MSABI_SUPPORT
UNW_X86_64_XMM0,
UNW_X86_64_XMM1,
UNW_X86_64_XMM2,
UNW_X86_64_XMM3,
UNW_X86_64_XMM4,
UNW_X86_64_XMM5,
UNW_X86_64_XMM6,
UNW_X86_64_XMM7,
UNW_X86_64_XMM8,
UNW_X86_64_XMM9,
UNW_X86_64_XMM10,
UNW_X86_64_XMM11,
UNW_X86_64_XMM12,
UNW_X86_64_XMM13,
UNW_X86_64_XMM14,
UNW_X86_64_XMM15
#endif
}; };
HIDDEN void HIDDEN void