2007-09-04 Michael Snyder <msnyder@access-company.com>
[deliverable/binutils-gdb.git] / gdb / alpha-tdep.c
index 551be671d1e444922eb4d2e14f6edd1d458c5666..e7d297dace21aea9fdc337e9c770082a1fbaa2e3 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 "doublest.h"
@@ -724,13 +722,13 @@ alpha_skip_prologue (CORE_ADDR pc)
    into the "pc".  This routine returns true on success.  */
 
 static int
-alpha_get_longjmp_target (CORE_ADDR *pc)
+alpha_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (frame));
   CORE_ADDR jb_addr;
   gdb_byte raw_buffer[ALPHA_REGISTER_SIZE];
 
-  jb_addr = read_register (ALPHA_A0_REGNUM);
+  jb_addr = get_frame_register_unsigned (frame, ALPHA_A0_REGNUM);
 
   if (target_read_memory (jb_addr + (tdep->jb_pc * tdep->jb_elt_size),
                          raw_buffer, tdep->jb_elt_size))
@@ -1398,14 +1396,13 @@ fp_register_sign_bit (LONGEST reg)
    the target of the coming instruction and breakpoint it.  */
 
 static CORE_ADDR
-alpha_next_pc (CORE_ADDR pc)
+alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
 {
   unsigned int insn;
   unsigned int op;
   int regno;
   int offset;
   LONGEST rav;
-  gdb_byte reg[ALPHA_REGISTER_SIZE];
 
   insn = alpha_read_insn (pc);
 
@@ -1416,7 +1413,7 @@ alpha_next_pc (CORE_ADDR pc)
     {
       /* Jump format: target PC is:
         RB & ~3  */
-      return (read_register ((insn >> 16) & 0x1f) & ~3);
+      return (get_frame_register_unsigned (frame, (insn >> 16) & 0x1f) & ~3);
     }
 
   if ((op & 0x30) == 0x30)
@@ -1444,11 +1441,10 @@ alpha_next_pc (CORE_ADDR pc)
           case 0x33:              /* FBLE */
           case 0x32:              /* FBLT */
           case 0x35:              /* FBNE */
-            regno += FP0_REGNUM;
+            regno += gdbarch_fp0_regnum (current_gdbarch);
        }
       
-      regcache_cooked_read (current_regcache, regno, reg);
-      rav = extract_signed_integer (reg, ALPHA_REGISTER_SIZE);
+      rav = get_frame_register_signed (frame, regno);
 
       switch (op)
        {
@@ -1520,12 +1516,12 @@ alpha_next_pc (CORE_ADDR pc)
 }
 
 int
-alpha_software_single_step (struct regcache *regcache)
+alpha_software_single_step (struct frame_info *frame)
 {
   CORE_ADDR pc, next_pc;
 
-  pc = read_pc ();
-  next_pc = alpha_next_pc (pc);
+  pc = get_frame_pc (frame);
+  next_pc = alpha_next_pc (frame, pc);
 
   insert_single_step_breakpoint (next_pc);
   return 1;
This page took 0.02457 seconds and 4 git commands to generate.