Remove regcache_cooked_read_part
[deliverable/binutils-gdb.git] / gdb / hppa-tdep.c
index c0ac6aeb21ea9dbfa4b66bd3738b9ef66a787599..81e8a4cc6f805899d62c263d81c0fb4cba17c4a5 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the HP PA-RISC architecture.
 
-   Copyright (C) 1986-2017 Free Software Foundation, Inc.
+   Copyright (C) 1986-2018 Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
    University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -205,13 +205,10 @@ hppa_symbol_address(const char *sym)
 static struct hppa_objfile_private *
 hppa_init_objfile_priv_data (struct objfile *objfile)
 {
-  struct hppa_objfile_private *priv;
+  hppa_objfile_private *priv
+    = OBSTACK_ZALLOC (&objfile->objfile_obstack, hppa_objfile_private);
 
-  priv = (struct hppa_objfile_private *)
-        obstack_alloc (&objfile->objfile_obstack,
-                       sizeof (struct hppa_objfile_private));
   set_objfile_data (objfile, hppa_objfile_priv_data, priv);
-  memset (priv, 0, sizeof (*priv));
 
   return priv;
 }
@@ -613,7 +610,7 @@ typedef BP_MANIPULATION (hppa_break_insn) hppa_breakpoint;
 static const char *
 hppa32_register_name (struct gdbarch *gdbarch, int i)
 {
-  static char *names[] = {
+  static const char *names[] = {
     "flags",  "r1",      "rp",     "r3",
     "r4",     "r5",      "r6",     "r7",
     "r8",     "r9",      "r10",    "r11",
@@ -656,7 +653,7 @@ hppa32_register_name (struct gdbarch *gdbarch, int i)
 static const char *
 hppa64_register_name (struct gdbarch *gdbarch, int i)
 {
-  static char *names[] = {
+  static const char *names[] = {
     "flags",  "r1",      "rp",     "r3",
     "r4",     "r5",      "r6",     "r7",
     "r8",     "r9",      "r10",    "r11",
@@ -823,17 +820,15 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                  int fpLreg = 72 + (param_ptr - 36) / 4 * 2;
                  int fpreg = 74 + (param_ptr - 32) / 8 * 4;
 
-                 regcache_cooked_write (regcache, grreg, param_val);
-                 regcache_cooked_write (regcache, fpLreg, param_val);
+                 regcache->cooked_write (grreg, param_val);
+                 regcache->cooked_write (fpLreg, param_val);
 
                  if (param_len > 4)
                    {
-                     regcache_cooked_write (regcache, grreg + 1, 
-                                            param_val + 4);
+                     regcache->cooked_write (grreg + 1, param_val + 4);
 
-                     regcache_cooked_write (regcache, fpreg, param_val);
-                     regcache_cooked_write (regcache, fpreg + 1, 
-                                            param_val + 4);
+                     regcache->cooked_write (fpreg, param_val);
+                     regcache->cooked_write (fpreg + 1, param_val + 4);
                    }
                }
            }
@@ -895,6 +890,7 @@ hppa64_integral_or_pointer_p (const struct type *type)
       }
     case TYPE_CODE_PTR:
     case TYPE_CODE_REF:
+    case TYPE_CODE_RVALUE_REF:
       return (TYPE_LENGTH (type) == 8);
     default:
       break;
@@ -1156,8 +1152,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
       if (part > 0)
        {
          if (readbuf != NULL)
-           regcache_cooked_read_part (regcache, reg, 4 - part,
-                                      part, readbuf);
+           regcache->cooked_read_part (reg, 4 - part, part, readbuf);
          if (writebuf != NULL)
            regcache_cooked_write_part (regcache, reg, 4 - part,
                                        part, writebuf);
@@ -1167,9 +1162,9 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
       for (b = part; b < TYPE_LENGTH (type); b += 4)
        {
          if (readbuf != NULL)
-           regcache_cooked_read (regcache, reg, readbuf + b);
+           regcache->cooked_read (reg, readbuf + b);
          if (writebuf != NULL)
-           regcache_cooked_write (regcache, reg, writebuf + b);
+           regcache->cooked_write (reg, writebuf + b);
          reg++;
        }
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -1247,8 +1242,8 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function,
     {
       while (len > 0)
        {
-         regcache_cooked_read_part (regcache, regnum, offset,
-                                    std::min (len, 8), readbuf);
+         regcache->cooked_read_part (regnum, offset, std::min (len, 8),
+                                     readbuf);
          readbuf += std::min (len, 8);
          len -= std::min (len, 8);
          regnum++;
@@ -1303,13 +1298,13 @@ hppa64_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
 }
 
 CORE_ADDR
-hppa_read_pc (struct regcache *regcache)
+hppa_read_pc (readable_regcache *regcache)
 {
   ULONGEST ipsw;
   ULONGEST pc;
 
-  regcache_cooked_read_unsigned (regcache, HPPA_IPSW_REGNUM, &ipsw);
-  regcache_cooked_read_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, &pc);
+  regcache->cooked_read (HPPA_IPSW_REGNUM, &ipsw);
+  regcache->cooked_read (HPPA_PCOQ_HEAD_REGNUM, &pc);
 
   /* If the current instruction is nullified, then we are effectively
      still executing the previous instruction.  Pretend we are still
@@ -2571,7 +2566,7 @@ hppa_lookup_stub_minimal_symbol (const char *name,
 }
 
 static void
-unwind_command (char *exp, int from_tty)
+unwind_command (const char *exp, int from_tty)
 {
   CORE_ADDR address;
   struct unwind_table_entry *u;
@@ -2746,14 +2741,14 @@ hppa_fetch_pointer_argument (struct frame_info *frame, int argi,
 }
 
 static enum register_status
-hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+hppa_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
                           int regnum, gdb_byte *buf)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST tmp;
   enum register_status status;
 
-  status = regcache_raw_read_unsigned (regcache, regnum, &tmp);
+  status = regcache->raw_read (regnum, &tmp);
   if (status == REG_VALID)
     {
       if (regnum == HPPA_PCOQ_HEAD_REGNUM || regnum == HPPA_PCOQ_TAIL_REGNUM)
@@ -3121,8 +3116,6 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Helper for function argument information.  */
   set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument);
 
-  set_gdbarch_print_insn (gdbarch, print_insn_hppa);
-
   /* When a hardware watchpoint triggers, we'll move the inferior past
      it by removing all eventpoints; stepping past the instruction
      that caused the trigger; reinserting eventpoints; and checking
@@ -3188,9 +3181,6 @@ hppa_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file, "elf = %s\n", tdep->is_elf ? "yes" : "no");
 }
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_hppa_tdep;
-
 void
 _initialize_hppa_tdep (void)
 {
This page took 0.027859 seconds and 4 git commands to generate.