Sort includes for files gdb/[a-f]*.[chyl].
[deliverable/binutils-gdb.git] / gdb / amd64-fbsd-nat.c
index 6e0a1f9636e4dcadb72554b4c21b329cf3704763..4e5291082a2d20f189069ef6e7aa0d338ef8a91e 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for FreeBSD/amd64.
 
-   Copyright (C) 2003-2018 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "target.h"
 
+/* Standard C includes.  */
+#include <machine/reg.h>
 #include <signal.h>
-#include <sys/types.h>
 #include <sys/ptrace.h>
 #include <sys/sysctl.h>
+#include <sys/types.h>
 #include <sys/user.h>
-#include <machine/reg.h>
 
-#include "fbsd-nat.h"
-#include "amd64-tdep.h"
-#include "amd64-nat.h"
+/* Local non-gdb includes.  */
 #include "amd64-bsd-nat.h"
+#include "amd64-nat.h"
+#include "amd64-tdep.h"
+#include "common/x86-xstate.h"
+#include "fbsd-nat.h"
+#include "inferior.h"
+#include "regcache.h"
+#include "target.h"
 #include "x86-nat.h"
-#include "x86-xstate.h"
+
 \f
 
 class amd64_fbsd_nat_target final
@@ -131,24 +134,24 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
     return 0;
 
   pcb->pcb_rsp += 8;
-  regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &pcb->pcb_rip);
-  regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &pcb->pcb_rbx);
-  regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp);
-  regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
-  regcache_raw_supply (regcache, 12, &pcb->pcb_r12);
-  regcache_raw_supply (regcache, 13, &pcb->pcb_r13);
-  regcache_raw_supply (regcache, 14, &pcb->pcb_r14);
-  regcache_raw_supply (regcache, 15, &pcb->pcb_r15);
+  regcache->raw_supply (AMD64_RIP_REGNUM, &pcb->pcb_rip);
+  regcache->raw_supply (AMD64_RBX_REGNUM, &pcb->pcb_rbx);
+  regcache->raw_supply (AMD64_RSP_REGNUM, &pcb->pcb_rsp);
+  regcache->raw_supply (AMD64_RBP_REGNUM, &pcb->pcb_rbp);
+  regcache->raw_supply (12, &pcb->pcb_r12);
+  regcache->raw_supply (13, &pcb->pcb_r13);
+  regcache->raw_supply (14, &pcb->pcb_r14);
+  regcache->raw_supply (15, &pcb->pcb_r15);
 #if (__FreeBSD_version < 800075) && (__FreeBSD_kernel_version < 800075)
   /* struct pcb provides the pcb_ds/pcb_es/pcb_fs/pcb_gs fields only
      up until __FreeBSD_version 800074: The removal of these fields
      occurred on 2009-04-01 while the __FreeBSD_version number was
      bumped to 800075 on 2009-04-06.  So 800075 is the closest version
      number where we should not try to access these fields.  */
-  regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds);
-  regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es);
-  regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs);
-  regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs);
+  regcache->raw_supply (AMD64_DS_REGNUM, &pcb->pcb_ds);
+  regcache->raw_supply (AMD64_ES_REGNUM, &pcb->pcb_es);
+  regcache->raw_supply (AMD64_FS_REGNUM, &pcb->pcb_fs);
+  regcache->raw_supply (AMD64_GS_REGNUM, &pcb->pcb_gs);
 #endif
 
   return 1;
@@ -167,7 +170,7 @@ amd64_fbsd_nat_target::read_description ()
   struct reg regs;
   int is64;
 
-  if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid),
+  if (ptrace (PT_GETREGS, inferior_ptid.pid (),
              (PTRACE_TYPE_ARG3) &regs, 0) == -1)
     perror_with_name (_("Couldn't get registers"));
   is64 = (regs.r_cs == GSEL (GUCODE_SEL, SEL_UPL));
@@ -176,7 +179,7 @@ amd64_fbsd_nat_target::read_description ()
     {
       struct ptrace_xstate_info info;
 
-      if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid),
+      if (ptrace (PT_GETXSTATE_INFO, inferior_ptid.pid (),
                  (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0)
        {
          x86bsd_xsave_len = info.xsave_len;
@@ -188,15 +191,15 @@ amd64_fbsd_nat_target::read_description ()
   if (x86bsd_xsave_len != 0)
     {
       if (is64)
-       return amd64_target_description (xcr0);
+       return amd64_target_description (xcr0, true);
       else
-       return i386_target_description (xcr0);
+       return i386_target_description (xcr0, true);
     }
 #endif
   if (is64)
-    return amd64_target_description (X86_XSTATE_SSE_MASK);
+    return amd64_target_description (X86_XSTATE_SSE_MASK, true);
   else
-    return i386_target_description (X86_XSTATE_SSE_MASK);
+    return i386_target_description (X86_XSTATE_SSE_MASK, true);
 }
 
 #if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
This page took 0.037617 seconds and 4 git commands to generate.