Split size in regset section iterators
authorAlan Hayward <alan.hayward@arm.com>
Mon, 13 Aug 2018 09:04:11 +0000 (10:04 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Mon, 13 Aug 2018 09:16:41 +0000 (10:16 +0100)
In the existing code, when using the regset section iteration functions, the
size parameter is used in different ways.

With collect, size is used to create the buffer in which to write the regset.
(see linux-tdep.c::linux_collect_regset_section_cb).

With supply, size is used to confirm the existing regset is the correct size.
If REGSET_VARIABLE_SIZE is set then the regset can be bigger than size.
Effectively, size is the minimum possible size of the regset.
(see corelow.c::get_core_register_section).

There are currently no targets with both REGSET_VARIABLE_SIZE and a collect
function.
In SVE, a corefile can contain one of two formats after the header, both of
which are different sizes. However, when writing a core file, we always want
to write out the full bigger size.

To allow support of collects for REGSET_VARIABLE_SIZE we need two sizes.
This is done by adding supply_size and collect_size.

gdb/

* aarch64-fbsd-tdep.c
(aarch64_fbsd_iterate_over_regset_sections): Add supply_size and
collect_size.
* aarch64-linux-tdep.c
(aarch64_linux_iterate_over_regset_sections): Likewise.
* alpha-linux-tdep.c
(alpha_linux_iterate_over_regset_sections):
* alpha-nbsd-tdep.c
(alphanbsd_iterate_over_regset_sections): Likewise.
* amd64-fbsd-tdep.c
(amd64fbsd_iterate_over_regset_sections): Likewise.
* amd64-linux-tdep.c
(amd64_linux_iterate_over_regset_sections): Likewise.
* arm-bsd-tdep.c
(armbsd_iterate_over_regset_sections): Likewise.
* arm-fbsd-tdep.c
(arm_fbsd_iterate_over_regset_sections): Likewise.
* arm-linux-tdep.c
(arm_linux_iterate_over_regset_sections): Likewise.
* corelow.c (get_core_registers_cb): Likewise.
(core_target::fetch_registers): Likewise.
* fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise.
* frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise.
* gdbarch.h (void): Regenerate.
* gdbarch.sh: Add supply_size and collect_size.
* hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise.
* hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise.
* hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise.
* i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise.
* i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
* i386-tdep.c (i386_iterate_over_regset_sections): Likewise.
* ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise.
* linux-tdep.c (linux_collect_regset_section_cb): Likewise.
* m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise.
* m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise.
* m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise.
* mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise.
* mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise.
* mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise.
* mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise.
* mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise.
* nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise.
* ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise.
* ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise.
* ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise.
* ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise.
* riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise.
* rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise.
* s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise.
* score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise.
* sh-tdep.c (sh_iterate_over_regset_sections): Likewise.
* sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise.
* tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise.
* vax-tdep.c (vax_iterate_over_regset_sections): Likewise.
* xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.

45 files changed:
gdb/ChangeLog
gdb/aarch64-fbsd-tdep.c
gdb/aarch64-linux-tdep.c
gdb/alpha-linux-tdep.c
gdb/alpha-nbsd-tdep.c
gdb/amd64-fbsd-tdep.c
gdb/amd64-linux-tdep.c
gdb/arm-bsd-tdep.c
gdb/arm-fbsd-tdep.c
gdb/arm-linux-tdep.c
gdb/corelow.c
gdb/fbsd-tdep.c
gdb/frv-linux-tdep.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/hppa-linux-tdep.c
gdb/hppa-nbsd-tdep.c
gdb/hppa-obsd-tdep.c
gdb/i386-fbsd-tdep.c
gdb/i386-linux-tdep.c
gdb/i386-tdep.c
gdb/ia64-linux-tdep.c
gdb/linux-tdep.c
gdb/m32r-linux-tdep.c
gdb/m68k-bsd-tdep.c
gdb/m68k-linux-tdep.c
gdb/mips-fbsd-tdep.c
gdb/mips-linux-tdep.c
gdb/mips-nbsd-tdep.c
gdb/mips64-obsd-tdep.c
gdb/mn10300-linux-tdep.c
gdb/nios2-linux-tdep.c
gdb/ppc-fbsd-tdep.c
gdb/ppc-linux-tdep.c
gdb/ppc-nbsd-tdep.c
gdb/ppc-obsd-tdep.c
gdb/riscv-linux-tdep.c
gdb/rs6000-aix-tdep.c
gdb/s390-linux-tdep.c
gdb/score-tdep.c
gdb/sh-tdep.c
gdb/sparc-tdep.c
gdb/tilegx-linux-tdep.c
gdb/vax-tdep.c
gdb/xtensa-tdep.c

index 8559185eb89a843fbcaafad0af47cbfa6f8dc09f..1076433676ef9040596807583297a72c82ab4a43 100644 (file)
@@ -1,3 +1,61 @@
+2018-08-13  Alan Hayward  <alan.hayward@arm.com>
+
+       * aarch64-fbsd-tdep.c
+       (aarch64_fbsd_iterate_over_regset_sections): Add supply_size and
+       collect_size.
+       * aarch64-linux-tdep.c
+       (aarch64_linux_iterate_over_regset_sections): Likewise.
+       * alpha-linux-tdep.c
+       (alpha_linux_iterate_over_regset_sections):
+       * alpha-nbsd-tdep.c
+       (alphanbsd_iterate_over_regset_sections): Likewise.
+       * amd64-fbsd-tdep.c
+       (amd64fbsd_iterate_over_regset_sections): Likewise.
+       * amd64-linux-tdep.c
+       (amd64_linux_iterate_over_regset_sections): Likewise.
+       * arm-bsd-tdep.c
+       (armbsd_iterate_over_regset_sections): Likewise.
+       * arm-fbsd-tdep.c
+       (arm_fbsd_iterate_over_regset_sections): Likewise.
+       * arm-linux-tdep.c
+       (arm_linux_iterate_over_regset_sections): Likewise.
+       * corelow.c (get_core_registers_cb): Likewise.
+       (core_target::fetch_registers): Likewise.
+       * fbsd-tdep.c (fbsd_collect_regset_section_cb): Likewise.
+       * frv-linux-tdep.c (frv_linux_iterate_over_regset_sections): Likewise.
+       * gdbarch.h (void): Regenerate.
+       * gdbarch.sh: Add supply_size and collect_size.
+       * hppa-linux-tdep.c (hppa_linux_iterate_over_regset_sections): Likewise.
+       * hppa-nbsd-tdep.c (hppanbsd_iterate_over_regset_sections): Likewise.
+       * hppa-obsd-tdep.c (hppaobsd_iterate_over_regset_sections): Likewise.
+       * i386-fbsd-tdep.c (i386fbsd_iterate_over_regset_sections): Likewise.
+       * i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
+       * i386-tdep.c (i386_iterate_over_regset_sections): Likewise.
+       * ia64-linux-tdep.c (ia64_linux_iterate_over_regset_sections): Likewise.
+       * linux-tdep.c (linux_collect_regset_section_cb): Likewise.
+       * m32r-linux-tdep.c (m32r_linux_iterate_over_regset_sections): Likewise.
+       * m68k-bsd-tdep.c (m68kbsd_iterate_over_regset_sections): Likewise.
+       * m68k-linux-tdep.c (m68k_linux_iterate_over_regset_sections): Likewise.
+       * mips-fbsd-tdep.c (mips_fbsd_iterate_over_regset_sections): Likewise.
+       * mips-linux-tdep.c (mips_linux_iterate_over_regset_sections): Likewise.
+       * mips-nbsd-tdep.c (mipsnbsd_iterate_over_regset_sections): Likewise.
+       * mips64-obsd-tdep.c (mips64obsd_iterate_over_regset_sections): Likewise.
+       * mn10300-linux-tdep.c (am33_iterate_over_regset_sections): Likewise.
+       * nios2-linux-tdep.c (nios2_iterate_over_regset_sections): Likewise.
+       * ppc-fbsd-tdep.c (ppcfbsd_iterate_over_regset_sections): Likewise.
+       * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections): Likewise.
+       * ppc-nbsd-tdep.c (ppcnbsd_iterate_over_regset_sections): Likewise.
+       * ppc-obsd-tdep.c (ppcobsd_iterate_over_regset_sections): Likewise.
+       * riscv-linux-tdep.c (riscv_linux_iterate_over_regset_sections): Likewise.
+       * rs6000-aix-tdep.c (rs6000_aix_iterate_over_regset_sections): Likewise.
+       * s390-linux-tdep.c (s390_iterate_over_regset_sections): Likewise.
+       * score-tdep.c (score7_linux_iterate_over_regset_sections): Likewise.
+       * sh-tdep.c (sh_iterate_over_regset_sections): Likewise.
+       * sparc-tdep.c (sparc_iterate_over_regset_sections): Likewise.
+       * tilegx-linux-tdep.c (tilegx_iterate_over_regset_sections): Likewise.
+       * vax-tdep.c (vax_iterate_over_regset_sections): Likewise.
+       * xtensa-tdep.c (xtensa_iterate_over_regset_sections): Likewise.
+
 2018-08-10  Simon Marchi  <simon.marchi@ericsson.com>
 
        * nat/linux-osdata.c (commandline_from_pid): Replace xstrprintf
index 21beb5b77c87e9062e574b25bd1497032a20fb52..9f8b1366ce1acd45940c307deafad49518288353 100644 (file)
@@ -169,10 +169,10 @@ aarch64_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                           void *cb_data,
                                           const struct regcache *regcache)
 {
-  cb (".reg", AARCH64_FBSD_SIZEOF_GREGSET, &aarch64_fbsd_gregset,
-      NULL, cb_data);
-  cb (".reg2", AARCH64_FBSD_SIZEOF_FPREGSET, &aarch64_fbsd_fpregset,
-      NULL, cb_data);
+  cb (".reg", AARCH64_FBSD_SIZEOF_GREGSET, AARCH64_FBSD_SIZEOF_GREGSET,
+      &aarch64_fbsd_gregset, NULL, cb_data);
+  cb (".reg2", AARCH64_FBSD_SIZEOF_FPREGSET, AARCH64_FBSD_SIZEOF_FPREGSET,
+      &aarch64_fbsd_fpregset, NULL, cb_data);
 }
 
 /* Implement the 'init_osabi' method of struct gdb_osabi_handler.  */
index 93b6d416a3e43300c1eaa2e1e807b60160e232c9..7b63cddbe66ae0e22d89fb04a7365fb12f797e6a 100644 (file)
@@ -227,10 +227,10 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                            void *cb_data,
                                            const struct regcache *regcache)
 {
-  cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset,
-      NULL, cb_data);
-  cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset,
-      NULL, cb_data);
+  cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, AARCH64_LINUX_SIZEOF_GREGSET,
+      &aarch64_linux_gregset, NULL, cb_data);
+  cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, AARCH64_LINUX_SIZEOF_FPREGSET,
+      &aarch64_linux_fpregset, NULL, cb_data);
 }
 
 /* Implement the "core_read_description" gdbarch method.  SVE not yet
index 8bacb10aa113b39190af59f0e0ffe10c1a780e95..913a42040184649229b41da4986056786c021287 100644 (file)
@@ -238,8 +238,8 @@ alpha_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                          void *cb_data,
                                          const struct regcache *regcache)
 {
-  cb (".reg", 32 * 8, &alpha_linux_gregset, NULL, cb_data);
-  cb (".reg2", 32 * 8, &alpha_linux_fpregset, NULL, cb_data);
+  cb (".reg", 32 * 8, 32 * 8, &alpha_linux_gregset, NULL, cb_data);
+  cb (".reg2", 32 * 8, 32 * 8, &alpha_linux_fpregset, NULL, cb_data);
 }
 
 /* Implementation of `gdbarch_gdb_signal_from_target', as defined in
index dffab3fb37fa6b2e9e9e1bbfefed204f76870184..694e3d35559065770b86a4a162d28e25e0dafce7 100644 (file)
@@ -161,8 +161,10 @@ alphanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                        void *cb_data,
                                        const struct regcache *regcache)
 {
-  cb (".reg", ALPHANBSD_SIZEOF_GREGS, &alphanbsd_gregset, NULL, cb_data);
-  cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, &alphanbsd_fpregset, NULL, cb_data);
+  cb (".reg", ALPHANBSD_SIZEOF_GREGS, ALPHANBSD_SIZEOF_GREGS,
+      &alphanbsd_gregset, NULL, cb_data);
+  cb (".reg2", ALPHANBSD_SIZEOF_FPREGS, ALPHANBSD_SIZEOF_FPREGS,
+      &alphanbsd_fpregset, NULL, cb_data);
 }
 \f
 
index f5bf1985b67e0f2ef88c5d3604c144e90572a4fa..7f7ecfcf113e3247d0a0031f86201bfd0c3bcbdd 100644 (file)
@@ -196,9 +196,11 @@ amd64fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
-  cb (".reg2", tdep->sizeof_fpregset, &amd64_fpregset, NULL, cb_data);
-  cb (".reg-xstate", X86_XSTATE_SIZE(tdep->xcr0),
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
+      cb_data);
+  cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, &amd64_fpregset,
+      NULL, cb_data);
+  cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0),
       &amd64fbsd_xstateregset, "XSAVE extended state", cb_data);
 }
 
index 7fe37d83f696bf2f3ebeff372488729879a7ae52..7ab43897ab3800d20acfddf9e0aef84228017934 100644 (file)
@@ -1651,9 +1651,9 @@ amd64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", 27 * 8, &i386_gregset, NULL, cb_data);
-  cb (".reg2", 512, &amd64_fpregset, NULL, cb_data);
-  cb (".reg-xstate",  X86_XSTATE_SIZE (tdep->xcr0),
+  cb (".reg", 27 * 8, 27 * 8, &i386_gregset, NULL, cb_data);
+  cb (".reg2", 512, 512, &amd64_fpregset, NULL, cb_data);
+  cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0), X86_XSTATE_SIZE (tdep->xcr0),
       &amd64_linux_xstateregset, "XSAVE extended state", cb_data);
 }
 
index a2719caa4c53e665647463d13e46582a06cebdbb..8025ab3dee2418eaaa6e2863c24e23a29d3cd9cc 100644 (file)
@@ -117,6 +117,8 @@ armbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                     void *cb_data,
                                     const struct regcache *regcache)
 {
-  cb (".reg", ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL, cb_data);
-  cb (".reg2", ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset, NULL, cb_data);
+  cb (".reg", ARMBSD_SIZEOF_GREGS, ARMBSD_SIZEOF_GREGS, &armbsd_gregset, NULL,
+      cb_data);
+  cb (".reg2", ARMBSD_SIZEOF_FPREGS, ARMBSD_SIZEOF_FPREGS, &armbsd_fpregset,
+      NULL, cb_data);
 }
index 4ad3abdffafad8a9a3250a73d8b6345b8e6c9562..d2af21bf2c2d17c0301c3ca9c566371afa8c1e79 100644 (file)
@@ -175,14 +175,15 @@ arm_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", ARM_FBSD_SIZEOF_GREGSET, &arm_fbsd_gregset, NULL, cb_data);
+  cb (".reg", ARM_FBSD_SIZEOF_GREGSET, ARM_FBSD_SIZEOF_GREGSET,
+      &arm_fbsd_gregset, NULL, cb_data);
 
   /* While FreeBSD/arm cores do contain a NT_FPREGSET / ".reg2"
      register set, it is not populated with register values by the
      kernel but just contains all zeroes.  */
   if (tdep->vfp_register_count > 0)
-    cb (".reg-arm-vfp", ARM_FBSD_SIZEOF_VFPREGSET, &arm_fbsd_vfpregset,
-       "VFP floating-point", cb_data);
+    cb (".reg-arm-vfp", ARM_FBSD_SIZEOF_VFPREGSET, ARM_FBSD_SIZEOF_VFPREGSET,
+       &arm_fbsd_vfpregset, "VFP floating-point", cb_data);
 }
 
 /* Lookup a target description from a target's AT_HWCAP auxiliary
index 264e8ca42b2ee70f6fe43cd90b4c36c45f5e62ea..4c5a4bc32b93258e2c4f941de3b88849a712452c 100644 (file)
@@ -712,14 +712,15 @@ arm_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", ARM_LINUX_SIZEOF_GREGSET, &arm_linux_gregset, NULL, cb_data);
+  cb (".reg", ARM_LINUX_SIZEOF_GREGSET, ARM_LINUX_SIZEOF_GREGSET,
+      &arm_linux_gregset, NULL, cb_data);
 
   if (tdep->vfp_register_count > 0)
-    cb (".reg-arm-vfp", ARM_LINUX_SIZEOF_VFP, &arm_linux_vfpregset,
-       "VFP floating-point", cb_data);
+    cb (".reg-arm-vfp", ARM_LINUX_SIZEOF_VFP, ARM_LINUX_SIZEOF_VFP,
+       &arm_linux_vfpregset, "VFP floating-point", cb_data);
   else if (tdep->have_fpa_registers)
-    cb (".reg2", ARM_LINUX_SIZEOF_NWFPE, &arm_linux_fpregset,
-       "FPA floating-point", cb_data);
+    cb (".reg2", ARM_LINUX_SIZEOF_NWFPE, ARM_LINUX_SIZEOF_NWFPE,
+       &arm_linux_fpregset, "FPA floating-point", cb_data);
 }
 
 /* Determine target description from core file.  */
index d3336cf7857e7dc995901fdf5860ad24493acc87..8e9ac9a32817d9dd3e6b25931fa314f741675a51 100644 (file)
@@ -636,12 +636,17 @@ struct get_core_registers_cb_data
    register note section. */
 
 static void
-get_core_registers_cb (const char *sect_name, int size,
+get_core_registers_cb (const char *sect_name, int supply_size, int collect_size,
                       const struct regset *regset,
                       const char *human_name, void *cb_data)
 {
   auto *data = (get_core_registers_cb_data *) cb_data;
   bool required = false;
+  bool variable_size_section = (regset != NULL
+                               && regset->flags & REGSET_VARIABLE_SIZE);
+
+  if (!variable_size_section)
+    gdb_assert (supply_size == collect_size);
 
   if (strcmp (sect_name, ".reg") == 0)
     {
@@ -658,7 +663,8 @@ get_core_registers_cb (const char *sect_name, int size,
   /* The 'which' parameter is only used when no regset is provided.
      Thus we just set it to -1. */
   data->target->get_core_register_section (data->regcache, regset, sect_name,
-                                          size, -1, human_name, required);
+                                          supply_size, -1, human_name,
+                                          required);
 }
 
 /* Get the registers out of a core file.  This is the machine-
index ac5b3bfa120b365e1c5bcf2b1bf2cd1680573986..78d0c3d830d05bef6576c54c9af71e298a6174ea 100644 (file)
@@ -428,8 +428,8 @@ struct fbsd_collect_regset_section_cb_data
 };
 
 static void
-fbsd_collect_regset_section_cb (const char *sect_name, int size,
-                               const struct regset *regset,
+fbsd_collect_regset_section_cb (const char *sect_name, int supply_size,
+                               int collect_size, const struct regset *regset,
                                const char *human_name, void *cb_data)
 {
   char *buf;
@@ -441,8 +441,8 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
 
   gdb_assert (regset->collect_regset);
 
-  buf = (char *) xmalloc (size);
-  regset->collect_regset (regset, data->regcache, -1, buf, size);
+  buf = (char *) xmalloc (collect_size);
+  regset->collect_regset (regset, data->regcache, -1, buf, collect_size);
 
   /* PRSTATUS still needs to be treated specially.  */
   if (strcmp (sect_name, ".reg") == 0)
@@ -452,7 +452,7 @@ fbsd_collect_regset_section_cb (const char *sect_name, int size,
   else
     data->note_data = (char *) elfcore_write_register_note
       (data->obfd, data->note_data, data->note_size,
-       sect_name, buf, size);
+       sect_name, buf, collect_size);
   xfree (buf);
 
   if (data->note_data == NULL)
index c47f1f24f0b479c314e807b389f7661a58c5d5e8..655c48d787be7b14b263531ec9f2773b91a98b09 100644 (file)
@@ -445,10 +445,10 @@ frv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                        void *cb_data,
                                        const struct regcache *regcache)
 {
-  cb (".reg", sizeof (frv_elf_gregset_t), &frv_linux_gregset,
-      NULL, cb_data);
-  cb (".reg2", sizeof (frv_elf_fpregset_t), &frv_linux_fpregset,
-      NULL, cb_data);
+  cb (".reg", sizeof (frv_elf_gregset_t), sizeof (frv_elf_gregset_t),
+      &frv_linux_gregset, NULL, cb_data);
+  cb (".reg2", sizeof (frv_elf_fpregset_t), sizeof (frv_elf_fpregset_t),
+      &frv_linux_fpregset, NULL, cb_data);
 }
 
 \f
index 0df1fd16926391b1f7dfab1810f5dfabf1e6fe2a..b563f8d165aafcaa6e1a011c7107e1ccf15884b5 100644 (file)
@@ -92,13 +92,15 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
 
 /* Callback type for regset section iterators.  The callback usually
    invokes the REGSET's supply or collect method, to which it must
-   pass a buffer with at least the given SIZE.  SECT_NAME is a BFD
-   section name, and HUMAN_NAME is used for diagnostic messages.
-   CB_DATA should have been passed unchanged through the iterator.  */
+   pass a buffer - for collects this buffer will need to be created using
+   COLLECT_SIZE, for supply the existing buffer being read from should
+   be at least SUPPLY_SIZE.  SECT_NAME is a BFD section name, and HUMAN_NAME
+   is used for diagnostic messages.  CB_DATA should have been passed
+   unchanged through the iterator.  */
 
 typedef void (iterate_over_regset_sections_cb)
-  (const char *sect_name, int size, const struct regset *regset,
-   const char *human_name, void *cb_data);
+  (const char *sect_name, int supply_size, int collect_size,
+   const struct regset *regset, const char *human_name, void *cb_data);
 
 
 /* The following are pre-initialized by GDBARCH.  */
index 447394381e24d23b51b275e276a50bafa1f3de0c..24a553b73c3737c1da82b247877b91f66c6db1f0 100755 (executable)
@@ -1316,13 +1316,15 @@ typedef int (iterate_over_objfiles_in_search_order_cb_ftype)
 
 /* Callback type for regset section iterators.  The callback usually
    invokes the REGSET's supply or collect method, to which it must
-   pass a buffer with at least the given SIZE.  SECT_NAME is a BFD
-   section name, and HUMAN_NAME is used for diagnostic messages.
-   CB_DATA should have been passed unchanged through the iterator.  */
+   pass a buffer - for collects this buffer will need to be created using
+   COLLECT_SIZE, for supply the existing buffer being read from should
+   be at least SUPPLY_SIZE.  SECT_NAME is a BFD section name, and HUMAN_NAME
+   is used for diagnostic messages.  CB_DATA should have been passed
+   unchanged through the iterator.  */
 
 typedef void (iterate_over_regset_sections_cb)
-  (const char *sect_name, int size, const struct regset *regset,
-   const char *human_name, void *cb_data);
+  (const char *sect_name, int supply_size, int collect_size,
+   const struct regset *regset, const char *human_name, void *cb_data);
 EOF
 
 # function typedef's
index 080fc0449beb1461f55f8fac81be697770c3b5fc..c4c169fe98987b79507c83d8f482b032f6cdbc19 100644 (file)
@@ -479,9 +479,9 @@ hppa_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", 80 * tdep->bytes_per_address, &hppa_linux_regset,
-      NULL, cb_data);
-  cb (".reg2", 64 * 4, &hppa_linux_fpregset, NULL, cb_data);
+  cb (".reg", 80 * tdep->bytes_per_address, 80 * tdep->bytes_per_address,
+      &hppa_linux_regset, NULL, cb_data);
+  cb (".reg2", 64 * 4, 64 * 4, &hppa_linux_fpregset, NULL, cb_data);
 }
 
 static void
index f9932b5b805e1d27618946916a4f200071ccc6d4..49bf17b1ccb96a8bafa4c9e7b495625ae4f56f15 100644 (file)
@@ -190,7 +190,8 @@ hppanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                       void *cb_data,
                                       const struct regcache *regcache)
 {
-  cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
+  cb (".reg", HPPANBSD_SIZEOF_GREGS, HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset,
+      NULL, cb_data);
 }
 \f
 static void
index 403e9ddc8279edfb15d1e05297a22d9ca2b25930..97d5a2bf0100785d98581c65af479bd8138504e6 100644 (file)
@@ -149,8 +149,10 @@ hppaobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                       void *cb_data,
                                       const struct regcache *regcache)
 {
-  cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data);
-  cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data);
+  cb (".reg", HPPAOBSD_SIZEOF_GREGS, HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset,
+      NULL, cb_data);
+  cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, HPPAOBSD_SIZEOF_FPREGS,
+      &hppaobsd_fpregset, NULL, cb_data);
 }
 \f
 
index ebc75a8d58588fb9252f15d4640880d3217a9c4c..22c8d4506b9c0d6b32df2ee0d281c0928afea939 100644 (file)
@@ -309,12 +309,15 @@ i386fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
-  cb (".reg2", tdep->sizeof_fpregset, &i386_fpregset, NULL, cb_data);
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
+      cb_data);
+  cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, &i386_fpregset,
+      NULL, cb_data);
 
   if (tdep->xcr0 & X86_XSTATE_AVX)
-    cb (".reg-xstate", X86_XSTATE_SIZE(tdep->xcr0),
-       &i386fbsd_xstateregset, "XSAVE extended state", cb_data);
+    cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
+       X86_XSTATE_SIZE (tdep->xcr0), &i386fbsd_xstateregset,
+       "XSAVE extended state", cb_data);
 }
 
 static void
index f5b039b7944fbaafb6275922b436ab83158ea75b..802c41fe7257aea18a0dba46896aa7e6a33fd81f 100644 (file)
@@ -764,16 +764,17 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", 68, &i386_gregset, NULL, cb_data);
+  cb (".reg", 68, 68, &i386_gregset, NULL, cb_data);
 
   if (tdep->xcr0 & X86_XSTATE_AVX)
     cb (".reg-xstate", X86_XSTATE_SIZE (tdep->xcr0),
-       &i386_linux_xstateregset, "XSAVE extended state", cb_data);
+       X86_XSTATE_SIZE (tdep->xcr0), &i386_linux_xstateregset,
+       "XSAVE extended state", cb_data);
   else if (tdep->xcr0 & X86_XSTATE_SSE)
-    cb (".reg-xfp", 512, &i386_fpregset, "extended floating-point",
+    cb (".reg-xfp", 512, 512, &i386_fpregset, "extended floating-point",
        cb_data);
   else
-    cb (".reg2", 108, &i386_fpregset, NULL, cb_data);
+    cb (".reg2", 108, 108, &i386_fpregset, NULL, cb_data);
 }
 
 /* Linux kernel shows PC value after the 'int $0x80' instruction even if
index b1d502f4827f366582c43e0a4936edc404cbc810..a6994aaf1266ba4e47c06f694dad2d320c3c758f 100644 (file)
@@ -3910,9 +3910,11 @@ i386_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, &i386_gregset, NULL, cb_data);
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
+      cb_data);
   if (tdep->sizeof_fpregset)
-    cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
+    cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset,
+       NULL, cb_data);
 }
 \f
 
index 19d0cf2debfd4f6854bc8034610ef1b6d1d27be6..0054f5a514050e53edf06cf6dcaaf0bd529ba1ee 100644 (file)
@@ -207,8 +207,10 @@ ia64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                         void *cb_data,
                                         const struct regcache *regcache)
 {
-  cb (".reg", IA64_LINUX_GREGS_SIZE, &ia64_linux_gregset, NULL, cb_data);
-  cb (".reg2", IA64_LINUX_FPREGS_SIZE, &ia64_linux_fpregset, NULL, cb_data);
+  cb (".reg", IA64_LINUX_GREGS_SIZE, IA64_LINUX_GREGS_SIZE, &ia64_linux_gregset,
+      NULL, cb_data);
+  cb (".reg2", IA64_LINUX_FPREGS_SIZE, IA64_LINUX_FPREGS_SIZE,
+      &ia64_linux_fpregset, NULL, cb_data);
 }
 
 static void
index 3cfa2a5aa48d18158e6a6427245b61d4cd0f3aa6..5801ab5222fae8c54461efa458f9992d2d79e522 100644 (file)
@@ -1579,21 +1579,26 @@ struct linux_collect_regset_section_cb_data
    regset in the corefile note section.  */
 
 static void
-linux_collect_regset_section_cb (const char *sect_name, int size,
-                                const struct regset *regset,
+linux_collect_regset_section_cb (const char *sect_name, int supply_size,
+                                int collect_size, const struct regset *regset,
                                 const char *human_name, void *cb_data)
 {
   char *buf;
   struct linux_collect_regset_section_cb_data *data
     = (struct linux_collect_regset_section_cb_data *) cb_data;
+  bool variable_size_section = (regset != NULL
+                               && regset->flags & REGSET_VARIABLE_SIZE);
+
+  if (!variable_size_section)
+    gdb_assert (supply_size == collect_size);
 
   if (data->abort_iteration)
     return;
 
   gdb_assert (regset && regset->collect_regset);
 
-  buf = (char *) xmalloc (size);
-  regset->collect_regset (regset, data->regcache, -1, buf, size);
+  buf = (char *) xmalloc (collect_size);
+  regset->collect_regset (regset, data->regcache, -1, buf, collect_size);
 
   /* PRSTATUS still needs to be treated specially.  */
   if (strcmp (sect_name, ".reg") == 0)
@@ -1603,7 +1608,7 @@ linux_collect_regset_section_cb (const char *sect_name, int size,
   else
     data->note_data = (char *) elfcore_write_register_note
       (data->obfd, data->note_data, data->note_size,
-       sect_name, buf, size);
+       sect_name, buf, collect_size);
   xfree (buf);
 
   if (data->note_data == NULL)
index be35b699c214ba019905568ff5638ef061e1bad0..aa441592a674e20ab2cf5587984da0b73ab9ebba 100644 (file)
@@ -440,7 +440,8 @@ m32r_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                         void *cb_data,
                                         const struct regcache *regcache)
 {
-  cb (".reg", M32R_LINUX_GREGS_SIZE, &m32r_linux_gregset, NULL, cb_data);
+  cb (".reg", M32R_LINUX_GREGS_SIZE, M32R_LINUX_GREGS_SIZE, &m32r_linux_gregset,
+      NULL, cb_data);
 }
 
 static void
index 2f53870b98db45cdc9235ebfeb3b069743e9df6e..0991407557db1ac32ff35374e10e426249686a7a 100644 (file)
@@ -123,8 +123,10 @@ m68kbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                      void *cb_data,
                                      const struct regcache *regcache)
 {
-  cb (".reg", M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset, NULL, cb_data);
-  cb (".reg2", M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset, NULL, cb_data);
+  cb (".reg", M68KBSD_SIZEOF_GREGS, M68KBSD_SIZEOF_GREGS, &m68kbsd_gregset,
+      NULL, cb_data);
+  cb (".reg2", M68KBSD_SIZEOF_FPREGS, M68KBSD_SIZEOF_FPREGS, &m68kbsd_fpregset,
+      NULL, cb_data);
 }
 \f
 
index 11cde0b09fdd9a5006559967ddb6a7e0398e1fcb..8ebf7913e58f036031df4ddc9ff6ef05668c7196 100644 (file)
@@ -374,8 +374,10 @@ m68k_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                         void *cb_data,
                                         const struct regcache *regcache)
 {
-  cb (".reg", M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset, NULL, cb_data);
-  cb (".reg2", M68K_LINUX_FPREGS_SIZE, &m68k_linux_fpregset, NULL, cb_data);
+  cb (".reg", M68K_LINUX_GREGS_SIZE, M68K_LINUX_GREGS_SIZE, &m68k_linux_gregset,
+      NULL, cb_data);
+  cb (".reg2", M68K_LINUX_FPREGS_SIZE, M68K_LINUX_FPREGS_SIZE,
+      &m68k_linux_fpregset, NULL, cb_data);
 }
 
 static void
index c3075b23fc1ae1bc6523d1a543da33e15fff6288..e341088702271343aae76251ebf606249baefe79 100644 (file)
@@ -245,10 +245,10 @@ mips_fbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   size_t regsize = mips_abi_regsize (gdbarch);
 
-  cb (".reg", MIPS_FBSD_NUM_GREGS * regsize, &mips_fbsd_gregset,
-      NULL, cb_data);
-  cb (".reg2", MIPS_FBSD_NUM_FPREGS * regsize, &mips_fbsd_fpregset,
-      NULL, cb_data);
+  cb (".reg", MIPS_FBSD_NUM_GREGS * regsize, MIPS_FBSD_NUM_GREGS * regsize,
+      &mips_fbsd_gregset, NULL, cb_data);
+  cb (".reg2", MIPS_FBSD_NUM_FPREGS * regsize, MIPS_FBSD_NUM_FPREGS * regsize,
+      &mips_fbsd_fpregset, NULL, cb_data);
 }
 
 /* Signal trampoline support.  */
index 71183d732511a5da6274fa4e23184ab0b74c51bb..44b2b2e29b778553376b8eb16310914f1756eddd 100644 (file)
@@ -537,16 +537,18 @@ mips_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   if (register_size (gdbarch, MIPS_ZERO_REGNUM) == 4)
     {
-      cb (".reg", sizeof (mips_elf_gregset_t), &mips_linux_gregset,
-         NULL, cb_data);
-      cb (".reg2", sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
+      cb (".reg", sizeof (mips_elf_gregset_t), sizeof (mips_elf_gregset_t),
+         &mips_linux_gregset, NULL, cb_data);
+      cb (".reg2", sizeof (mips64_elf_fpregset_t),
+         sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
          NULL, cb_data);
     }
   else
     {
-      cb (".reg", sizeof (mips64_elf_gregset_t), &mips64_linux_gregset,
-         NULL, cb_data);
-      cb (".reg2", sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
+      cb (".reg", sizeof (mips64_elf_gregset_t), sizeof (mips64_elf_gregset_t),
+         &mips64_linux_gregset, NULL, cb_data);
+      cb (".reg2", sizeof (mips64_elf_fpregset_t),
+         sizeof (mips64_elf_fpregset_t), &mips64_linux_fpregset,
          NULL, cb_data);
     }
 }
index 5f4db87498e7fec5e1d448bf5a50c9b3cce52d4c..5005a176b58d250505ba8d954006ea017e3eb03c 100644 (file)
@@ -123,10 +123,10 @@ mipsnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   size_t regsize = mips_isa_regsize (gdbarch);
 
-  cb (".reg", MIPSNBSD_NUM_GREGS * regsize, &mipsnbsd_gregset,
-      NULL, cb_data);
-  cb (".reg2", MIPSNBSD_NUM_FPREGS * regsize, &mipsnbsd_fpregset,
-      NULL, cb_data);
+  cb (".reg", MIPSNBSD_NUM_GREGS * regsize, MIPSNBSD_NUM_GREGS * regsize,
+      &mipsnbsd_gregset, NULL, cb_data);
+  cb (".reg2", MIPSNBSD_NUM_FPREGS * regsize, MIPSNBSD_NUM_FPREGS * regsize,
+      &mipsnbsd_fpregset, NULL, cb_data);
 }
 \f
 
index ab910edfc4ce08f7ba8aeb9db2bd7e0340a2fd4f..cbebe053f5c534769173a6a271f47d3b9a79bef1 100644 (file)
@@ -72,7 +72,8 @@ mips64obsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                         void *cb_data,
                                         const struct regcache *regcache)
 {
-  cb (".reg", MIPS64OBSD_NUM_REGS * 8, &mips64obsd_gregset, NULL, cb_data);
+  cb (".reg", MIPS64OBSD_NUM_REGS * 8, MIPS64OBSD_NUM_REGS * 8,
+      &mips64obsd_gregset, NULL, cb_data);
 }
 \f
 
index 070fb205fca3efc31551dec71736a14adefd19ca..76e9c6f15f09050b1521730f1cb42ed7ff0339da 100644 (file)
@@ -455,10 +455,10 @@ am33_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                   void *cb_data,
                                   const struct regcache *regcache)
 {
-  cb (".reg", sizeof (mn10300_elf_gregset_t), &am33_gregset,
-      NULL, cb_data);
-  cb (".reg2", sizeof(mn10300_elf_fpregset_t), &am33_fpregset,
-      NULL, cb_data);
+  cb (".reg", sizeof (mn10300_elf_gregset_t), sizeof (mn10300_elf_gregset_t),
+      &am33_gregset, NULL, cb_data);
+  cb (".reg2", sizeof (mn10300_elf_fpregset_t), sizeof (mn10300_elf_fpregset_t),
+      &am33_fpregset, NULL, cb_data);
 }
 \f
 static void
index e7f4ecf16e2ce100bcb294ceea9a9fef7fd62de7..d7e97abf09a82b04d2744dbf5573f6a7dfb20e7f 100644 (file)
@@ -106,7 +106,8 @@ nios2_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                    void *cb_data,
                                    const struct regcache *regcache)
 {
-  cb (".reg", NIOS2_GREGS_SIZE, &nios2_core_regset, NULL, cb_data);
+  cb (".reg", NIOS2_GREGS_SIZE, NIOS2_GREGS_SIZE, &nios2_core_regset, NULL,
+      cb_data);
 }
 
 /* Initialize a trad-frame cache corresponding to the tramp-frame.
index 495ccca8f18c975e78ff71fa48473e2a982808cf..e709c36d585301fa75611a54f32f81bd33f20815 100644 (file)
@@ -128,10 +128,10 @@ ppcfbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (tdep->wordsize == 4)
-    cb (".reg", 148, &ppc32_fbsd_gregset, NULL, cb_data);
+    cb (".reg", 148, 148, &ppc32_fbsd_gregset, NULL, cb_data);
   else
-    cb (".reg", 296, &ppc64_fbsd_gregset, NULL, cb_data);
-  cb (".reg2", 264, &ppc32_fbsd_fpregset, NULL, cb_data);
+    cb (".reg", 296, 296, &ppc64_fbsd_gregset, NULL, cb_data);
+  cb (".reg2", 264, 264, &ppc32_fbsd_fpregset, NULL, cb_data);
 }
 
 /* Default page size.  */
index 33a0b5a83b6f86776e3ecae3440b6b0b4b9d361c..1c0fb7a7413b81b3d9bc7957d4db7584c383560f 100644 (file)
@@ -605,21 +605,21 @@ ppc_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
   int have_vsx = tdep->ppc_vsr0_upper_regnum != -1;
 
   if (tdep->wordsize == 4)
-    cb (".reg", 48 * 4, &ppc32_linux_gregset, NULL, cb_data);
+    cb (".reg", 48 * 4, 48 * 4, &ppc32_linux_gregset, NULL, cb_data);
   else
-    cb (".reg", 48 * 8, &ppc64_linux_gregset, NULL, cb_data);
+    cb (".reg", 48 * 8, 48 * 8, &ppc64_linux_gregset, NULL, cb_data);
 
-  cb (".reg2", 264, &ppc32_linux_fpregset, NULL, cb_data);
+  cb (".reg2", 264, 264, &ppc32_linux_fpregset, NULL, cb_data);
 
   if (have_altivec)
     {
       const struct regset *vrregset = ppc_linux_vrregset (gdbarch);
-      cb (".reg-ppc-vmx", PPC_LINUX_SIZEOF_VRREGSET, vrregset,
-         "ppc Altivec", cb_data);
+      cb (".reg-ppc-vmx", PPC_LINUX_SIZEOF_VRREGSET, PPC_LINUX_SIZEOF_VRREGSET,
+         vrregset, "ppc Altivec", cb_data);
     }
 
   if (have_vsx)
-    cb (".reg-ppc-vsx", PPC_LINUX_SIZEOF_VSXREGSET,
+    cb (".reg-ppc-vsx", PPC_LINUX_SIZEOF_VSXREGSET, PPC_LINUX_SIZEOF_VSXREGSET,
        &ppc32_linux_vsxregset, "POWER7 VSX", cb_data);
 }
 
index c86aeb8a2957c2800d049bad97e438296a2f0438..053ec49e6e81dacdc9bdcdfffa27abfb072da6cc 100644 (file)
@@ -59,8 +59,8 @@ ppcnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                      void *cb_data,
                                      const struct regcache *regcache)
 {
-  cb (".reg", 148, &ppcnbsd_gregset, NULL, cb_data);
-  cb (".reg2", 264, &ppcnbsd_fpregset, NULL, cb_data);
+  cb (".reg", 148, 148, &ppcnbsd_gregset, NULL, cb_data);
+  cb (".reg2", 264, 264, &ppcnbsd_fpregset, NULL, cb_data);
 }
 \f
 
index 838783111a251a6ab599c9af75fe8e4556f445a5..c478324d3858147548bcd928dab0cb6f0bc415fe 100644 (file)
@@ -88,7 +88,7 @@ ppcobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                      void *cb_data,
                                      const struct regcache *regcache)
 {
-  cb (".reg", 412, &ppcobsd_gregset, NULL, cb_data);
+  cb (".reg", 412, 412, &ppcobsd_gregset, NULL, cb_data);
 }
 \f
 
index 47c2ab6d4f4dfa45503160fefde2d177dbe37dc5..d072c0b754f9d7cd956ce44b59bf3776d06d9837 100644 (file)
@@ -50,7 +50,7 @@ riscv_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                           void *cb_data,
                                           const struct regcache *regcache)
 {
-  cb (".reg", (32 * riscv_isa_xlen (gdbarch)),
+  cb (".reg", (32 * riscv_isa_xlen (gdbarch)), (32 * riscv_isa_xlen (gdbarch)),
       &riscv_linux_gregset, NULL, cb_data);
 
   /* TODO: Add FP register support.  */
index 8e69c465fa742ce1bd2c99990bb874e763d3fc18..50a146a4f0e5536a37dccaa61b3ced0d65255def 100644 (file)
@@ -146,9 +146,9 @@ rs6000_aix_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                         const struct regcache *regcache)
 {
   if (gdbarch_tdep (gdbarch)->wordsize == 4)
-    cb (".reg", 592, &rs6000_aix32_regset, NULL, cb_data);
+    cb (".reg", 592, 592, &rs6000_aix32_regset, NULL, cb_data);
   else
-    cb (".reg", 576, &rs6000_aix64_regset, NULL, cb_data);
+    cb (".reg", 576, 576, &rs6000_aix64_regset, NULL, cb_data);
 }
 
 
index 4561559a8556494e4e68f92d3701ed7449e7b74f..ee8fb0110942ded17511a37e78d4bd53f8da70d9 100644 (file)
@@ -273,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,14 +298,14 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
       && (regcache == NULL
          || (REG_VALID
              == regcache->get_register_status (S390_TDB_DWORD0_REGNUM))))
-    cb (".reg-s390-tdb", s390_sizeof_tdbregset, &s390_tdb_regset,
-       "s390 TDB", cb_data);
+    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);
     }
 
@@ -314,12 +315,12 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
     {
       if (regcache == NULL
          || REG_VALID == regcache->get_register_status (S390_GSD_REGNUM))
-       cb (".reg-s390-gs-cb", 4 * 8, &s390_gs_regset,
+       cb (".reg-s390-gs-cb", 4 * 8, 4 * 8, &s390_gs_regset,
            "s390 guarded-storage registers", cb_data);
 
       if (regcache == NULL
          || REG_VALID == regcache->get_register_status (S390_BC_GSD_REGNUM))
-       cb (".reg-s390-gs-bc", 4 * 8, &s390_gsbc_regset,
+       cb (".reg-s390-gs-bc", 4 * 8, 4 * 8, &s390_gsbc_regset,
            "s390 guarded-storage broadcast control", cb_data);
     }
 }
index 16bf00ea024e35d8fa9eb70bbb185fe3aa8f619b..b2887c5eae73793fb3877f05c2c69a12753cc5a2 100644 (file)
@@ -1447,8 +1447,8 @@ score7_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                           void *cb_data,
                                           const struct regcache *regcache)
 {
-  cb (".reg", SCORE7_LINUX_SIZEOF_GREGSET, &score7_linux_gregset,
-      NULL, cb_data);
+  cb (".reg", SCORE7_LINUX_SIZEOF_GREGSET, SCORE7_LINUX_SIZEOF_GREGSET,
+      &score7_linux_gregset, NULL, cb_data);
 }
 
 static struct gdbarch *
index d1a143414df9ce09d795251eff2cf8ba0d48e70a..fe64cf979a01d0d1036a73635347c9edaf7cf02c 100644 (file)
@@ -2232,10 +2232,12 @@ sh_iterate_over_regset_sections (struct gdbarch *gdbarch,
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (tdep->core_gregmap != NULL)
-    cb (".reg", tdep->sizeof_gregset, &sh_corefile_gregset, NULL, cb_data);
+    cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset,
+       &sh_corefile_gregset, NULL, cb_data);
 
   if (tdep->core_fpregmap != NULL)
-    cb (".reg2", tdep->sizeof_fpregset, &sh_corefile_fpregset, NULL, cb_data);
+    cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset,
+       &sh_corefile_fpregset, NULL, cb_data);
 }
 
 /* This is the implementation of gdbarch method
index c638a6d20c432e512f7ad4c772ab8e18385b4cd5..7a50a8d4a97dd15e8ed0515ad03422c19edd9e01 100644 (file)
@@ -1777,8 +1777,10 @@ sparc_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  cb (".reg", tdep->sizeof_gregset, tdep->gregset, NULL, cb_data);
-  cb (".reg2", tdep->sizeof_fpregset, tdep->fpregset, NULL, cb_data);
+  cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, tdep->gregset, NULL,
+      cb_data);
+  cb (".reg2", tdep->sizeof_fpregset, tdep->sizeof_fpregset, tdep->fpregset,
+      NULL, cb_data);
 }
 \f
 
index d5280f3e17bf11c25b7abd6e02a3ba8ef1d3d097..c44bbd15f3ea3dd395a77cf8cf6a7c31c84bdc15 100644 (file)
@@ -99,8 +99,8 @@ tilegx_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                     void *cb_data,
                                     const struct regcache *regcache)
 {
-  cb (".reg", TILEGX_LINUX_SIZEOF_GREGSET, &tilegx_linux_regset,
-      NULL, cb_data);
+  cb (".reg", TILEGX_LINUX_SIZEOF_GREGSET, TILEGX_LINUX_SIZEOF_GREGSET,
+      &tilegx_linux_regset, NULL, cb_data);
 }
 
 /* OS specific initialization of gdbarch.  */
index d07a47790761abe66243744b6b4c90e01e6d82ad..21f2066da28d4f79ff8ce15d2e536e0fd2eb4fb7 100644 (file)
@@ -96,7 +96,7 @@ vax_iterate_over_regset_sections (struct gdbarch *gdbarch,
                                  void *cb_data,
                                  const struct regcache *regcache)
 {
-  cb (".reg", VAX_NUM_REGS * 4, &vax_gregset, NULL, cb_data);
+  cb (".reg", VAX_NUM_REGS * 4, VAX_NUM_REGS * 4, &vax_gregset, NULL, cb_data);
 }
 \f
 /* The VAX UNIX calling convention uses R1 to pass a structure return
index 7c0d8c15a752f97838405518fd7d5f47693cccb7..49a7f023e7d9ec6d0ad3f2ca0dec294eb813b6d4 100644 (file)
@@ -902,8 +902,8 @@ xtensa_iterate_over_regset_sections (struct gdbarch *gdbarch,
 {
   DEBUGTRACE ("xtensa_iterate_over_regset_sections\n");
 
-  cb (".reg", sizeof (xtensa_elf_gregset_t), &xtensa_gregset,
-      NULL, cb_data);
+  cb (".reg", sizeof (xtensa_elf_gregset_t), sizeof (xtensa_elf_gregset_t),
+      &xtensa_gregset, NULL, cb_data);
 }
 
 
This page took 0.052992 seconds and 4 git commands to generate.