Multi-target support
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index 054638ba1f0f8c5dc41ee1964ffac5d562bd35ec..32cd879de80b9bb87050fb6599f3822d179e3909 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for GNU/Linux i386.
 
-   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -31,7 +31,7 @@
 #include "i387-tdep.h"
 #include "i386-tdep.h"
 #include "i386-linux-tdep.h"
-#include "x86-xstate.h"
+#include "gdbsupport/x86-xstate.h"
 
 #include "x86-linux-nat.h"
 #include "nat/linux-ptrace.h"
@@ -112,7 +112,7 @@ fetch_register (struct regcache *regcache, int regno)
   gdb_assert (!have_ptrace_getregs);
   if (i386_linux_gregset_reg_offset[regno] == -1)
     {
-      regcache_raw_supply (regcache, regno, NULL);
+      regcache->raw_supply (regno, NULL);
       return;
     }
 
@@ -126,7 +126,7 @@ fetch_register (struct regcache *regcache, int regno)
           gdbarch_register_name (regcache->arch (), regno),
           regno, safe_strerror (errno));
 
-  regcache_raw_supply (regcache, regno, &val);
+  regcache->raw_supply (regno, &val);
 }
 
 /* Store one register.  */
@@ -144,7 +144,7 @@ store_register (const struct regcache *regcache, int regno)
   tid = get_ptrace_pid (regcache->ptid ());
 
   errno = 0;
-  regcache_raw_collect (regcache, regno, &val);
+  regcache->raw_collect (regno, &val);
   ptrace (PTRACE_POKEUSER, tid,
          i386_linux_gregset_reg_offset[regno], val);
   if (errno != 0)
@@ -167,13 +167,13 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
-    regcache_raw_supply (regcache, i,
-                        regp + i386_linux_gregset_reg_offset[i]);
+    regcache->raw_supply (i, regp + i386_linux_gregset_reg_offset[i]);
 
   if (I386_LINUX_ORIG_EAX_REGNUM
        < gdbarch_num_regs (regcache->arch ()))
-    regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
-                        + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+    regcache->raw_supply
+      (I386_LINUX_ORIG_EAX_REGNUM,
+       regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -189,14 +189,14 @@ fill_gregset (const struct regcache *regcache,
 
   for (i = 0; i < I386_NUM_GREGS; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (regcache, i,
-                           regp + i386_linux_gregset_reg_offset[i]);
+      regcache->raw_collect (i, regp + i386_linux_gregset_reg_offset[i]);
 
   if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
       && I386_LINUX_ORIG_EAX_REGNUM
           < gdbarch_num_regs (regcache->arch ()))
-    regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
-                         + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+    regcache->raw_collect
+      (I386_LINUX_ORIG_EAX_REGNUM,
+       regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
@@ -647,7 +647,7 @@ static const unsigned char linux_syscall[] = { 0xcd, 0x80 };
 void
 i386_linux_nat_target::low_resume (ptid_t ptid, int step, enum gdb_signal signal)
 {
-  int pid = ptid_get_lwp (ptid);
+  int pid = ptid.lwp ();
   int request;
 
   if (catch_syscall_enabled () > 0)
@@ -657,7 +657,7 @@ i386_linux_nat_target::low_resume (ptid_t ptid, int step, enum gdb_signal signal
 
   if (step)
     {
-      struct regcache *regcache = get_thread_regcache (ptid);
+      struct regcache *regcache = get_thread_regcache (this, ptid);
       struct gdbarch *gdbarch = regcache->arch ();
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       ULONGEST pc;
This page took 0.036244 seconds and 4 git commands to generate.