Blame SOURCES/gdb-rhbz1187581-power8-regs-not-in-8.2-04of15.patch

689258
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
689258
From: Keith Seitz <keiths@redhat.com>
689258
Date: Fri, 11 Jan 2019 17:02:13 -0500
689258
Subject: gdb-rhbz1187581-power8-regs-not-in-8.2-04of15.patch
689258
689258
;; [PowerPC] Don't zero-initialize vector register buffers
689258
;; Pedro Franco de Carvalho, RH BZ 1187581
689258
689258
[PowerPC] Don't zero-initialize vector register buffers
689258
689258
Now that linux-tdep.c already zero-initializes the buffer used for
689258
generating core file notes, there is no need to do this in the linux
689258
collect functions for the vector regset.  The memsets in gdbserver were
689258
not useful to begin with.
689258
689258
gdb/ChangeLog:
689258
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
689258
689258
    * ppc-linux-tdep.c (ppc_linux_collect_vrregset): Remove.
689258
    (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): Replace
689258
    ppc_linux_collect_vrregset by regcache_collect_regset.
689258
689258
gdb/gdbserver/ChangeLog:
689258
2018-10-26  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>
689258
689258
    * linux-ppc-low.c (ppc_fill_vrregset): Remove memset calls.
689258
689258
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
689258
--- a/gdb/gdbserver/linux-ppc-low.c
689258
+++ b/gdb/gdbserver/linux-ppc-low.c
689258
@@ -495,13 +495,9 @@ ppc_fill_vrregset (struct regcache *regcache, void *buf)
689258
   if (__BYTE_ORDER == __BIG_ENDIAN)
689258
     vscr_offset = 12;
689258
 
689258
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave in
689258
-     case they get displayed somewhere.  */
689258
-  memset (&regset[32 * 16], 0, 16);
689258
   collect_register_by_name (regcache, "vscr",
689258
 			    &regset[32 * 16 + vscr_offset]);
689258
 
689258
-  memset (&regset[33 * 16], 0, 16);
689258
   collect_register_by_name (regcache, "vrsave", &regset[33 * 16]);
689258
 }
689258
 
689258
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
689258
--- a/gdb/ppc-linux-tdep.c
689258
+++ b/gdb/ppc-linux-tdep.c
689258
@@ -444,24 +444,6 @@ ppc_linux_collect_gregset (const struct regset *regset,
689258
     }
689258
 }
689258
 
689258
-static void
689258
-ppc_linux_collect_vrregset (const struct regset *regset,
689258
-			    const struct regcache *regcache,
689258
-			    int regnum, void *buf, size_t len)
689258
-{
689258
-  gdb_byte *vrregs = (gdb_byte *) buf;
689258
-
689258
-  /* Zero-pad the unused bytes in the fields for vscr and vrsave
689258
-     in case they get displayed somewhere (e.g. in core files).  */
689258
-  if (regnum == PPC_VSCR_REGNUM || regnum == -1)
689258
-    memset (&vrregs[32 * 16], 0, 16);
689258
-
689258
-  if (regnum == PPC_VRSAVE_REGNUM || regnum == -1)
689258
-    memset (&vrregs[33 * 16], 0, 16);
689258
-
689258
-  regcache_collect_regset (regset, regcache, regnum, buf, len);
689258
-}
689258
-
689258
 /* Regset descriptions.  */
689258
 static const struct ppc_reg_offsets ppc32_linux_reg_offsets =
689258
   {
689258
@@ -544,13 +526,13 @@ static const struct regcache_map_entry ppc32_be_linux_vrregmap[] =
689258
 static const struct regset ppc32_le_linux_vrregset = {
689258
   ppc32_le_linux_vrregmap,
689258
   regcache_supply_regset,
689258
-  ppc_linux_collect_vrregset
689258
+  regcache_collect_regset
689258
 };
689258
 
689258
 static const struct regset ppc32_be_linux_vrregset = {
689258
   ppc32_be_linux_vrregmap,
689258
   regcache_supply_regset,
689258
-  ppc_linux_collect_vrregset
689258
+  regcache_collect_regset
689258
 };
689258
 
689258
 static const struct regcache_map_entry ppc32_linux_vsxregmap[] =