/* Native-dependent code for GNU/Linux x86-64.
- Copyright (C) 2001-2013 Free Software Foundation, Inc.
+ Copyright (C) 2001-2014 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
- ORIG_RAX * 8 /* "orig_eax" */
+ -1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
+ -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */
+ ORIG_RAX * 8, /* "orig_eax" */
};
\f
}
\f
-static void (*super_post_startup_inferior) (ptid_t ptid);
+static void (*super_post_startup_inferior) (struct target_ops *self,
+ ptid_t ptid);
static void
-amd64_linux_child_post_startup_inferior (ptid_t ptid)
+amd64_linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
{
i386_cleanup_dregs ();
- super_post_startup_inferior (ptid);
+ super_post_startup_inferior (self, ptid);
}
\f
}
/* Check the native XCR0 only if PTRACE_GETREGSET is available. */
- if (have_ptrace_getregset
- && (xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK)
+ if (have_ptrace_getregset && (xcr0 & I386_XSTATE_ALL_MASK))
{
- if (is_64bit)
+ switch (xcr0 & I386_XSTATE_ALL_MASK)
{
- if (is_x32)
- return tdesc_x32_avx_linux;
+ case I386_XSTATE_MPX_MASK:
+ if (is_64bit)
+ {
+ if (is_x32)
+ return tdesc_x32_avx_linux; /* No MPX on x32 using AVX. */
+ else
+ return tdesc_amd64_mpx_linux;
+ }
else
- return tdesc_amd64_avx_linux;
+ return tdesc_i386_mpx_linux;
+ case I386_XSTATE_AVX_MASK:
+ if (is_64bit)
+ {
+ if (is_x32)
+ return tdesc_x32_avx_linux;
+ else
+ return tdesc_amd64_avx_linux;
+ }
+ else
+ return tdesc_i386_avx_linux;
+ default:
+ if (is_64bit)
+ {
+ if (is_x32)
+ return tdesc_x32_linux;
+ else
+ return tdesc_amd64_linux;
+ }
+ else
+ return tdesc_i386_linux;
}
- else
- return tdesc_i386_avx_linux;
}
else
{
/* Enable branch tracing. */
static struct btrace_target_info *
-amd64_linux_enable_btrace (ptid_t ptid)
+amd64_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
{
struct btrace_target_info *tinfo;
struct gdbarch *gdbarch;
/* Disable branch tracing. */
static void
-amd64_linux_disable_btrace (struct btrace_target_info *tinfo)
+amd64_linux_disable_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
- int errcode = linux_disable_btrace (tinfo);
+ enum btrace_error errcode = linux_disable_btrace (tinfo);
- if (errcode != 0)
- error (_("Could not disable branch tracing: %s."), safe_strerror (errcode));
+ if (errcode != BTRACE_ERR_NONE)
+ error (_("Could not disable branch tracing."));
}
/* Teardown branch tracing. */
static void
-amd64_linux_teardown_btrace (struct btrace_target_info *tinfo)
+amd64_linux_teardown_btrace (struct target_ops *self,
+ struct btrace_target_info *tinfo)
{
/* Ignore errors. */
linux_disable_btrace (tinfo);
}
+static enum btrace_error
+amd64_linux_read_btrace (struct target_ops *self,
+ VEC (btrace_block_s) **data,
+ struct btrace_target_info *btinfo,
+ enum btrace_read_type type)
+{
+ return linux_read_btrace (data, btinfo, type);
+}
+
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_amd64_linux_nat (void);
t->to_enable_btrace = amd64_linux_enable_btrace;
t->to_disable_btrace = amd64_linux_disable_btrace;
t->to_teardown_btrace = amd64_linux_teardown_btrace;
- t->to_read_btrace = linux_read_btrace;
+ t->to_read_btrace = amd64_linux_read_btrace;
/* Register the target. */
linux_nat_add_target (t);