Fix build error in gdb/rocm-tdep.c
[deliverable/binutils-gdb.git] / gdb / s390-linux-tdep.c
index 9d1351946ea78c6da250786577b88b6e039a05a3..65de277319481df0dad739b284b070d2aa50bd69 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for GNU/Linux on s390.
 
-   Copyright (C) 2001-2018 Free Software Foundation, Inc.
+   Copyright (C) 2001-2020 Free Software Foundation, Inc.
 
    Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
    for IBM Deutschland Entwicklung GmbH, IBM Corporation.
@@ -42,7 +42,6 @@
 #include "trad-frame.h"
 #include "xml-syscall.h"
 
-#include "features/s390-linux32.c"
 #include "features/s390-linux32v1.c"
 #include "features/s390-linux32v2.c"
 #include "features/s390-linux64.c"
@@ -52,7 +51,6 @@
 #include "features/s390-vx-linux64.c"
 #include "features/s390-tevx-linux64.c"
 #include "features/s390-gs-linux64.c"
-#include "features/s390x-linux64.c"
 #include "features/s390x-linux64v1.c"
 #include "features/s390x-linux64v2.c"
 #include "features/s390x-te-linux64.c"
@@ -275,21 +273,22 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
   const int gregset_size = (tdep->abi == ABI_LINUX_S390 ?
                            s390_sizeof_gregset : s390x_sizeof_gregset);
 
-  cb (".reg", gregset_size, &s390_gregset, NULL, cb_data);
-  cb (".reg2", s390_sizeof_fpregset, &s390_fpregset, NULL, cb_data);
+  cb (".reg", gregset_size, gregset_size, &s390_gregset, NULL, cb_data);
+  cb (".reg2", s390_sizeof_fpregset, s390_sizeof_fpregset, &s390_fpregset, NULL,
+      cb_data);
 
   if (tdep->abi == ABI_LINUX_S390 && tdep->gpr_full_regnum != -1)
-    cb (".reg-s390-high-gprs", 16 * 4, &s390_upper_regset,
+    cb (".reg-s390-high-gprs", 16 * 4, 16 * 4, &s390_upper_regset,
        "s390 GPR upper halves", cb_data);
 
   if (tdep->have_linux_v1)
-    cb (".reg-s390-last-break", 8,
+    cb (".reg-s390-last-break", 8, 8,
        (gdbarch_ptr_bit (gdbarch) == 32
         ? &s390_last_break_regset : &s390x_last_break_regset),
        "s390 last-break address", cb_data);
 
   if (tdep->have_linux_v2)
-    cb (".reg-s390-system-call", 4, &s390_system_call_regset,
+    cb (".reg-s390-system-call", 4, 4, &s390_system_call_regset,
        "s390 system-call", cb_data);
 
   /* If regcache is set, we are in "write" (gcore) mode.  In this
@@ -297,16 +296,16 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
      available.  */
   if (tdep->have_tdb
       && (regcache == NULL
-         || REG_VALID == regcache_register_status (regcache,
-                                                   S390_TDB_DWORD0_REGNUM)))
-    cb (".reg-s390-tdb", s390_sizeof_tdbregset, &s390_tdb_regset,
-       "s390 TDB", cb_data);
+         || (REG_VALID
+             == regcache->get_register_status (S390_TDB_DWORD0_REGNUM))))
+    cb (".reg-s390-tdb", s390_sizeof_tdbregset, s390_sizeof_tdbregset,
+       &s390_tdb_regset, "s390 TDB", cb_data);
 
   if (tdep->v0_full_regnum != -1)
     {
-      cb (".reg-s390-vxrs-low", 16 * 8, &s390_vxrs_low_regset,
+      cb (".reg-s390-vxrs-low", 16 * 8, 16 * 8, &s390_vxrs_low_regset,
          "s390 vector registers 0-15 lower half", cb_data);
-      cb (".reg-s390-vxrs-high", 16 * 16, &s390_vxrs_high_regset,
+      cb (".reg-s390-vxrs-high", 16 * 16, 16 * 16, &s390_vxrs_high_regset,
          "s390 vector registers 16-31", cb_data);
     }
 
@@ -315,15 +314,13 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
   if (tdep->have_gs)
     {
       if (regcache == NULL
-         || REG_VALID == regcache_register_status (regcache,
-                                                   S390_GSD_REGNUM))
-       cb (".reg-s390-gs-cb", 4 * 8, &s390_gs_regset,
+         || REG_VALID == regcache->get_register_status (S390_GSD_REGNUM))
+       cb (".reg-s390-gs-cb", 4 * 8, 4 * 8, &s390_gs_regset,
            "s390 guarded-storage registers", cb_data);
 
       if (regcache == NULL
-         || REG_VALID == regcache_register_status (regcache,
-                                                   S390_BC_GSD_REGNUM))
-       cb (".reg-s390-gs-bc", 4 * 8, &s390_gsbc_regset,
+         || REG_VALID == regcache->get_register_status (S390_BC_GSD_REGNUM))
+       cb (".reg-s390-gs-bc", 4 * 8, 4 * 8, &s390_gsbc_regset,
            "s390 guarded-storage broadcast control", cb_data);
     }
 }
@@ -335,10 +332,9 @@ s390_core_read_description (struct gdbarch *gdbarch,
                            struct target_ops *target, bfd *abfd)
 {
   asection *section = bfd_get_section_by_name (abfd, ".reg");
-  CORE_ADDR hwcap = 0;
+  CORE_ADDR hwcap = linux_get_hwcap (target);
   bool high_gprs, v1, v2, te, vx, gs;
 
-  target_auxv_search (target, AT_HWCAP, &hwcap);
   if (!section)
     return NULL;
 
@@ -350,7 +346,7 @@ s390_core_read_description (struct gdbarch *gdbarch,
   te = (hwcap & HWCAP_S390_TE);
   gs = (hwcap & HWCAP_S390_GS);
 
-  switch (bfd_section_size (abfd, section))
+  switch (bfd_section_size (section))
     {
     case s390_sizeof_gregset:
       if (high_gprs)
@@ -561,9 +557,9 @@ static const struct frame_unwind s390_sigtramp_frame_unwind = {
 
 static LONGEST
 s390_linux_get_syscall_number (struct gdbarch *gdbarch,
-                              ptid_t ptid)
+                              thread_info *thread)
 {
-  struct regcache *regs = get_thread_regcache (ptid);
+  struct regcache *regs = get_thread_regcache (thread);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   ULONGEST pc;
@@ -1154,13 +1150,9 @@ s390_linux_init_abi_any (struct gdbarch_info info, struct gdbarch *gdbarch)
 static void
 s390_linux_init_abi_31 (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  const struct target_desc *tdesc = info.target_desc;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   tdep->abi = ABI_LINUX_S390;
-  if (!tdesc_has_registers (tdesc))
-    tdesc = tdesc_s390_linux32;
-  tdep->tdesc = tdesc;
 
   s390_linux_init_abi_any (info, gdbarch);
 
@@ -1174,13 +1166,9 @@ s390_linux_init_abi_31 (struct gdbarch_info info, struct gdbarch *gdbarch)
 static void
 s390_linux_init_abi_64 (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  const struct target_desc *tdesc = info.target_desc;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   tdep->abi = ABI_LINUX_ZSERIES;
-  if (!tdesc_has_registers (tdesc))
-    tdesc = tdesc_s390x_linux64;
-  tdep->tdesc = tdesc;
 
   s390_linux_init_abi_any (info, gdbarch);
 
@@ -1199,7 +1187,6 @@ _initialize_s390_linux_tdep (void)
                          s390_linux_init_abi_64);
 
   /* Initialize the GNU/Linux target descriptions.  */
-  initialize_tdesc_s390_linux32 ();
   initialize_tdesc_s390_linux32v1 ();
   initialize_tdesc_s390_linux32v2 ();
   initialize_tdesc_s390_linux64 ();
@@ -1209,7 +1196,6 @@ _initialize_s390_linux_tdep (void)
   initialize_tdesc_s390_vx_linux64 ();
   initialize_tdesc_s390_tevx_linux64 ();
   initialize_tdesc_s390_gs_linux64 ();
-  initialize_tdesc_s390x_linux64 ();
   initialize_tdesc_s390x_linux64v1 ();
   initialize_tdesc_s390x_linux64v2 ();
   initialize_tdesc_s390x_te_linux64 ();
This page took 0.026234 seconds and 4 git commands to generate.