2007-09-12 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index 8c13888f65153bd49d6689ec7c857b983d8dac74..fcfb55ef6c05cd3feb6c865047c3e27ea9fe8bdb 100644 (file)
@@ -10,7 +10,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,
@@ -19,9 +19,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"
@@ -288,7 +286,7 @@ gdbsim_fetch_register (struct regcache *regcache, int regno)
       return;
     }
 
-  switch (REGISTER_SIM_REGNO (regno))
+  switch (gdbarch_register_sim_regno (current_gdbarch, regno))
     {
     case LEGACY_SIM_REGNO_IGNORE:
       break;
@@ -311,14 +309,18 @@ gdbsim_fetch_register (struct regcache *regcache, int regno)
        gdb_assert (regno >= 0 && regno < gdbarch_num_regs (current_gdbarch));
        memset (buf, 0, MAX_REGISTER_SIZE);
        nr_bytes = sim_fetch_register (gdbsim_desc,
-                                      REGISTER_SIM_REGNO (regno),
-                                      buf, register_size (current_gdbarch, regno));
+                                      gdbarch_register_sim_regno
+                                        (current_gdbarch, regno),
+                                      buf,
+                                      register_size (current_gdbarch, regno));
        if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno) && warn_user)
          {
            fprintf_unfiltered (gdb_stderr,
                                "Size of register %s (%d/%d) incorrect (%d instead of %d))",
                                gdbarch_register_name (current_gdbarch, regno),
-                               regno, REGISTER_SIM_REGNO (regno),
+                               regno,
+                               gdbarch_register_sim_regno
+                                 (current_gdbarch, regno),
                                nr_bytes, register_size (current_gdbarch, regno));
            warn_user = 0;
          }
@@ -349,13 +351,14 @@ gdbsim_store_register (struct regcache *regcache, int regno)
        gdbsim_store_register (regcache, regno);
       return;
     }
-  else if (REGISTER_SIM_REGNO (regno) >= 0)
+  else if (gdbarch_register_sim_regno (current_gdbarch, regno) >= 0)
     {
       char tmp[MAX_REGISTER_SIZE];
       int nr_bytes;
       regcache_cooked_read (regcache, regno, tmp);
       nr_bytes = sim_store_register (gdbsim_desc,
-                                    REGISTER_SIM_REGNO (regno),
+                                    gdbarch_register_sim_regno
+                                      (current_gdbarch, regno),
                                     tmp, register_size (current_gdbarch, regno));
       if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno))
        internal_error (__FILE__, __LINE__,
This page took 0.035288 seconds and 4 git commands to generate.