Move arch/tdesc.h to common/tdesc.h
[deliverable/binutils-gdb.git] / gdb / i386-gnu-nat.c
index 77081b8d6f2a7c7c17a9a0c65409b509ab615e25..f0674158a362df377eecddbc3e7ffccb15eb93bf 100644 (file)
@@ -1,6 +1,6 @@
 /* Low level interface to i386 running the GNU Hurd.
 
-   Copyright (C) 1992-2016 Free Software Foundation, Inc.
+   Copyright (C) 1992-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -91,15 +91,15 @@ gnu_fetch_registers (struct target_ops *ops,
                     struct regcache *regcache, int regno)
 {
   struct proc *thread;
+  ptid_t ptid = regcache_get_ptid (regcache);
 
   /* Make sure we know about new threads.  */
   inf_update_procs (gnu_current_inf);
 
-  thread = inf_tid_to_thread (gnu_current_inf,
-                             ptid_get_lwp (inferior_ptid));
+  thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
   if (!thread)
     error (_("Can't fetch registers from thread %s: No such thread"),
-          target_pid_to_str (inferior_ptid));
+          target_pid_to_str (ptid));
 
   if (regno < I386_NUM_GREGS || regno == -1)
     {
@@ -127,7 +127,7 @@ gnu_fetch_registers (struct target_ops *ops,
       else
        {
          proc_debug (thread, "fetching register %s",
-                     gdbarch_register_name (get_regcache_arch (regcache),
+                     gdbarch_register_name (regcache->arch (),
                                             regno));
 
          regcache_raw_supply (regcache, regno,
@@ -183,16 +183,16 @@ gnu_store_registers (struct target_ops *ops,
                     struct regcache *regcache, int regno)
 {
   struct proc *thread;
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
+  ptid_t ptid = regcache_get_ptid (regcache);
 
   /* Make sure we know about new threads.  */
   inf_update_procs (gnu_current_inf);
 
-  thread = inf_tid_to_thread (gnu_current_inf,
-                             ptid_get_lwp (inferior_ptid));
+  thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
   if (!thread)
     error (_("Couldn't store registers into thread %s: No such thread"),
-          target_pid_to_str (inferior_ptid));
+          target_pid_to_str (ptid));
 
   if (regno < I386_NUM_GREGS || regno == -1)
     {
@@ -409,9 +409,6 @@ i386_gnu_dr_get_control (void)
 }
 #endif /* i386_DEBUG_STATE */
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_i386gnu_nat;
-
 void
 _initialize_i386gnu_nat (void)
 {
This page took 0.038259 seconds and 4 git commands to generate.