/* Target-dependent code for GNU/Linux x86-64.
- Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
/* Supported register note sections. */
static struct core_regset_section amd64_linux_regset_sections[] =
{
- { ".reg", 144, "general-purpose" },
+ { ".reg", 27 * 8, "general-purpose" },
{ ".reg2", 512, "floating-point" },
{ ".reg-xstate", I386_XSTATE_MAX_SIZE, "XSAVE extended state" },
{ NULL, 0 }
format and GDB's register cache layout. */
/* From <sys/reg.h>. */
-static int amd64_linux_gregset_reg_offset[] =
+int amd64_linux_gregset_reg_offset[] =
{
10 * 8, /* %rax */
5 * 8, /* %rbx */
14 * 8, /* %rdi */
4 * 8, /* %rbp */
19 * 8, /* %rsp */
- 9 * 8, /* %r8 ... */
+ 9 * 8, /* %r8 ... */
8 * 8,
7 * 8,
6 * 8,
struct target_ops *target,
bfd *abfd)
{
- asection *section = bfd_get_section_by_name (abfd, ".reg2");
- uint64_t xcr0;
-
- if (section == NULL)
- return NULL;
-
/* Linux/x86-64. */
- xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd);
- if ((xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK)
- return tdesc_amd64_avx_linux;
- else
- return tdesc_amd64_linux;
+ uint64_t xcr0 = i386_linux_core_read_xcr0 (gdbarch, target, abfd);
+ switch ((xcr0 & I386_XSTATE_AVX_MASK))
+ {
+ case I386_XSTATE_AVX_MASK:
+ return tdesc_amd64_avx_linux;
+ default:
+ return tdesc_amd64_linux;
+ }
}
static void
gdb_assert (tdesc_data);
+ linux_init_abi (info, gdbarch);
+
tdep->gregset_reg_offset = amd64_linux_gregset_reg_offset;
tdep->gregset_num_regs = ARRAY_SIZE (amd64_linux_gregset_reg_offset);
tdep->sizeof_gregset = 27 * 8;
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
GDB_OSABI_LINUX, amd64_linux_init_abi);
- /* Initialize the Linux target description */
+ /* Initialize the Linux target description. */
initialize_tdesc_amd64_linux ();
initialize_tdesc_amd64_avx_linux ();
}