diff --git a/include/libunwind-x86.h b/include/libunwind-x86.h index 38664f9a..1e321db1 100644 --- a/include/libunwind-x86.h +++ b/include/libunwind-x86.h @@ -48,7 +48,11 @@ extern "C" { typedef uint32_t unw_word_t; typedef int32_t unw_sword_t; -typedef long double unw_tdep_fpreg_t; +typedef union { + struct { uint8_t b[4]; } val32; + struct { uint8_t b[10]; } val80; + struct { uint8_t b[16]; } val128; +} unw_tdep_fpreg_t; typedef enum { @@ -131,7 +135,16 @@ typedef enum /* frame info (read-only) */ UNW_X86_CFA, - UNW_TDEP_LAST_REG = UNW_X86_LDT, + UNW_X86_XMM0, /* scratch */ + UNW_X86_XMM1, /* scratch */ + UNW_X86_XMM2, /* scratch */ + UNW_X86_XMM3, /* scratch */ + UNW_X86_XMM4, /* scratch */ + UNW_X86_XMM5, /* scratch */ + UNW_X86_XMM6, /* scratch */ + UNW_X86_XMM7, /* scratch */ + + UNW_TDEP_LAST_REG = UNW_X86_XMM7, UNW_TDEP_IP = UNW_X86_EIP, UNW_TDEP_SP = UNW_X86_CFA, diff --git a/src/x86/Gget_save_loc.c b/src/x86/Gget_save_loc.c index 1bd3560c..6e6f9dca 100644 --- a/src/x86/Gget_save_loc.c +++ b/src/x86/Gget_save_loc.c @@ -94,6 +94,14 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) case UNW_X86_XMM6_hi: case UNW_X86_XMM7_lo: case UNW_X86_XMM7_hi: + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: loc = x86_scratch_loc (c, reg); break; diff --git a/src/x86/Gregs.c b/src/x86/Gregs.c index 68afd376..78cfabcc 100644 --- a/src/x86/Gregs.c +++ b/src/x86/Gregs.c @@ -97,6 +97,17 @@ linux_scratch_loc (struct cursor *c, unw_regnum_t reg) is_fpstate = 1; off = LINUX_FPSTATE_XMM0_OFF + 8*(reg - UNW_X86_XMM0_lo); break; + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: + is_fpstate = 1; + off = LINUX_FPSTATE_XMM0_OFF + 16*(reg - UNW_X86_XMM0); + break; case UNW_X86_FOP: case UNW_X86_TSS: @@ -235,6 +246,14 @@ tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, case UNW_X86_ST6: case UNW_X86_ST7: /* SSE fp registers */ + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: case UNW_X86_XMM0_lo: case UNW_X86_XMM0_hi: case UNW_X86_XMM1_lo: diff --git a/src/x86/is_fpreg.c b/src/x86/is_fpreg.c index 6dc56402..8f1536d1 100644 --- a/src/x86/is_fpreg.c +++ b/src/x86/is_fpreg.c @@ -29,5 +29,6 @@ PROTECTED int unw_is_fpreg (int regnum) { return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7) - || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi)); + || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi) + || (regnum >= UNW_X86_XMM0 && regnum <= UNW_X86_XMM7)); } diff --git a/src/x86/regname.c b/src/x86/regname.c index 824e2135..2228510a 100644 --- a/src/x86/regname.c +++ b/src/x86/regname.c @@ -12,7 +12,9 @@ static const char *regname[] = "xmm6_lo", "xmm6_hi", "xmm7_lo", "xmm7_hi", "mxcsr", "gs", "fs", "es", "ds", "ss", "cs", - "tss", "ldt" + "tss", "ldt", + "cfi", + "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", }; PROTECTED const char *