Support the fs_base and gs_base registers on i386.
[deliverable/binutils-gdb.git] / gdb / i386-fbsd-tdep.c
index 594b8f6f0a4f620d16daf2e9d852a55224367c51..2f28bad7286503d080150041a863acea4ceda43c 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for FreeBSD/i386.
 
-   Copyright (C) 2003-2017 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,7 +24,7 @@
 #include "regcache.h"
 #include "regset.h"
 #include "i386-fbsd-tdep.h"
-#include "x86-xstate.h"
+#include "common/x86-xstate.h"
 
 #include "i386-tdep.h"
 #include "i387-tdep.h"
@@ -248,14 +248,14 @@ i386fbsd_core_read_xcr0 (bfd *abfd)
            {
              warning (_("Couldn't read `xcr0' bytes from "
                         "`.reg-xstate' section in core file."));
-             return 0;
+             return X86_XSTATE_SSE_MASK;
            }
 
          xcr0 = bfd_get_64 (abfd, contents);
        }
     }
   else
-    xcr0 = 0;
+    xcr0 = X86_XSTATE_SSE_MASK;
 
   return xcr0;
 }
@@ -267,7 +267,7 @@ i386fbsd_core_read_description (struct gdbarch *gdbarch,
                                struct target_ops *target,
                                bfd *abfd)
 {
-  return i386_target_description (i386fbsd_core_read_xcr0 (abfd));
+  return i386_target_description (i386fbsd_core_read_xcr0 (abfd), false);
 }
 
 /* Similar to i386_supply_fpregset, but use XSAVE extended state.  */
@@ -309,12 +309,15 @@ i386fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
-  cb (".reg2", tdep->sizeof_fpregset, &i386_fpregset, NULL, cb_data);
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
+      cb_data);
+  cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, &i386_fpregset,
+      NULL, cb_data);
 
   if (tdep->xcr0 & X86_XSTATE_AVX)
-    cb (".reg-xstate", X86_XSTATE_SIZE(tdep->xcr0),
-       &i386fbsd_xstateregset, "XSAVE extended state", cb_data);
+    cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
+       X86_XSTATE_SIZE (tdep->xcr0), &i386fbsd_xstateregset,
+       "XSAVE extended state", cb_data);
 }
 
 static void
@@ -417,10 +420,6 @@ i386fbsd4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                     i386fbsd_core_read_description);
 }
 
-\f
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_i386fbsd_tdep (void);
-
 void
 _initialize_i386fbsd_tdep (void)
 {
This page took 0.026558 seconds and 4 git commands to generate.