2007-07-02 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / i386-linux-nat.c
index ceb808430df4aa4cdf1fa4bfc8aa1115f4ce0fae..a8d02954804c9c7e7779750a5eb4ae7e8c469a9c 100644 (file)
@@ -162,7 +162,8 @@ fetch_register (struct regcache *regcache, int regno)
   errno = 0;
   val = ptrace (PTRACE_PEEKUSER, tid, 4 * regmap[regno], 0);
   if (errno != 0)
-    error (_("Couldn't read register %s (#%d): %s."), REGISTER_NAME (regno),
+    error (_("Couldn't read register %s (#%d): %s."), 
+          gdbarch_register_name (current_gdbarch, regno),
           regno, safe_strerror (errno));
 
   regcache_raw_supply (regcache, regno, &val);
@@ -189,7 +190,8 @@ store_register (const struct regcache *regcache, int regno)
   regcache_raw_collect (regcache, regno, &val);
   ptrace (PTRACE_POKEUSER, tid, 4 * regmap[regno], val);
   if (errno != 0)
-    error (_("Couldn't write register %s (#%d): %s."), REGISTER_NAME (regno),
+    error (_("Couldn't write register %s (#%d): %s."),
+          gdbarch_register_name (current_gdbarch, regno),
           regno, safe_strerror (errno));
 }
 \f
@@ -736,15 +738,14 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal)
 
   if (step)
     {
-      struct cleanup *old_chain = save_inferior_ptid ();
-      struct regcache *regcache = current_regcache;
+      struct regcache *regcache = get_thread_regcache (pid_to_ptid (pid));
       ULONGEST pc;
       gdb_byte buf[LINUX_SYSCALL_LEN];
 
       request = PTRACE_SINGLESTEP;
 
-      inferior_ptid = pid_to_ptid (pid);
-      regcache_cooked_read_unsigned (regcache, PC_REGNUM, &pc);
+      regcache_cooked_read_unsigned (regcache,
+                                    gdbarch_pc_regnum (current_gdbarch), &pc);
 
       /* Returning from a signal trampoline is done by calling a
          special system call (sigreturn or rt_sigreturn, see
@@ -782,8 +783,6 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal)
              write_memory (addr, (gdb_byte *) &eflags, 4);
            }
        }
-
-      do_cleanups (old_chain);
     }
 
   if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)
This page took 0.025135 seconds and 4 git commands to generate.