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

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