Improve boostrap-ubsan config (PR bootstrap/64914).
[deliverable/binutils-gdb.git] / gdb / aarch64-tdep.c
index e4cd3b5b0b59af25691057ec723cfe633c53b73c..ef9b71c668f891d66cfdfa679bb2c6c7780756e1 100644 (file)
@@ -210,6 +210,7 @@ class instruction_reader : public abstract_instruction_reader
 {
  public:
   ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
+    override
   {
     return read_code_unsigned_integer (memaddr, len, byte_order);
   }
@@ -243,7 +244,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
 
       insn = reader.read (start, 4, byte_order_for_code);
 
-      if (aarch64_decode_insn (insn, &inst, 1) != 0)
+      if (aarch64_decode_insn (insn, &inst, 1, NULL) != 0)
        break;
 
       if (inst.opcode->iclass == addsub_imm
@@ -505,6 +506,7 @@ public:
   {}
 
   ULONGEST read (CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
+    override
   {
     SELF_CHECK (len == 4);
     SELF_CHECK (memaddr % 4 == 0);
@@ -1269,7 +1271,7 @@ pass_in_v (struct gdbarch *gdbarch,
       /* PCS C.1, the argument is allocated to the least significant
         bits of V register.  */
       memcpy (reg, buf, len);
-      regcache_cooked_write (regcache, regnum, reg);
+      regcache->cooked_write (regnum, reg);
 
       if (aarch64_debug)
        {
@@ -1790,7 +1792,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
       bfd_byte buf[V_REGISTER_SIZE];
       int len = TYPE_LENGTH (type);
 
-      regcache_cooked_read (regs, AARCH64_V0_REGNUM, buf);
+      regs->cooked_read (AARCH64_V0_REGNUM, buf);
       memcpy (valbuf, buf, len);
     }
   else if (TYPE_CODE (type) == TYPE_CODE_INT
@@ -1826,10 +1828,10 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
       int len = TYPE_LENGTH (target_type);
 
-      regcache_cooked_read (regs, regno, buf);
+      regs->cooked_read (regno, buf);
       memcpy (valbuf, buf, len);
       valbuf += len;
-      regcache_cooked_read (regs, regno + 1, buf);
+      regs->cooked_read (regno + 1, buf);
       memcpy (valbuf, buf, len);
       valbuf += len;
     }
@@ -1851,7 +1853,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
                            i + 1,
                            gdbarch_register_name (gdbarch, regno));
            }
-         regcache_cooked_read (regs, regno, buf);
+         regs->cooked_read (regno, buf);
 
          memcpy (valbuf, buf, len);
          valbuf += len;
@@ -1863,7 +1865,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
       /* Short vector is returned in V register.  */
       gdb_byte buf[V_REGISTER_SIZE];
 
-      regcache_cooked_read (regs, AARCH64_V0_REGNUM, buf);
+      regs->cooked_read (AARCH64_V0_REGNUM, buf);
       memcpy (valbuf, buf, TYPE_LENGTH (type));
     }
   else
@@ -1877,7 +1879,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
 
       while (len > 0)
        {
-         regcache_cooked_read (regs, regno++, buf);
+         regs->cooked_read (regno++, buf);
          memcpy (valbuf, buf, len > X_REGISTER_SIZE ? X_REGISTER_SIZE : len);
          len -= X_REGISTER_SIZE;
          valbuf += X_REGISTER_SIZE;
@@ -1929,7 +1931,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
       int len = TYPE_LENGTH (type);
 
       memcpy (buf, valbuf, len > V_REGISTER_SIZE ? V_REGISTER_SIZE : len);
-      regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf);
+      regs->cooked_write (AARCH64_V0_REGNUM, buf);
     }
   else if (TYPE_CODE (type) == TYPE_CODE_INT
           || TYPE_CODE (type) == TYPE_CODE_CHAR
@@ -1946,7 +1948,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
          LONGEST val = unpack_long (type, valbuf);
 
          store_signed_integer (tmpbuf, X_REGISTER_SIZE, byte_order, val);
-         regcache_cooked_write (regs, AARCH64_X0_REGNUM, tmpbuf);
+         regs->cooked_write (AARCH64_X0_REGNUM, tmpbuf);
        }
       else
        {
@@ -1958,7 +1960,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
 
          while (len > 0)
            {
-             regcache_cooked_write (regs, regno++, valbuf);
+             regs->cooked_write (regno++, valbuf);
              len -= X_REGISTER_SIZE;
              valbuf += X_REGISTER_SIZE;
            }
@@ -1984,7 +1986,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
            }
 
          memcpy (tmpbuf, valbuf, len);
-         regcache_cooked_write (regs, regno, tmpbuf);
+         regs->cooked_write (regno, tmpbuf);
          valbuf += len;
        }
     }
@@ -1995,7 +1997,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
       gdb_byte buf[V_REGISTER_SIZE];
 
       memcpy (buf, valbuf, TYPE_LENGTH (type));
-      regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf);
+      regs->cooked_write (AARCH64_V0_REGNUM, buf);
     }
   else
     {
@@ -2010,7 +2012,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
        {
          memcpy (tmpbuf, valbuf,
                  len > X_REGISTER_SIZE ? X_REGISTER_SIZE : len);
-         regcache_cooked_write (regs, regno++, tmpbuf);
+         regs->cooked_write (regno++, tmpbuf);
          len -= X_REGISTER_SIZE;
          valbuf += X_REGISTER_SIZE;
        }
@@ -2225,7 +2227,7 @@ aarch64_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
 
 static struct value *
 aarch64_pseudo_read_value (struct gdbarch *gdbarch,
-                          struct regcache *regcache,
+                          readable_regcache *regcache,
                           int regnum)
 {
   gdb_byte reg_buf[V_REGISTER_SIZE];
@@ -2245,7 +2247,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
       unsigned v_regnum;
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_Q0_REGNUM;
-      status = regcache_raw_read (regcache, v_regnum, reg_buf);
+      status = regcache->raw_read (v_regnum, reg_buf);
       if (status != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0,
                                      TYPE_LENGTH (value_type (result_value)));
@@ -2260,7 +2262,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
       unsigned v_regnum;
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_D0_REGNUM;
-      status = regcache_raw_read (regcache, v_regnum, reg_buf);
+      status = regcache->raw_read (v_regnum, reg_buf);
       if (status != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0,
                                      TYPE_LENGTH (value_type (result_value)));
@@ -2275,7 +2277,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
       unsigned v_regnum;
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_S0_REGNUM;
-      status = regcache_raw_read (regcache, v_regnum, reg_buf);
+      status = regcache->raw_read (v_regnum, reg_buf);
       if (status != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0,
                                      TYPE_LENGTH (value_type (result_value)));
@@ -2290,7 +2292,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
       unsigned v_regnum;
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_H0_REGNUM;
-      status = regcache_raw_read (regcache, v_regnum, reg_buf);
+      status = regcache->raw_read (v_regnum, reg_buf);
       if (status != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0,
                                      TYPE_LENGTH (value_type (result_value)));
@@ -2305,7 +2307,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch,
       unsigned v_regnum;
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_B0_REGNUM;
-      status = regcache_raw_read (regcache, v_regnum, reg_buf);
+      status = regcache->raw_read (v_regnum, reg_buf);
       if (status != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0,
                                      TYPE_LENGTH (value_type (result_value)));
@@ -2340,7 +2342,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_Q0_REGNUM;
       memcpy (reg_buf, buf, Q_REGISTER_SIZE);
-      regcache_raw_write (regcache, v_regnum, reg_buf);
+      regcache->raw_write (v_regnum, reg_buf);
       return;
     }
 
@@ -2351,7 +2353,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_D0_REGNUM;
       memcpy (reg_buf, buf, D_REGISTER_SIZE);
-      regcache_raw_write (regcache, v_regnum, reg_buf);
+      regcache->raw_write (v_regnum, reg_buf);
       return;
     }
 
@@ -2361,7 +2363,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_S0_REGNUM;
       memcpy (reg_buf, buf, S_REGISTER_SIZE);
-      regcache_raw_write (regcache, v_regnum, reg_buf);
+      regcache->raw_write (v_regnum, reg_buf);
       return;
     }
 
@@ -2372,7 +2374,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_H0_REGNUM;
       memcpy (reg_buf, buf, H_REGISTER_SIZE);
-      regcache_raw_write (regcache, v_regnum, reg_buf);
+      regcache->raw_write (v_regnum, reg_buf);
       return;
     }
 
@@ -2383,7 +2385,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
       v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_B0_REGNUM;
       memcpy (reg_buf, buf, B_REGISTER_SIZE);
-      regcache_raw_write (regcache, v_regnum, reg_buf);
+      regcache->raw_write (v_regnum, reg_buf);
       return;
     }
 
@@ -2423,7 +2425,7 @@ aarch64_software_single_step (struct regcache *regcache)
   int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed).  */
   aarch64_inst inst;
 
-  if (aarch64_decode_insn (insn, &inst, 1) != 0)
+  if (aarch64_decode_insn (insn, &inst, 1, NULL) != 0)
     return {};
 
   /* Look for a Load Exclusive instruction which begins the sequence.  */
@@ -2436,7 +2438,7 @@ aarch64_software_single_step (struct regcache *regcache)
       insn = read_memory_unsigned_integer (loc, insn_size,
                                           byte_order_for_code);
 
-      if (aarch64_decode_insn (insn, &inst, 1) != 0)
+      if (aarch64_decode_insn (insn, &inst, 1, NULL) != 0)
        return {};
       /* Check if the instruction is a conditional branch.  */
       if (inst.opcode->iclass == condbranch)
@@ -2729,7 +2731,7 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
   struct aarch64_displaced_step_data dsd;
   aarch64_inst inst;
 
-  if (aarch64_decode_insn (insn, &inst, 1) != 0)
+  if (aarch64_decode_insn (insn, &inst, 1, NULL) != 0)
     return NULL;
 
   /* Look for a Load Exclusive instruction which begins the sequence.  */
@@ -2970,11 +2972,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_tdesc_pseudo_register_reggroup_p (gdbarch,
                                        aarch64_pseudo_register_reggroup_p);
 
-  /* The top byte of an address is known as the "tag" and is
-     ignored by the kernel, the hardware, etc. and can be regarded
-     as additional data associated with the address.  */
-  set_gdbarch_significant_addr_bit (gdbarch, 56);
-
   /* ABI */
   set_gdbarch_short_bit (gdbarch, 16);
   set_gdbarch_int_bit (gdbarch, 32);
This page took 0.029969 seconds and 4 git commands to generate.