*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / dwarf2-frame.c
index d2770cbc9f0221e5f54fb46a45409eecd9693d32..c84fe492a7d701af3a13e4e3b9df59832f6db3a5 100644 (file)
@@ -8,7 +8,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,
@@ -17,9 +17,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 "dwarf2expr.h"
@@ -237,7 +235,7 @@ read_reg (void *baton, int reg)
   int regnum;
   gdb_byte *buf;
 
-  regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg);
+  regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, reg);
 
   buf = alloca (register_size (gdbarch, regnum));
   frame_unwind_register (next_frame, regnum, buf);
@@ -340,9 +338,8 @@ execute_cfa_program (gdb_byte *insn_ptr, gdb_byte *insn_end,
 incomplete CFI data; DW_CFA_restore unspecified\n\
 register %s (#%d) at 0x%s"),
                       gdbarch_register_name
-                        (current_gdbarch, gdbarch_dwarf2_reg_to_regnum
-                                            (current_gdbarch, reg)),
-                      gdbarch_dwarf2_reg_to_regnum (current_gdbarch, reg),
+                        (gdbarch, gdbarch_dwarf2_reg_to_regnum (gdbarch, reg)),
+                      gdbarch_dwarf2_reg_to_regnum (gdbarch, reg),
                       paddr (fs->pc));
        }
       else
@@ -649,9 +646,9 @@ dwarf2_frame_default_init_reg (struct gdbarch *gdbarch, int regnum,
      (e.g. IBM S/390 and zSeries).  Those architectures should provide
      their own architecture-specific initialization function.  */
 
-  if (regnum == PC_REGNUM)
+  if (regnum == gdbarch_pc_regnum (gdbarch))
     reg->how = DWARF2_FRAME_REG_RA;
-  else if (regnum == SP_REGNUM)
+  else if (regnum == gdbarch_sp_regnum (gdbarch))
     reg->how = DWARF2_FRAME_REG_CFA;
 }
 
@@ -811,8 +808,8 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
 {
   struct cleanup *old_chain;
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
-  const int num_regs = gdbarch_num_regs (current_gdbarch)
-                      + gdbarch_num_pseudo_regs (current_gdbarch);
+  const int num_regs = gdbarch_num_regs (gdbarch)
+                      + gdbarch_num_pseudo_regs (gdbarch);
   struct dwarf2_frame_cache *cache;
   struct dwarf2_frame_state *fs;
   struct dwarf2_fde *fde;
@@ -911,7 +908,7 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
     for (column = 0; column < fs->regs.num_regs; column++)
       {
        /* Use the GDB register number as the destination index.  */
-       int regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, column);
+       int regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, column);
 
        /* If there's no corresponding GDB register, ignore it.  */
        if (regnum < 0 || regnum >= num_regs)
@@ -1070,7 +1067,7 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
       *lvalp = lval_register;
       *addrp = 0;
       *realnump = gdbarch_dwarf2_reg_to_regnum
-                   (current_gdbarch, cache->reg[regnum].loc.reg);
+                   (gdbarch, cache->reg[regnum].loc.reg);
       if (valuep)
        frame_unwind_register (next_frame, (*realnump), valuep);
       break;
@@ -1165,7 +1162,7 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
           CORE_ADDR pc = cache->reg[regnum].loc.offset;
 
           regnum = gdbarch_dwarf2_reg_to_regnum
-                    (current_gdbarch, cache->retaddr_reg.loc.reg);
+                    (gdbarch, cache->retaddr_reg.loc.reg);
           pc += frame_unwind_register_unsigned (next_frame, regnum);
           pack_long (valuep, register_type (gdbarch, regnum), pc);
         }
This page took 0.024988 seconds and 4 git commands to generate.