2007-06-19 Markus Deuling <deuling@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / remote-sim.c
index af2238f6a5c04c71a2992bf75ef6379fe0319b78..48bb1277b5a24dbb9737f32c9c47eea02d25627c 100644 (file)
@@ -274,7 +274,7 @@ int
 one2one_register_sim_regno (int regnum)
 {
   /* Only makes sense to supply raw registers.  */
-  gdb_assert (regnum >= 0 && regnum < NUM_REGS);
+  gdb_assert (regnum >= 0 && regnum < gdbarch_num_regs (current_gdbarch));
   return regnum;
 }
 
@@ -283,12 +283,12 @@ gdbsim_fetch_register (struct regcache *regcache, int regno)
 {
   if (regno == -1)
     {
-      for (regno = 0; regno < NUM_REGS; regno++)
+      for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); regno++)
        gdbsim_fetch_register (regcache, regno);
       return;
     }
 
-  switch (REGISTER_SIM_REGNO (regno))
+  switch (gdbarch_register_sim_regno (current_gdbarch, regno))
     {
     case LEGACY_SIM_REGNO_IGNORE:
       break;
@@ -308,17 +308,21 @@ gdbsim_fetch_register (struct regcache *regcache, int regno)
        static int warn_user = 1;
        char buf[MAX_REGISTER_SIZE];
        int nr_bytes;
-       gdb_assert (regno >= 0 && regno < NUM_REGS);
+       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))",
-                               REGISTER_NAME (regno),
-                               regno, REGISTER_SIM_REGNO (regno),
+                               gdbarch_register_name (current_gdbarch, regno),
+                               regno,
+                               gdbarch_register_sim_regno
+                                 (current_gdbarch, regno),
                                nr_bytes, register_size (current_gdbarch, regno));
            warn_user = 0;
          }
@@ -345,17 +349,18 @@ gdbsim_store_register (struct regcache *regcache, int regno)
 {
   if (regno == -1)
     {
-      for (regno = 0; regno < NUM_REGS; regno++)
+      for (regno = 0; regno < gdbarch_num_regs (current_gdbarch); 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.02573 seconds and 4 git commands to generate.