* infrun.c (adjust_pc_after_break): Do not assume software single-step
[deliverable/binutils-gdb.git] / gdb / ia64-linux-nat.c
index ff2d61cc2392468b8d1b5a5f8c93ff22fd6d9d73..f42ca0ffc3087aafcff4660d6af3f1c5757c37bf 100644 (file)
@@ -308,7 +308,7 @@ ia64_register_addr (int regno)
 {
   CORE_ADDR addr;
 
-  if (regno < 0 || regno >= NUM_REGS)
+  if (regno < 0 || regno >= gdbarch_num_regs (current_gdbarch))
     error (_("Invalid register number %d."), regno);
 
   if (u_offsets[regno] == -1)
@@ -322,7 +322,9 @@ ia64_register_addr (int regno)
 static int
 ia64_cannot_fetch_register (int regno)
 {
-  return regno < 0 || regno >= NUM_REGS || u_offsets[regno] == -1;
+  return regno < 0
+        || regno >= gdbarch_num_regs (current_gdbarch)
+        || u_offsets[regno] == -1;
 }
 
 static int
@@ -357,7 +359,9 @@ ia64_cannot_store_register (int regno)
      were previously read from the inferior process to be written
      back.)  */
 
-  return regno < 0 || regno >= NUM_REGS || u_offsets[regno] == -1
+  return regno < 0
+        || regno >= gdbarch_num_regs (current_gdbarch)
+        || u_offsets[regno] == -1
          || regno == IA64_BSPSTORE_REGNUM;
 }
 
@@ -591,7 +595,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw)
     }
 
   store_debug_register_pair (ptid, idx, &dbr_addr, &dbr_mask);
-  enable_watchpoints_in_psr (current_regcache);
+  enable_watchpoints_in_psr (get_current_regcache ());
 
   return 0;
 }
@@ -628,7 +632,7 @@ ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
   int tid;
   struct siginfo siginfo;
   ptid_t ptid = inferior_ptid;
-  struct regcache *regcache = current_regcache;
+  struct regcache *regcache = get_current_regcache ();
 
   tid = TIDGET(ptid);
   if (tid == 0)
@@ -700,7 +704,8 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
       buf[i] = ptrace (PT_READ_U, pid, (PTRACE_TYPE_ARG3)addr, 0);
       if (errno != 0)
        error (_("Couldn't read register %s (#%d): %s."),
-              REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+              gdbarch_register_name (current_gdbarch, regnum),
+              regnum, safe_strerror (errno));
 
       addr += sizeof (PTRACE_TYPE_RET);
     }
@@ -714,7 +719,7 @@ static void
 ia64_linux_fetch_registers (struct regcache *regcache, int regnum)
 {
   if (regnum == -1)
-    for (regnum = 0; regnum < NUM_REGS; regnum++)
+    for (regnum = 0; regnum < gdbarch_num_regs (current_gdbarch); regnum++)
       ia64_linux_fetch_register (regcache, regnum);
   else
     ia64_linux_fetch_register (regcache, regnum);
@@ -754,7 +759,8 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
       ptrace (PT_WRITE_U, pid, (PTRACE_TYPE_ARG3)addr, buf[i]);
       if (errno != 0)
        error (_("Couldn't write register %s (#%d): %s."),
-              REGISTER_NAME (regnum), regnum, safe_strerror (errno));
+              gdbarch_register_name (current_gdbarch, regnum),
+              regnum, safe_strerror (errno));
 
       addr += sizeof (PTRACE_TYPE_RET);
     }
@@ -767,7 +773,7 @@ static void
 ia64_linux_store_registers (struct regcache *regcache, int regnum)
 {
   if (regnum == -1)
-    for (regnum = 0; regnum < NUM_REGS; regnum++)
+    for (regnum = 0; regnum < gdbarch_num_regs (current_gdbarch); regnum++)
       ia64_linux_store_register (regcache, regnum);
   else
     ia64_linux_store_register (regcache, regnum);
This page took 0.024127 seconds and 4 git commands to generate.