[PowerPC] Don't zero-initialize vector register buffers
authorPedro Franco de Carvalho <pedromfc@linux.ibm.com>
Fri, 26 Oct 2018 12:37:53 +0000 (09:37 -0300)
committerPedro Franco de Carvalho <pedromfc@linux.ibm.com>
Fri, 26 Oct 2018 12:46:02 +0000 (09:46 -0300)
Now that linux-tdep.c already zero-initializes the buffer used for
generating core file notes, there is no need to do this in the linux
collect functions for the vector regset.  The memsets in gdbserver were
not useful to begin with.

gdb/ChangeLog:
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

* ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove.
(ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace
ppc_linux_collect_vrregset by regcache_collect_regset.

gdb/gdbserver/ChangeLog:
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

* linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.

gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-ppc-low.c
gdb/ppc-linux-tdep.c

index 411f43f30dc2080453f0f751c680e1b12309fb9d..8b7323e54b75ca085a59882c46b19541a6520105 100644 (file)
@@ -1,3 +1,9 @@
+2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
+
+       * ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove.
+       (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace
+       ppc_linux_collect_vrregset by regcache_collect_regset.
+
 2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
 
        * linux-tdep.c (linux_collect_regset_section_cb): Use
index 27f7ab55dbcdac08d5e54c3d56a426c13a68e8ce..42fafac3a8370828cb57336ec3f7a7a92600c20d 100644 (file)
@@ -1,3 +1,7 @@
+2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
+
+       * linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.
+
 2018-10-10  Sergio Durigan Junior  <sergiodj@redhat.com>
            Simon Marchi <simark@simark.ca>
 
index 47428c1529cefa289a88cc4b81cf7e72a8db738d..d1ab69fac99af9d8539b312574a29d5eb8994a0f 100644 (file)
@@ -495,13 +495,9 @@ ppc_fill_vrregset (struct regcache *regcache, void *buf)
   if (__BYTE_ORDER == __BIG_ENDIAN)
     vscr_offset = 12;
 
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave in
-     case they get displayed somewhere.  */
-  memset (&regset[32 * 16], 0, 16);
   collect_register_by_name (regcache, "vscr",
                            &regset[32 * 16 + vscr_offset]);
 
-  memset (&regset[33 * 16], 0, 16);
   collect_register_by_name (regcache, "vrsave", &regset[33 * 16]);
 }
 
index 19c8092988ba78e4d050d4572dc64ad1d7df4052..cb117b6abf3bd7b7ec77045666dd7e1545c55568 100644 (file)
@@ -444,24 +444,6 @@ ppc_linux_collect_gregset (const struct regset *regset,
     }
 }
 
-static void
-ppc_linux_collect_vrregset (const struct regset *regset,
-                           const struct regcache *regcache,
-                           int regnum, void *buf, size_t len)
-{
-  gdb_byte *vrregs = (gdb_byte *) buf;
-
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave
-     in case they get displayed somewhere (e.g. in core files).  */
-  if (regnum == PPC_VSCR_REGNUM || regnum == -1)
-    memset (&vrregs[32 * 16], 0, 16);
-
-  if (regnum == PPC_VRSAVE_REGNUM || regnum == -1)
-    memset (&vrregs[33 * 16], 0, 16);
-
-  regcache_collect_regset (regset, regcache, regnum, buf, len);
-}
-
 /* Regset descriptions.  */
 static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
   {
@@ -544,13 +526,13 @@ static const struct regcache_map_entry ppc32_be_linux_vrregmap[] =
 static const struct regset ppc32_le_linux_vrregset = {
   ppc32_le_linux_vrregmap,
   regcache_supply_regset,
-  ppc_linux_collect_vrregset
+  regcache_collect_regset
 };
 
 static const struct regset ppc32_be_linux_vrregset = {
   ppc32_be_linux_vrregmap,
   regcache_supply_regset,
-  ppc_linux_collect_vrregset
+  regcache_collect_regset
 };
 
 static const struct regcache_map_entry ppc32_linux_vsxregmap[] =
This page took 0.038361 seconds and 4 git commands to generate.