Update description of the -plugin option used by the linker, ar and nm.
[deliverable/binutils-gdb.git] / gdb / x86-linux-nat.c
index 0026d264a20ea5d08f74ae5a1f589bac29340662..679cf3503de3d966668d21ffae178dd8fda5bc7e 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
 
-   Copyright (C) 1999-2015 Free Software Foundation, Inc.
+   Copyright (C) 1999-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,7 +21,7 @@
 #include "inferior.h"
 #include "elf/common.h"
 #include "gdb_proc_service.h"
-#include <sys/ptrace.h>
+#include "nat/gdb_ptrace.h"
 #include <sys/user.h>
 #include <sys/procfs.h>
 #include <sys/uio.h>
@@ -51,8 +51,6 @@ struct arch_lwp_info
   int debug_registers_changed;
 };
 
-/* Does the current host support PTRACE_GETREGSET?  */
-int have_ptrace_getregset = -1;
 \f
 
 /* linux_nat_new_fork hook.   */
@@ -164,13 +162,13 @@ x86_linux_read_description (struct target_ops *ops)
       if (ptrace (PTRACE_GETFPXREGS, tid, 0, (int) &fpxregs) < 0)
        {
          have_ptrace_getfpxregs = 0;
-         have_ptrace_getregset = 0;
+         have_ptrace_getregset = TRIBOOL_FALSE;
          return tdesc_i386_mmx_linux;
        }
     }
 #endif
 
-  if (have_ptrace_getregset == -1)
+  if (have_ptrace_getregset == TRIBOOL_UNKNOWN)
     {
       uint64_t xstateregs[(X86_XSTATE_SSE_SIZE / sizeof (uint64_t))];
       struct iovec iov;
@@ -181,10 +179,10 @@ x86_linux_read_description (struct target_ops *ops)
       /* Check if PTRACE_GETREGSET works.  */
       if (ptrace (PTRACE_GETREGSET, tid,
                  (unsigned int) NT_X86_XSTATE, &iov) < 0)
-       have_ptrace_getregset = 0;
+       have_ptrace_getregset = TRIBOOL_FALSE;
       else
        {
-         have_ptrace_getregset = 1;
+         have_ptrace_getregset = TRIBOOL_TRUE;
 
          /* Get XCR0 from XSAVE extended state.  */
          xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET
@@ -196,7 +194,7 @@ x86_linux_read_description (struct target_ops *ops)
      PTRACE_GETREGSET is not available then set xcr0_features_bits to
      zero so that the "no-features" descriptions are returned by the
      switches below.  */
-  if (have_ptrace_getregset)
+  if (have_ptrace_getregset == TRIBOOL_TRUE)
     xcr0_features_bits = xcr0 & X86_XSTATE_ALL_MASK;
   else
     xcr0_features_bits = 0;
@@ -217,6 +215,11 @@ x86_linux_read_description (struct target_ops *ops)
            return tdesc_x32_avx_linux; /* No MPX on x32 using AVX.  */
          else
            return tdesc_amd64_mpx_linux;
+       case X86_XSTATE_AVX_MPX_MASK:
+         if (is_x32)
+           return tdesc_x32_avx_linux; /* No MPX on x32 using AVX.  */
+         else
+           return tdesc_amd64_avx_mpx_linux;
        case X86_XSTATE_AVX_MASK:
          if (is_x32)
            return tdesc_x32_avx_linux;
@@ -239,6 +242,8 @@ x86_linux_read_description (struct target_ops *ops)
          return tdesc_i386_avx512_linux;
        case X86_XSTATE_MPX_MASK:
          return tdesc_i386_mpx_linux;
+       case X86_XSTATE_AVX_MPX_MASK:
+         return tdesc_i386_avx_mpx_linux;
        case X86_XSTATE_AVX_MASK:
          return tdesc_i386_avx_linux;
        default:
@@ -257,7 +262,6 @@ x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
                         const struct btrace_config *conf)
 {
   struct btrace_target_info *tinfo;
-  struct gdbarch *gdbarch;
 
   errno = 0;
   tinfo = linux_enable_btrace (ptid, conf);
@@ -266,12 +270,6 @@ x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
     error (_("Could not enable branch tracing for %s: %s."),
           target_pid_to_str (ptid), safe_strerror (errno));
 
-  /* Fill in the size of a pointer in bits.  */
-  if (tinfo->ptr_bits == 0)
-    {
-      gdbarch = target_thread_architecture (ptid);
-      tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch);
-    }
   return tinfo;
 }
 
This page took 0.026967 seconds and 4 git commands to generate.