2007-10-09 Markus Deuling <deuling@de.ibm.com>
[binutils-gdb.git] / gdb / i386gnu-nat.c
index 3547cd5b519828491a76937d4ffc4689926f15c8..b31378390f28562c1384a390614a3b2b71204fae 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "inferior.h"
@@ -150,7 +148,9 @@ gnu_fetch_registers (struct regcache *regcache, int regno)
        }
       else
        {
-         proc_debug (thread, "fetching register %s", REGISTER_NAME (regno));
+         proc_debug (thread, "fetching register %s",
+                     gdbarch_register_name (get_regcache_arch (regcache),
+                                            regno));
 
          regcache_raw_supply (regcache, regno,
                               REG_ADDR (state, regno));
@@ -204,6 +204,7 @@ void
 gnu_store_registers (struct regcache *regcache, int regno)
 {
   struct proc *thread;
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
 
   /* Make sure we know about new threads.  */
   inf_update_procs (current_inferior);
@@ -244,11 +245,11 @@ gnu_store_registers (struct regcache *regcache, int regno)
            if ((thread->fetched_regs & (1 << check_regno))
                && memcpy (REG_ADDR (&old_state, check_regno),
                           REG_ADDR (state, check_regno),
-                          register_size (current_gdbarch, check_regno)))
+                          register_size (gdbarch, check_regno)))
              /* Register CHECK_REGNO has changed!  Ack!  */
              {
                warning (_("Register %s changed after the thread was aborted"),
-                        REGISTER_NAME (check_regno));
+                        gdbarch_register_name (gdbarch, check_regno));
                if (regno >= 0 && regno != check_regno)
                  /* Update GDB's copy of the register.  */
                  regcache_raw_supply (regcache, check_regno,
@@ -270,7 +271,8 @@ gnu_store_registers (struct regcache *regcache, int regno)
        }
       else
        {
-         proc_debug (thread, "storing register %s", REGISTER_NAME (regno));
+         proc_debug (thread, "storing register %s",
+                     gdbarch_register_name (gdbarch, regno));
 
          gdb_assert (regcache_valid_p (regcache, regno));
          regcache_raw_collect (regcache, regno, REG_ADDR (state, regno));