* target-memory.c (blocks_to_erase): Correct off-by-one error.
[deliverable/binutils-gdb.git] / gdb / hppa-tdep.c
index 50dac1ba6076bf6900a736c42bf49b7a1b3396ad..8a05c7379732323fefd6f87e6d5a7fe9feca8dc6 100644 (file)
@@ -1,7 +1,7 @@
 /* Target-dependent code for the HP PA-RISC architecture.
 
-   Copyright (C) 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright (C) 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
@@ -31,6 +31,7 @@
 #include "completer.h"
 #include "osabi.h"
 #include "gdb_assert.h"
+#include "gdb_stdint.h"
 #include "arch-utils.h"
 /* For argument passing to the inferior */
 #include "symtab.h"
@@ -41,6 +42,7 @@
 
 #include "gdbcore.h"
 #include "gdbcmd.h"
+#include "gdbtypes.h"
 #include "objfiles.h"
 #include "hppa-tdep.h"
 
@@ -501,7 +503,7 @@ find_unwind_entry (CORE_ADDR pc)
       {
        if (hppa_debug)
          fprintf_unfiltered (gdb_stdlog, "0x%s (cached) }\n",
-            paddr_nz ((CORE_ADDR) ui->cache));
+            paddr_nz ((uintptr_t) ui->cache));
         return ui->cache;
       }
 
@@ -519,7 +521,7 @@ find_unwind_entry (CORE_ADDR pc)
            ui->cache = &ui->table[middle];
            if (hppa_debug)
              fprintf_unfiltered (gdb_stdlog, "0x%s }\n",
-                paddr_nz ((CORE_ADDR) ui->cache));
+                paddr_nz ((uintptr_t) ui->cache));
            return &ui->table[middle];
          }
 
@@ -549,7 +551,7 @@ hppa_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   char buf[4];
   int off;
 
-  status = deprecated_read_memory_nobpt (pc, buf, 4);
+  status = read_memory_nobpt (pc, buf, 4);
   if (status != 0)
     return 0;
 
@@ -1555,7 +1557,7 @@ restart:
       old_save_sp = save_sp;
       old_stack_remaining = stack_remaining;
 
-      status = deprecated_read_memory_nobpt (pc, buf, 4);
+      status = read_memory_nobpt (pc, buf, 4);
       inst = extract_unsigned_integer (buf, 4);
 
       /* Yow! */
@@ -1604,7 +1606,7 @@ restart:
          while (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26)
            {
              pc += 4;
-             status = deprecated_read_memory_nobpt (pc, buf, 4);
+             status = read_memory_nobpt (pc, buf, 4);
              inst = extract_unsigned_integer (buf, 4);
              if (status != 0)
                return pc;
@@ -1617,7 +1619,7 @@ restart:
       reg_num = inst_saves_fr (inst);
       save_fr &= ~(1 << reg_num);
 
-      status = deprecated_read_memory_nobpt (pc + 4, buf, 4);
+      status = read_memory_nobpt (pc + 4, buf, 4);
       next_inst = extract_unsigned_integer (buf, 4);
 
       /* Yow! */
@@ -1644,13 +1646,13 @@ restart:
          while (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7))
            {
              pc += 8;
-             status = deprecated_read_memory_nobpt (pc, buf, 4);
+             status = read_memory_nobpt (pc, buf, 4);
              inst = extract_unsigned_integer (buf, 4);
              if (status != 0)
                return pc;
              if ((inst & 0xfc000000) != 0x34000000)
                break;
-             status = deprecated_read_memory_nobpt (pc + 4, buf, 4);
+             status = read_memory_nobpt (pc + 4, buf, 4);
              next_inst = extract_unsigned_integer (buf, 4);
              if (status != 0)
                return pc;
@@ -1786,9 +1788,14 @@ hppa_skip_prologue (CORE_ADDR pc)
 static struct unwind_table_entry *
 hppa_find_unwind_entry_in_block (struct frame_info *f)
 {
-  CORE_ADDR pc;
+  CORE_ADDR pc = frame_unwind_address_in_block (f, NORMAL_FRAME);
 
-  pc = frame_unwind_address_in_block (f);
+  /* FIXME drow/20070101: Calling gdbarch_addr_bits_remove on the
+     result of frame_unwind_address_in_block implies a problem.
+     The bits should have been removed earlier, before the return
+     value of frame_pc_unwind.  That might be happening already;
+     if it isn't, it should be fixed.  Then this call can be
+     removed.  */
   pc = gdbarch_addr_bits_remove (get_frame_arch (f), pc);
   return find_unwind_entry (pc);
 }
@@ -1898,7 +1905,7 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache)
     if ((u->Region_description & 0x2) == 0)
       start_pc = u->region_start;
     else
-      start_pc = frame_func_unwind (next_frame);
+      start_pc = frame_func_unwind (next_frame, NORMAL_FRAME);
 
     prologue_end = skip_prologue_hard_way (start_pc, 0);
     end_pc = frame_pc_unwind (next_frame);
@@ -2173,7 +2180,7 @@ hppa_frame_cache (struct frame_info *next_frame, void **this_cache)
   {
     /* Convert all the offsets into addresses.  */
     int reg;
-    for (reg = 0; reg < NUM_REGS; reg++)
+    for (reg = 0; reg < gdbarch_num_regs (current_gdbarch); reg++)
       {
        if (trad_frame_addr_p (cache->saved_regs, reg))
          cache->saved_regs[reg].addr += cache->base;
@@ -2266,7 +2273,7 @@ hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache)
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
 
-  start_pc = frame_func_unwind (next_frame);
+  start_pc = frame_func_unwind (next_frame, NORMAL_FRAME);
   if (start_pc)
     {
       CORE_ADDR cur_pc = frame_pc_unwind (next_frame);
@@ -2325,7 +2332,8 @@ hppa_fallback_frame_this_id (struct frame_info *next_frame, void **this_cache,
 {
   struct hppa_frame_cache *info = 
     hppa_fallback_frame_cache (next_frame, this_cache);
-  (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+  (*this_id) = frame_id_build (info->base,
+                              frame_func_unwind (next_frame, NORMAL_FRAME));
 }
 
 static void
@@ -2408,7 +2416,8 @@ hppa_stub_frame_this_id (struct frame_info *next_frame,
     = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache);
 
   if (info)
-    *this_id = frame_id_build (info->base, frame_func_unwind (next_frame));
+    *this_id = frame_id_build (info->base,
+                              frame_func_unwind (next_frame, NORMAL_FRAME));
   else
     *this_id = null_frame_id;
 }
@@ -2440,7 +2449,7 @@ static const struct frame_unwind hppa_stub_frame_unwind = {
 static const struct frame_unwind *
 hppa_stub_unwind_sniffer (struct frame_info *next_frame)
 {
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  CORE_ADDR pc = frame_unwind_address_in_block (next_frame, NORMAL_FRAME);
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
@@ -2635,7 +2644,7 @@ hppa32_register_type (struct gdbarch *gdbarch, int regnum)
    if (regnum < HPPA_FP4_REGNUM)
      return builtin_type_uint32;
    else
-     return builtin_type_ieee_single_big;
+     return builtin_type_ieee_single;
 }
 
 static struct type *
@@ -2644,7 +2653,7 @@ hppa64_register_type (struct gdbarch *gdbarch, int regnum)
    if (regnum < HPPA64_FP4_REGNUM)
      return builtin_type_uint64;
    else
-     return builtin_type_ieee_double_big;
+     return builtin_type_ieee_double;
 }
 
 /* Return non-zero if REGNUM is not a register available to the user
@@ -2855,7 +2864,7 @@ hppa_match_insns (CORE_ADDR pc, struct insn_pattern *pattern,
     {
       gdb_byte buf[HPPA_INSN_SIZE];
 
-      deprecated_read_memory_nobpt (npc, buf, HPPA_INSN_SIZE);
+      read_memory_nobpt (npc, buf, HPPA_INSN_SIZE);
       insn[i] = extract_unsigned_integer (buf, HPPA_INSN_SIZE);
       if ((insn[i] & pattern[i].mask) == pattern[i].data)
         npc += 4;
@@ -3085,7 +3094,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      and LP64, but might show differences some day.  */
   set_gdbarch_long_long_bit (gdbarch, 64);
   set_gdbarch_long_double_bit (gdbarch, 128);
-  set_gdbarch_long_double_format (gdbarch, &floatformat_ia64_quad_big);
+  set_gdbarch_long_double_format (gdbarch, floatformats_ia64_quad);
 
   /* The following gdbarch vector elements do not depend on the address
      size, or in any other gdbarch element previously set.  */
This page took 0.026068 seconds and 4 git commands to generate.