/* Supported register note sections. */
static struct core_regset_section i386_linux_regset_sections[] =
{
- { ".reg", 144, "general-purpose" },
+ { ".reg", 68, "general-purpose" },
{ ".reg2", 108, "floating-point" },
{ NULL, 0 }
};
static struct core_regset_section i386_linux_sse_regset_sections[] =
{
- { ".reg", 144, "general-purpose" },
+ { ".reg", 68, "general-purpose" },
{ ".reg-xfp", 512, "extended floating-point" },
{ NULL, 0 }
};
static struct core_regset_section i386_linux_avx_regset_sections[] =
{
- { ".reg", 144, "general-purpose" },
+ { ".reg", 68, "general-purpose" },
{ ".reg-xstate", I386_XSTATE_MAX_SIZE, "XSAVE extended state" },
{ NULL, 0 }
};
format and GDB's register cache layout. */
/* From <sys/reg.h>. */
-static int i386_linux_gregset_reg_offset[] =
+int i386_linux_gregset_reg_offset[] =
{
6 * 4, /* %eax */
1 * 4, /* %ecx */
}
}
else
- xcr0 = I386_XSTATE_SSE_MASK;
+ xcr0 = 0;
return xcr0;
}
struct target_ops *target,
bfd *abfd)
{
- asection *section = bfd_get_section_by_name (abfd, ".reg2");
- uint64_t xcr0;
-
- if (section == NULL)
- return NULL;
-
- section = bfd_get_section_by_name (abfd, ".reg-xfp");
- if (section == NULL)
- return tdesc_i386_mmx_linux;
-
/* Linux/i386. */
- xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd);
- if ((xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK)
- return tdesc_i386_avx_linux;
- else
+ uint64_t xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd);
+ switch ((xcr0 & I386_XSTATE_AVX_MASK))
+ {
+ case I386_XSTATE_AVX_MASK:
+ return tdesc_i386_avx_linux;
+ case I386_XSTATE_SSE_MASK:
+ return tdesc_i386_linux;
+ case I386_XSTATE_X87_MASK:
+ return tdesc_i386_mmx_linux;
+ default:
+ break;
+ }
+
+ if (bfd_get_section_by_name (abfd, ".reg-xfp") != NULL)
return tdesc_i386_linux;
+ else
+ return tdesc_i386_mmx_linux;
}
static void